Method: BatchKit::Config#load

Defined in:
lib/batch-kit/config.rb

#load(path, options = {}) ⇒ Object

Read a properties or YAML file at the path specified in path, and load the contents to this Config object.

Parameters:

  • path (String)

    The path to the properties or YAML file to be loaded.

  • options (Hash) (defaults to: {})

    An options hash.

Options Hash (options):

  • @raise_on_unknown_var (Boolean)

    Whether to raise an error if an unrecognised placeholder variable is encountered in the file.



146
147
148
149
150
151
# File 'lib/batch-kit/config.rb', line 146

def load(path, options = {})
    props = case File.extname(path)
    when /\.yaml/i then self.load_yaml(path, options)
    else self.load_properties(path, options)
    end
end