Sha256: 4357033117ab10ea1d25f9bcf5d87f0eb32f17398e0bc44a9427af7de736e8b3

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 Bytes

Contents

module Barometer
  KEY_FILE = File.expand_path(File.join('~', '.barometer'))

  class KeyFileParser
    def self.find(*paths)
      if File.exists?(KEY_FILE)
        keys = YAML.load_file(KEY_FILE)

        paths.each do |path|
          if keys && keys.has_key?(path.to_s)
            keys = keys.fetch(path.to_s)
          else
            keys = nil
          end
        end
        keys
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
barometer-0.8.0 lib/barometer/key_file_parser.rb