Sha256: c78d567b63175da079f556fbaa86e6aeff6d54aae627e0e53d545dad3d13a96d

Contents?: true

Size: 685 Bytes

Versions: 2

Compression:

Stored size: 685 Bytes

Contents

require 'yaml'
require 'gem/release/helper/hash'

module Gem
  module Release
    class Config
      class Files
        include Helper::Hash

        PATHS = %w(
          ./.gem_release/config.yml
          ./.gem_release.yml
          ~/.gem_release/config.yml
          ~/.gem_release.yml
        )

        def load
          return {} unless path
          symbolize_keys(YAML.load_file(path) || {})
        end

        private

          def path
            @path ||= paths.first
          end

          def paths
            paths = PATHS.map { |path| File.expand_path(path) }
            paths.select { |path| File.exists?(path) }
          end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gem-release-2.0.0.dev.2 lib/gem/release/config/files.rb
gem-release-2.0.0.dev.1 lib/gem/release/config/files.rb