Sha256: df5e3b3b9a3d2bb7f3753fcb38029bcb3fe1bba08e881463fd032c05abf620ad

Contents?: true

Size: 686 Bytes

Versions: 7

Compression:

Stored size: 686 Bytes

Contents

require 'concourse-fuselage'
require 'contracts'
require_relative 'core'
require_relative 'support/github'
require_relative 'support/params'

module GitHubStatus
  class In < Fuselage::In
    include Core
    include Support::Params
    include Support::GitHub

    Contract None => String
    def sha
      @sha ||= version.fetch('context@sha') { commit }.split('@').last
    end

    Contract None => Maybe[String]
    def state
      github
        .statuses(repo, sha)
        .select { |status| status.context == context }
        .map(&:state)
        .first
    end

    Contract None => Num
    def fetch!
      File.write "#{workdir}/#{context}.state", state
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
concourse-github-status-0.5.11 lib/github-status/in.rb
concourse-github-status-0.5.10 lib/github-status/in.rb
concourse-github-status-0.5.9 lib/github-status/in.rb
concourse-github-status-0.5.8 lib/github-status/in.rb
concourse-github-status-0.5.7 lib/github-status/in.rb
concourse-github-status-0.5.0 lib/github-status/in.rb
concourse-github-status-0.4.3 lib/github-status/in.rb