Skip to content

Commit

Permalink
Merge pull request #16 from jbarnette/embeddable
Browse files Browse the repository at this point in the history
Remove the last bits of VINES_ROOT
  • Loading branch information
dgraham committed Sep 8, 2012
2 parents 4cf4446 + 1fb14a0 commit 24051fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions bin/vines
Expand Up @@ -80,7 +80,6 @@ def check_config(opts)
end
end

VINES_ROOT = Dir.pwd
opts = parse(ARGV)
check_config(opts)
command = Vines::Command.const_get(opts[:command].capitalize).new
Expand All @@ -91,4 +90,4 @@ rescue SystemExit
rescue Exception => e
puts e.message
exit(1)
end
end
5 changes: 5 additions & 0 deletions lib/vines/config.rb
Expand Up @@ -21,13 +21,18 @@ def self.instance
end

def initialize(&block)
@certs = "conf/certs"
@vhosts, @ports, @cluster = {}, {}, nil
@null = Storage::Null.new
@router = Router.new(self)
instance_eval(&block)
raise "must define at least one virtual host" if @vhosts.empty?
end

def certs value = nil
File.expand_path value ? @certs = value : @certs
end

def host(*names, &block)
names = names.flatten.map {|name| name.downcase }
dupes = names.uniq.size != names.size || (@vhosts.keys & names).any?
Expand Down
2 changes: 1 addition & 1 deletion lib/vines/stream.rb
Expand Up @@ -21,7 +21,7 @@ def post_init
@remote_addr, @local_addr = addresses
@user, @closed, @stanza_size = nil, false, 0
@bucket = TokenBucket.new(100, 10)
@store = Store.new(File.join(VINES_ROOT, 'conf', 'certs'))
@store = Store.new(@config.certs)
@nodes = EM::Queue.new
process_node_queue
create_parser
Expand Down

0 comments on commit 24051fa

Please sign in to comment.