lib/forj-config.rb in forj-0.0.35 vs lib/forj-config.rb in forj-0.0.36
- old
+ new
@@ -34,11 +34,11 @@
def initialize()
# Load yaml documents (defaults)
# If config doesn't exist, it will be created, empty with 'defaults:' only
if not $LIB_PATH
- raise 'Internal $LIB_PATH was not set.'
+ Logging.fatal(1, 'Internal $LIB_PATH was not set.')
end
Logging.info ('Reading default configuration...')
@sDefaultsName=File.join($LIB_PATH,'defaults.yaml')
@@ -64,11 +64,11 @@
# Load yaml documents (defaults + config)
# If config doesn't exist, it will be created, empty with 'defaults:' only
if not $FORJ_DATA_PATH
- raise 'Internal $FORJ_DATA_PATH was not set.'
+ Logging.fatal(1, 'Internal $FORJ_DATA_PATH was not set.')
end
sConfigDefaultName='config.yaml'
if sConfigName
@@ -188,8 +188,16 @@
@yConfig={ 'default' => @Default.yDefaults['default'].clone }
if @yLocal['default']
@yConfig['default'].merge!(@yLocal['default']) { |key, oldval, newval| key == 'ports'? newval.clone.push(oldval.clone).flatten: newval }
end
@yConfig.merge!(@yLocal) { |key, oldval, newval| key == 'default'? oldval: newval }
+ end
+
+ def LocalDefaultExist?(key)
+ if @yLocal['default'][key]
+ true
+ else
+ false
+ end
end
end