concourse-github-status 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 928c74738a708e6447ce584d17dd4cc6ecf4fb5a
4
- data.tar.gz: 4839e9a7cbdf37ec5ccc3c4129a79f1daef33e40
3
+ metadata.gz: ef4594ecf08ea6ef9c9318268072156e2c1bd79d
4
+ data.tar.gz: e2a6a1380658c2068274d86e4844b0bf53889025
5
5
  SHA512:
6
- metadata.gz: db5c46a8b1ec8c13c46896d64413457049032878f75ce92eedf9879a21f5ffeaf613a55e8da644974bc6459493b7b0b218ecca5ef56fa4f6ef764230d4bf4858
7
- data.tar.gz: 4821a99e5bce7c960931acebad89dce5ebbaaa6758fcf2587a4c0b736fd9437d68adca0c2fb23cb6407ebc49a9201d9783aea6ae53f3f973684b85cd7c66c733
6
+ metadata.gz: 03b93e07785664de9b4d09a767a1a229e39cb981d571892eb16578e422aa1d7a2985726cd9ebb91fbd8551faa644af9616802dcbc3f1d9e867a7b18766a51d37
7
+ data.tar.gz: 107e38a1ad904f85f59d51bb30e673e90d1e02d3597cab49bc189f48015782c40cbf747f9134a63ccecc9d1fd32fd53c256af7814683de8601720a1236056de1
@@ -8,7 +8,7 @@ module GitHubStatus
8
8
  include Support::GitHub
9
9
 
10
10
  Contract HashOf[String, String] => String
11
- def to_sha(version)
11
+ def sha(version)
12
12
  @sha ||= version.fetch('context@sha') { commit }.split('@').last
13
13
  end
14
14
 
@@ -30,7 +30,7 @@ module GitHubStatus
30
30
  Contract HashOf[String, String] => ArrayOf[HashOf[String, String]]
31
31
  def since(version)
32
32
  github
33
- .commits_since(repo, date(to_sha(version)))
33
+ .commits_since(repo, date(sha(version)))
34
34
  .map { |commit| { 'context@sha' => "concourseci@#{commit[:sha]}" } }
35
35
  end
36
36
  end
@@ -1,7 +1,6 @@
1
1
  require 'concourse-fuselage'
2
2
  require 'contracts'
3
3
  require_relative 'core'
4
- require_relative 'support/git'
5
4
  require_relative 'support/github'
6
5
  require_relative 'support/params'
7
6
 
@@ -9,9 +8,14 @@ module GitHubStatus
9
8
  class In < Fuselage::In
10
9
  include Core
11
10
  include Support::Params
12
- include Support::Git
13
11
  include Support::GitHub
14
12
 
13
+ Contract HashOf[String, String] => String
14
+ def sha(version)
15
+ @sha ||= version.fetch('context@sha') { commit }.split('@').last
16
+ end
17
+
18
+ Contract None => Maybe[String]
15
19
  def state
16
20
  github
17
21
  .statuses(repo, sha)
@@ -20,6 +24,7 @@ module GitHubStatus
20
24
  .first
21
25
  end
22
26
 
27
+ Contract None => Num
23
28
  def fetch!
24
29
  File.write "#{workdir}/#{context}.state", state
25
30
  end
@@ -1,3 +1,3 @@
1
1
  module GitHubStatus
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.4.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concourse-github-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Olstrom