Sha256: e167130f3a2b8f15f1a53d407d6f479bc35623d86a8cb3aca88d6260dc934b31

Contents?: true

Size: 741 Bytes

Versions: 2

Compression:

Stored size: 741 Bytes

Contents

require 'contracts'

module ConcourseResource
  module RubyGems
    module Support
      # Params for GemResource
      module Source
        include ::Contracts::Core
        include ::Contracts::Builtin

        Contract None => String
        def gem
          @gem ||= source.fetch 'gem'
        rescue KeyError
          STDERR.puts 'Params is missing gem'
          abort
        end

        Contract None => String
        def host
          @host ||= source.fetch('host') { 'rubygems.org' }
        end

        Contract None => String
        def api_key
          @api_key ||= source.fetch 'api_key'
        rescue KeyError
          STDERR.puts 'Source is missing api_key'
          abort
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
concourse-resource-rubygems-0.4.6 lib/concourse-resource/rubygems/support/source.rb
concourse-resource-rubygems-0.4.5 lib/concourse-resource/rubygems/support/source.rb