git-semaphore 2.3.1 → 2.4.1
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 +5 -5
- data/.rubocop.yml +2 -0
- data/.ruby-version +1 -1
- data/exe/git-semaphore +6 -1
- data/lib/git/semaphore/api_cache.rb +1 -1
- data/lib/git/semaphore/api_enrich.rb +27 -15
- data/lib/git/semaphore/version.rb +1 -10
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 36e4d14f55f0ac7c3509ec0cdc0e9fa620267e6f
|
|
4
|
+
data.tar.gz: b1a28a651e2ce2daf1f7300839f2761093ddc8e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bd6f7aefe3fcd9dad1f0b6ca9d312a2170371cb55da025ab4eea82387e95340d290170babf870be759dd822309da7036a7405e63e039cf2f9007ca83ac2548b
|
|
7
|
+
data.tar.gz: 2a6a7dad8ba6b7458bb535d01b72964be30a8a0b84486d96a1fa4911376238558cf35b4106641460cf932a76deaf92f52662075d52ea15d401430055b597468d
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.3.8
|
data/exe/git-semaphore
CHANGED
|
@@ -17,7 +17,12 @@ options = Slop.parse(help: true) do |o|
|
|
|
17
17
|
BANNER
|
|
18
18
|
|
|
19
19
|
o.on '--version', 'Print the version' do
|
|
20
|
-
|
|
20
|
+
dependencies = [
|
|
21
|
+
"rugged v#{Rugged::VERSION}",
|
|
22
|
+
"#{RUBY_ENGINE} #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}",
|
|
23
|
+
].join(', ')
|
|
24
|
+
|
|
25
|
+
puts "#{Git::Semaphore::NAME} v#{Git::Semaphore::VERSION} (#{dependencies})"
|
|
21
26
|
exit(0)
|
|
22
27
|
end
|
|
23
28
|
|
|
@@ -17,7 +17,7 @@ module Git
|
|
|
17
17
|
|
|
18
18
|
def self.status(project_hash_id, branch_id, refresh, auth_token)
|
|
19
19
|
@status ||= Git::Semaphore.from_json_cache(status_cache(project_hash_id, branch_id), refresh) do
|
|
20
|
-
API.status project_hash_id, branch_id, auth_token
|
|
20
|
+
API::Enrich.status project_hash_id, branch_id, auth_token
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -15,25 +15,37 @@ module Git
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def self.history(project_hash_id, branch_id, auth_token)
|
|
18
|
-
API.history(project_hash_id, branch_id, auth_token).tap do |
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
next unless (started_at = build['started_at'])
|
|
22
|
-
next unless (finished_at = build['finished_at'])
|
|
23
|
-
started_at = Time.parse(started_at)
|
|
24
|
-
finished_at = Time.parse(finished_at)
|
|
25
|
-
build['date'] = {
|
|
26
|
-
started_at: started_at.to_date,
|
|
27
|
-
finished_at: finished_at.to_date,
|
|
28
|
-
}
|
|
29
|
-
build['duration'] = {
|
|
30
|
-
seconds: (finished_at - started_at).to_i,
|
|
31
|
-
minutes: format('%0.2f', (finished_at - started_at) / 60).to_f,
|
|
32
|
-
}
|
|
18
|
+
API.history(project_hash_id, branch_id, auth_token).tap do |history|
|
|
19
|
+
history['builds'].each do |build|
|
|
20
|
+
enrich(build)
|
|
33
21
|
end
|
|
34
22
|
end
|
|
35
23
|
end
|
|
36
24
|
|
|
25
|
+
def self.status(project_hash_id, branch_id, auth_token)
|
|
26
|
+
API.status(project_hash_id, branch_id, auth_token).tap do |status|
|
|
27
|
+
enrich(status)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.enrich(build)
|
|
32
|
+
# build['result'] = "passed", "failed", "stopped" or "pending"
|
|
33
|
+
return unless (started_at = build['started_at'])
|
|
34
|
+
return unless (finished_at = build['finished_at'])
|
|
35
|
+
started_at = Time.parse(started_at)
|
|
36
|
+
finished_at = Time.parse(finished_at)
|
|
37
|
+
build['date'] = {
|
|
38
|
+
started_at: started_at.to_date,
|
|
39
|
+
finished_at: finished_at.to_date,
|
|
40
|
+
}
|
|
41
|
+
build['duration'] = {
|
|
42
|
+
seconds: (finished_at - started_at).to_i,
|
|
43
|
+
minutes: format('%0.2f', (finished_at - started_at) / 60).to_f,
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private_class_method :enrich
|
|
48
|
+
|
|
37
49
|
end
|
|
38
50
|
end
|
|
39
51
|
end
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
require 'rugged'
|
|
2
|
-
|
|
3
1
|
module Git
|
|
4
2
|
module Semaphore
|
|
5
3
|
NAME = 'git-semaphore'.freeze
|
|
6
|
-
VERSION = '2.
|
|
7
|
-
|
|
8
|
-
DEPENDENCY_VERSIONS = [
|
|
9
|
-
"rugged v#{Rugged::VERSION}",
|
|
10
|
-
"#{RUBY_ENGINE} #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}",
|
|
11
|
-
].join(', ').freeze
|
|
12
|
-
|
|
13
|
-
LONG_VERSION = "#{NAME} v#{VERSION} (#{DEPENDENCY_VERSIONS})".freeze
|
|
4
|
+
VERSION = '2.4.1'.freeze
|
|
14
5
|
end
|
|
15
6
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: git-semaphore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Vandenberk
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-11-
|
|
11
|
+
date: 2018-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rugged
|
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
131
131
|
version: '0'
|
|
132
132
|
requirements: []
|
|
133
133
|
rubyforge_project:
|
|
134
|
-
rubygems_version: 2.
|
|
134
|
+
rubygems_version: 2.5.2.3
|
|
135
135
|
signing_key:
|
|
136
136
|
specification_version: 4
|
|
137
137
|
summary: git integration with semaphoreci.com
|