lib/github-status/in.rb in concourse-github-status-0.3.1 vs lib/github-status/in.rb in concourse-github-status-0.4.0
- old
+ new
@@ -1,6 +1,27 @@
require 'concourse-fuselage'
+require 'contracts'
+require_relative 'core'
+require_relative 'support/git'
+require_relative 'support/github'
+require_relative 'support/params'
module GitHubStatus
class In < Fuselage::In
+ include Core
+ include Support::Params
+ include Support::Git
+ include Support::GitHub
+
+ def status
+ github
+ .statuses(repo, sha)
+ .select { |status| status.context == context }
+ .map(&:state)
+ .first
+ end
+
+ def fetch!
+ File.write "#{workdir}/#{context}.state", state
+ end
end
end