Skip to content

Instantly share code, notes, and snippets.

@burke
Created February 22, 2009 07:48
Show Gist options
  • Save burke/68400 to your computer and use it in GitHub Desktop.
Save burke/68400 to your computer and use it in GitHub Desktop.
class Vhost
def initialize(args)
args.each do |k,v|
instance_variable_set "@#{k}", v
end
@type ||= 'standard'
# We need to wrap @location in slashes, but if it's root,
# we get // or ///, so we collapse multiple /s to a single /
@location = "/#{@location}/"
@location.gsub!(/\/+/,'/')
@types = YAML.load(open("#{CONFIG_PATH}/types.yml"))
end
def to_s
if @types.has_key? @type
eval("return \"#{@types[@type]}\"")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment