Class: Taza::Settings
- Inherits:
-
Object
- Object
- Taza::Settings
- Defined in:
- lib/taza/settings.rb
Class Method Summary collapse
-
.config(site_name) ⇒ Object
Taza::Settings.Config(‘google’).
-
.config_file ⇒ Object
Loads the config file for the entire project and returns the hash.
-
.config_file_path ⇒ Object
:nodoc:.
-
.config_folder ⇒ Object
:nodoc:.
-
.path ⇒ Object
:nodoc:.
-
.site_file(site_name) ⇒ Object
:nodoc:.
Class Method Details
.config(site_name) ⇒ Object
Taza::Settings.Config(‘google’)
7 8 9 |
# File 'lib/taza/settings.rb', line 7 def self.config(site_name) site_file(site_name).merge(Options.new.execute) end |
.config_file ⇒ Object
Loads the config file for the entire project and returns the hash. Does not override settings from the ENV variables.
13 14 15 |
# File 'lib/taza/settings.rb', line 13 def self.config_file YAML.load_file(config_file_path) end |
.config_file_path ⇒ Object
:nodoc:
17 18 19 |
# File 'lib/taza/settings.rb', line 17 def self.config_file_path # :nodoc: File.join(config_folder,'config.yml') end |
.config_folder ⇒ Object
:nodoc:
21 22 23 |
# File 'lib/taza/settings.rb', line 21 def self.config_folder # :nodoc: File.join(path,'config') end |
.path ⇒ Object
:nodoc:
29 30 31 |
# File 'lib/taza/settings.rb', line 29 def self.path # :nodoc: '.' end |
.site_file(site_name) ⇒ Object
:nodoc:
25 26 27 |
# File 'lib/taza/settings.rb', line 25 def self.site_file(site_name) # :nodoc: YAML.load(ERB.new(File.read(File.join(config_folder,"#{site_name.underscore}.yml"))).result)[ENV['TAZA_ENV']] end |