concourse-github-status 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/concourse-github-status.gemspec +1 -1
- data/lib/github-status/out.rb +15 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcf62ba2ec5d34d746b056e0e81a377fc00ea42a
|
4
|
+
data.tar.gz: da3a983017e2d160cfe4d206e0c23ab5343f3a6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df02495f016d55243ab8b7cc614f6dedc3ec1cab62cb958cdaadbf90c27df1b4a1023c23570ced3d62e690b0368e16b8c0218bef2777d078f8fe4261ae11c1a1
|
7
|
+
data.tar.gz: dfa93c73f9159ed4afa3afb3af972e5d023003dca134a880ebaa9f36c10b732c1590fee98c8458ce762a614a7b6da13c3d56e95b094a37b318e7bc3896460cb2
|
data/lib/github-status/out.rb
CHANGED
@@ -7,6 +7,19 @@ require 'octokit'
|
|
7
7
|
|
8
8
|
module GitHubStatus
|
9
9
|
class Out < Fuselage::Out
|
10
|
+
Contract None => Sawyer::Resource
|
11
|
+
def update!
|
12
|
+
github.create_status repo, sha, state, options
|
13
|
+
rescue Octokit::Error => error
|
14
|
+
STDERR.puts error.message
|
15
|
+
abort
|
16
|
+
end
|
17
|
+
|
18
|
+
Contract None => HashOf[String, String]
|
19
|
+
def version
|
20
|
+
{ 'context@sha' => "#{context}@#{sha}" }
|
21
|
+
end
|
22
|
+
|
10
23
|
Contract None => String
|
11
24
|
def repo
|
12
25
|
@repo ||= source.fetch 'repo'
|
@@ -63,9 +76,9 @@ module GitHubStatus
|
|
63
76
|
}
|
64
77
|
end
|
65
78
|
|
66
|
-
Contract None => Git::
|
79
|
+
Contract None => Git::Base
|
67
80
|
def git
|
68
|
-
@git ||= Git.open "#{
|
81
|
+
@git ||= Git.open "#{workdir}/#{path}"
|
69
82
|
rescue ArgumentError
|
70
83
|
STDERR.puts "#{path} is not a git repository"
|
71
84
|
abort
|
@@ -76,22 +89,9 @@ module GitHubStatus
|
|
76
89
|
@repo ||= git.revparse 'HEAD'
|
77
90
|
end
|
78
91
|
|
79
|
-
Contract None => HashOf[String, String]
|
80
|
-
def version
|
81
|
-
{ 'context@sha' => "#{context}@#{sha}" }
|
82
|
-
end
|
83
|
-
|
84
92
|
Contract None => Octokit::Client
|
85
93
|
def github
|
86
94
|
@github ||= Octokit::Client.new access_token: access_token
|
87
95
|
end
|
88
|
-
|
89
|
-
Contract None => Sawyer::Resource
|
90
|
-
def update!
|
91
|
-
github.create_status repo, sha, state, options
|
92
|
-
rescue Octokit::Error => error
|
93
|
-
STDERR.puts error.message
|
94
|
-
abort
|
95
|
-
end
|
96
96
|
end
|
97
97
|
end
|