Class: WebStat::Configure
- Inherits:
-
Object
- Object
- WebStat::Configure
- Defined in:
- lib/web_stat/configure.rb
Constant Summary collapse
- DEFAULT_CONFIG_FILE_PATH =
'config/web_stat.yml'
Class Method Summary collapse
-
.get ⇒ Object
Get yaml.
-
.get_configure_path ⇒ Object
Get configure path.
-
.get_custom_configure_path ⇒ Object
Get custom configure path.
-
.get_default_configure_path ⇒ Object
Get default configure path.
Class Method Details
.get ⇒ Object
Get yaml
7 8 9 |
# File 'lib/web_stat/configure.rb', line 7 def self.get YAML.load_file(self.get_configure_path) end |
.get_configure_path ⇒ Object
Get configure path
12 13 14 15 16 17 18 |
# File 'lib/web_stat/configure.rb', line 12 def self.get_configure_path if File.exists?(self.get_custom_configure_path) self.get_custom_configure_path else self.get_default_configure_path end end |
.get_custom_configure_path ⇒ Object
Get custom configure path
26 27 28 29 30 31 32 |
# File 'lib/web_stat/configure.rb', line 26 def self.get_custom_configure_path if defined? Rails File.join(Rails.root, DEFAULT_CONFIG_FILE_PATH) else File.join(Bundler.root, DEFAULT_CONFIG_FILE_PATH) end end |
.get_default_configure_path ⇒ Object
Get default configure path
21 22 23 |
# File 'lib/web_stat/configure.rb', line 21 def self.get_default_configure_path File.join(File.("../", __FILE__), DEFAULT_CONFIG_FILE_PATH) end |