Class: Taza::Settings

Inherits:
Object show all
Defined in:
lib/taza/settings.rb

Class Method Summary collapse

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_fileObject

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_pathObject

: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_folderObject

:nodoc:



21
22
23
# File 'lib/taza/settings.rb', line 21

def self.config_folder # :nodoc:
  File.join(path,'config')
end

.pathObject

: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_file(File.join(config_folder,"#{site_name.underscore}.yml"))[ENV['TAZA_ENV']]
end