Sha256: 1179425156b8ac6e5f22dbc2b6060156a36fba26731af594efc0bf2b8eed79a0

Contents?: true

Size: 588 Bytes

Versions: 3

Compression:

Stored size: 588 Bytes

Contents

require 'concourse-fuselage'
require 'contracts'
require 'httparty'
require_relative 'core'

module ConcourseResource
  module RubyGems
    # In Step
    class In < Fuselage::In
      include Core

      def filename
        @filename ||= "#{gem}-#{version.fetch 'number'}.gem"
      rescue KeyError
        STDERR.puts 'config.version is missing number', version
        abort
      end

      def download
        @download ||= HTTParty.get "https://#{host}/gems/#{filename}"
      end

      def fetch!
        File.write "#{workdir}/#{filename}", download
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
concourse-resource-rubygems-0.4.6 lib/concourse-resource/rubygems/in.rb
concourse-resource-rubygems-0.4.5 lib/concourse-resource/rubygems/in.rb
concourse-resource-rubygems-0.3.4 lib/concourse-resource/rubygems/in.rb