Method: Configural::Config::SDLFile#_load

Defined in:
lib/configural/config/sdl_file.rb

#_loadObject



55
56
57
58
59
60
61
62
63
64
# File 'lib/configural/config/sdl_file.rb', line 55

def _load
  root = File.open(path, 'r'){ |f| SDL4R.read(f) }
  @data = tag_to_hash( root )
rescue Errno::ENOENT
  @data = {}
rescue SDL4R::SdlParseError, Errno::EACCESS => e
  warn( "WARNING: Could not load config file #{path.inspect}:\n" +
        e.inspect + "\nUsing empty dataset instead." )
  @data = {}
end