Sha256: 290d7e9f10c85b5cc76912f2a404b8473da42a402f7a28706abce5d92ded91e7

Contents?: true

Size: 696 Bytes

Versions: 6

Compression:

Stored size: 696 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, canonical_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

6 entries across 6 versions & 1 rubygems

Version Path
concourse-github-status-0.7.1 lib/github-status/in.rb
concourse-github-status-0.7.0 lib/github-status/in.rb
concourse-github-status-0.6.6 lib/github-status/in.rb
concourse-github-status-0.6.4 lib/github-status/in.rb
concourse-github-status-0.6.3 lib/github-status/in.rb
concourse-github-status-0.6.2 lib/github-status/in.rb