Method: App::Config::YAML#reload
- Defined in:
- lib/app/config/yaml.rb
#reload(root: nil, path: nil, encode: nil, decode: nil) ⇒ Object
bulk load configuration in search paths.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/app/config/yaml.rb', line 24 def reload( root: nil, path: nil, encode: nil, decode: nil ) clear @root = root || Dir.pwd @paths = ( path || DEFAULT_PATH ).gsub('$ROOT', @root).split(':') @paths = @paths.map{|it| !it.nil? && !it.empty? ? it : nil}.compact @paths << "." if @paths.empty? @vardir = @paths.last Dir.mkdir( @vardir ) unless ::Dir.exist?( @vardir ) @encode = DEFAULT_ENCODE.merge( encode || {} ) @decode = DEFAULT_DECODE.merge( decode || {} ) ( DEFAULT_MASK ) end |