Created
February 22, 2009 07:48
-
-
Save burke/68400 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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