Module: Configulator

Defined in:
lib/configulator.rb,
lib/configulator/version.rb,
lib/configulator/config_template.rb

Defined Under Namespace

Classes: ConfStruct, ConfigTemplate, JSONConfigTemplate, YAMLConfigTemplate

Constant Summary collapse

VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.from_json(conf, environment = nil) ⇒ Object



5
6
7
# File 'lib/configulator.rb', line 5

def self.from_json(conf, environment = nil)
  JSONConfigTemplate.new conf, environment
end

.from_json_file(fname, environment = nil) ⇒ Object



9
10
11
# File 'lib/configulator.rb', line 9

def self.from_json_file(fname, environment = nil)
  from_json File.read(fname), environment
end

.from_yaml(fname, environment = nil) ⇒ Object



13
14
15
# File 'lib/configulator.rb', line 13

def self.from_yaml(fname, environment = nil)
  YAMLConfigTemplate.new fname, environment
end

.from_yaml_file(fname, environment = nil) ⇒ Object



17
18
19
# File 'lib/configulator.rb', line 17

def self.from_yaml_file(fname, environment = nil)
  from_yaml File.read(fname), environment
end