The Config class is a singleton that allows class level configuration
# File lib/utility/configuration.rb, line 23 def initialize $cmdopts = get_options @options = YAML::load_file($cmdopts['configfile'] || 'config.yaml') rescue $stderr.puts "WARNING - configuration file not found" @options = {} end
only process configuration file option from command line
# File lib/utility/configuration.rb, line 32 def get_options myopts = {} ARGV.each_with_index do |arg,i| if (arg == '-c' || arg == '--config') && ARGV[i+1] myopts['configfile'] = ARGV[i+1] ARGV.delete_at(i+1) ARGV.delete_at(i) end end myopts end