Class: Nesta::Config
- Inherits:
-
Object
- Object
- Nesta::Config
- Defined in:
- lib/nesta/config.rb
Class Attribute Summary collapse
-
.author_settings ⇒ Object
Returns the value of attribute author_settings.
-
.settings ⇒ Object
Returns the value of attribute settings.
-
.yaml_conf ⇒ Object
Returns the value of attribute yaml_conf.
Class Method Summary collapse
- .attachment_path(basename = nil) ⇒ Object
- .author ⇒ Object
- .content_path(basename = nil) ⇒ Object
- .method_missing(method, *args) ⇒ Object
- .page_path(basename = nil) ⇒ Object
- .yaml_path ⇒ Object
Class Attribute Details
.author_settings ⇒ Object
Returns the value of attribute author_settings.
15 16 17 |
# File 'lib/nesta/config.rb', line 15 def @author_settings end |
.settings ⇒ Object
Returns the value of attribute settings.
15 16 17 |
# File 'lib/nesta/config.rb', line 15 def settings @settings end |
.yaml_conf ⇒ Object
Returns the value of attribute yaml_conf.
15 16 17 |
# File 'lib/nesta/config.rb', line 15 def yaml_conf @yaml_conf end |
Class Method Details
.attachment_path(basename = nil) ⇒ Object
44 45 46 |
# File 'lib/nesta/config.rb', line 44 def self.(basename = nil) get_path(File.join(content_path, "attachments"), basename) end |
.author ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/nesta/config.rb', line 27 def self. environment_config = {} %w[name uri email].each do |setting| variable = "NESTA_AUTHOR__#{setting.upcase}" ENV[variable] && environment_config[setting] = ENV[variable] end environment_config.empty? ? from_yaml("author") : environment_config end |
.content_path(basename = nil) ⇒ Object
36 37 38 |
# File 'lib/nesta/config.rb', line 36 def self.content_path(basename = nil) get_path(content, basename) end |
.method_missing(method, *args) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/nesta/config.rb', line 18 def self.method_missing(method, *args) setting = method.to_s if settings.include?(setting) from_environment(setting) || from_yaml(setting) else super end end |
.page_path(basename = nil) ⇒ Object
40 41 42 |
# File 'lib/nesta/config.rb', line 40 def self.page_path(basename = nil) get_path(File.join(content_path, "pages"), basename) end |