Sha256: fd25dfb5e6dc8a4e22e8bc3bfd589d9d0f7043e73d3b5e118aadabac16a15201

Contents?: true

Size: 574 Bytes

Versions: 11

Compression:

Stored size: 574 Bytes

Contents

require 'yaml'
require 'toolrack'

module ElibMgmt
  module Cli
    class ConfigError < StandardError; end
    class Config
      include TR::CondUtils

      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

      def initialize(existing = {  })
        @rec = existing || {  }
      end

      def matching_spec(outdir, spec)
        @rec[:sort_spec]
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
elib_mgmt-cli-0.1.12 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.9 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.8 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.7 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.6 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.5 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.4 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.3 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.2 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.1 lib/elib_mgmt/cli/config.rb
elib_mgmt-cli-0.1.0 lib/elib_mgmt/cli/config.rb