Loads and interprets the configuration file.
# File lib/ssl_test/config.rb, line 10 def self.load_conf(opts) Config.new(opts) end
TODO: do some basic type validation on the config file.
# File lib/ssl_test/config.rb, line 15 def initialize(opts) @opts = opts @raw = YAML.load_file(@opts[:config]) @certs = @raw['certs'] end
# File lib/ssl_test/config.rb, line 54 def action @opts[:action] end
# File lib/ssl_test/config.rb, line 26 def hosttotest @raw['hostname'] end
# File lib/ssl_test/config.rb, line 30 def listener_port @raw['listener_port'] end
# File lib/ssl_test/config.rb, line 69 def logfile if @opts[:logfile] == '-' STDOUT else @opts[:logfile] end end
# File lib/ssl_test/config.rb, line 58 def loglevel levelstr = if @opts.has_key? :loglevel @opts[:loglevel].upcase elsif @raw.has_key? 'log' and @raw['log'].has_key? 'level' @raw['log']['level'].upcase else 'INFO' end Logger.const_get(levelstr) end
# File lib/ssl_test/config.rb, line 38 def packetthief pt = @raw['packetthief'].dup newvals = {} pt.each_pair do |k,v| if k.kind_of? String newvals[k.to_sym] = v end end pt.merge! newvals pt end
# File lib/ssl_test/config.rb, line 50 def pause? @opts[:pause] end
# File lib/ssl_test/config.rb, line 34 def testing_method @raw['testing_method'] end
# File lib/ssl_test/config.rb, line 22 def tests @raw['tests'] end