Class: Redmine::Configuration
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Redmine::Configuration
- Defined in:
- lib/redmine/configuration.rb
Overview
Container for library-level configuration, acting like an OpenStruct.
Constant Summary collapse
- CONFIG_FILENAME =
Filename of configuration files to look for.
'.redmine.yml'.freeze
Class Method Summary collapse
-
.autoload ⇒ Object
Load configuration from special YAML config files on disk, looking into the current directory and upwards, merging all together.
Class Method Details
.autoload ⇒ Object
Load configuration from special YAML config files on disk, looking into the current directory and upwards, merging all together.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/redmine/configuration.rb', line 13 def self.autoload new(Pathname .pwd .ascend .lazy .map { |p| p.join(CONFIG_FILENAME) } .select(&:exist?) .map { |p| YAML.load_file(p) } .to_a .reverse .inject(:merge) ) end |