Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove the last bits of VINES_ROOT

This adds a new top-level config directive called `certs`, which sets
the certificates directory (default is conf/certs). Since this is used
for initialization deep inside the cert store, it seems like it
belongs in config.
  • Loading branch information...
commit 1fb14a044954cb1fba826af8dbff326c48bc18d7 1 parent a212575
@jbarnette authored
Showing with 7 additions and 3 deletions.
  1. +1 −2  bin/vines
  2. +5 −0 lib/vines/config.rb
  3. +1 −1  lib/vines/stream.rb
View
3  bin/vines
@@ -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
@@ -91,4 +90,4 @@ rescue SystemExit
rescue Exception => e
puts e.message
exit(1)
-end
+end
View
5 lib/vines/config.rb
@@ -21,6 +21,7 @@ def self.instance
end
def initialize(&block)
+ @certs = "conf/certs"
@vhosts, @ports, @cluster = {}, {}, nil
@null = Storage::Null.new
@router = Router.new(self)
@@ -28,6 +29,10 @@ def initialize(&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?
View
2  lib/vines/stream.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.