Sha256: 109d17d252ca7b528a61a4488ea74baaacec6693fd28a6afc64f933a3bce7f32

Contents?: true

Size: 684 Bytes

Versions: 15

Compression:

Stored size: 684 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.exist?(path) }
          end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gem-release-2.2.2 lib/gem/release/config/files.rb
gem-release-2.2.1 lib/gem/release/config/files.rb
gem-release-2.2.0 lib/gem/release/config/files.rb
gem-release-2.1.1 lib/gem/release/config/files.rb
gem-release-2.1.0 lib/gem/release/config/files.rb
gem-release-2.0.4 lib/gem/release/config/files.rb
gem-release-2.0.3 lib/gem/release/config/files.rb
gem-release-2.0.2 lib/gem/release/config/files.rb
gem-release-2.0.1 lib/gem/release/config/files.rb
gem-release-2.0.0.rc.3 lib/gem/release/config/files.rb
gem-release-2.0.0.rc.2 lib/gem/release/config/files.rb
gem-release-2.0.0.rc.1 lib/gem/release/config/files.rb
gem-release-2.0.0.dev.5 lib/gem/release/config/files.rb
gem-release-2.0.0.dev.4 lib/gem/release/config/files.rb
gem-release-2.0.0.dev.3 lib/gem/release/config/files.rb