Sha256: 9397feae8d00ccb96f04cf1f4370bdfdfb678073a7d69d48506e5ea2359b7653

Contents?: true

Size: 899 Bytes

Versions: 6

Compression:

Stored size: 899 Bytes

Contents

require 'json'
require_relative 'step'
require_relative 'support/build_metadata'
require_relative 'support/params'
require_relative 'support/work_dir'

module Fuselage
  class In < Step
    include Support::BuildMetadata
    include Support::Params
    include Support::WorkDir

    Contract None => HashOf[String, String]
    def version
      @version ||= config.fetch 'version'
    rescue KeyError
      STDERR.puts 'Configuration payload is missing version'
      abort
    end

    Contract None => ArrayOf[Maybe[HashOf[String, String]]]
    def metadata
      []
    end

    Contract None => String
    def output
      JSON.dump version: version, metadata: metadata
    end

    Contract None => Any
    def fetch!
      fail NotImplementedError
    end

    Contract None => String
    def run
      fetch!
      p output.tap { |string| STDERR.puts string if debugging? }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
concourse-fuselage-0.5.0 lib/concourse-fuselage/in.rb
concourse-fuselage-0.4.1 lib/concourse-fuselage/in.rb
concourse-fuselage-0.4.0 lib/concourse-fuselage/in.rb
concourse-fuselage-0.3.2 lib/concourse-fuselage/in.rb
concourse-fuselage-0.3.1 lib/concourse-fuselage/in.rb
concourse-fuselage-0.3.0 lib/concourse-fuselage/in.rb