Class: ElibMgmt::Cli::Config
- Inherits:
-
Object
- Object
- ElibMgmt::Cli::Config
- Includes:
- TR::CondUtils
- Defined in:
- lib/elib_mgmt/cli/config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(existing = { }) ⇒ Config
constructor
A new instance of Config.
- #matching_spec(outdir, spec) ⇒ Object
Constructor Details
#initialize(existing = { }) ⇒ Config
Returns a new instance of Config.
19 20 21 |
# File 'lib/elib_mgmt/cli/config.rb', line 19 def initialize(existing = { }) @rec = existing || { } end |
Class Method Details
.load(conf) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/elib_mgmt/cli/config.rb', line 11 def self.load(conf) raise ConfigError, "Config file given is null" if is_empty?(conf) raise ConfigError, "Config file '#{conf}' not found" if not File.exist?(conf) Config.new(YAML.load(File.read(conf))) end |
Instance Method Details
#matching_spec(outdir, spec) ⇒ Object
23 24 25 |
# File 'lib/elib_mgmt/cli/config.rb', line 23 def matching_spec(outdir, spec) @rec[:sort_spec] end |