Object
Common-config Reader
Read common config file and return hash opject. If the key does not exist in config file, raise RBatch::CommonConfig::Exception.
Default common config file path is “${RB_HOME}/conf/common.yaml“
config : ${RB_HOME}/conf/common.yaml
key: value array: * item1 * item2 * item3
script : ${RB_HOME}/bin/sample.rb
require 'rbatch' p RBatch::common_config => {"key" => "value", "array" => ["item1", "item2", "item3"]}
# File lib/rbatch/common_config.rb, line 35 35: def[](key) 36: if @hash.nil? 37: raise RBatch::CommonConfig::Exception, "Common Config file \"#{@path}\" does not exist" 38: end 39: if @hash[key].nil? 40: if key.class == Symbol 41: raise RBatch::CommonConfig::Exception, "Value of key(:#{key} (Symbol)) is nil. By any chance, dou you mistake key class Symbol for String?" 42: elsif key.class == String 43: raise RBatch::CommonConfig::Exception, "Value of key(\"#{key}\" (String)) is nil" 44: else 45: raise RBatch::CommonConfig::Exception, "Value of key(#{key}) is nil" 46: end 47: else 48: @hash[key] 49: end 50: end
# File lib/rbatch/common_config.rb, line 52 52: def exist? ; ! @hash.nil? ; end
# File lib/rbatch/common_config.rb, line 51 51: def path ; @path ; end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.