git-semaphore 2.6.0 → 2.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64fe9562a298648ed4e338a137e7897113d2185e
4
- data.tar.gz: 796dcf1d547bab0029f9b78e4be1f71b59bf6098
3
+ metadata.gz: 9fed232a9fd1e8a29fd1083e1161f37ea77ea91f
4
+ data.tar.gz: 3044494fe8a2e01cf45fafc319c57e2100b83e08
5
5
  SHA512:
6
- metadata.gz: fb02f3fe0df5e8e8dad6876e11c928c1bdd6768e89633477d17e354cdf1d5f5f88e0cfe71011a1b5d2c563963b224028c57c506d58a66363b6fedfdf1bc62e3e
7
- data.tar.gz: 1ab4dcb69ddff097ae24ac55164d5064309eb451b883e2af5333186cce0b63d2de04af5ecbe2b9db1b870445c6a2a9361b397a882839aa83fc6f98e27cee2a3b
6
+ metadata.gz: 16c8f3e9f5086d92a9eadb34b1b6d723ea52465fbcaec99f17c2d6e18c644ead5cbeee143908b19ce45484cf5e2c0beb4e773c00999fc7d19551e19e54775673
7
+ data.tar.gz: e7a7f8b6a74ccdf3c7959db150cb0d7a7ee521f7dea3145c6b19baa4fccbbda75cd5b5ddaa2a09e653fe8457349dd49f8961cc0f8755344e0c68a879daed79f9
data/exe/git-semaphore CHANGED
@@ -64,6 +64,14 @@ class SafeProject
64
64
  @project = project
65
65
  end
66
66
 
67
+ def result
68
+ return unless @project.exist?
69
+
70
+ @project.branches(true) # refresh
71
+ status = @project.status(true) # refresh
72
+ status.fetch('result', nil)
73
+ end
74
+
67
75
  def method_missing(name, *args, &block)
68
76
  if @project.exist?
69
77
  @project.send(name, *args, &block)
@@ -88,7 +96,7 @@ when options.projects? then puts Git::Semaphore::Project.all(refresh).to_json
88
96
 
89
97
  when options.browse? then puts project.browse.to_json
90
98
  when options.rebuild? then puts project.rebuild.to_json
91
- when options.result? then puts project.result
99
+ when options.result? then (result = project.result) && puts(result)
92
100
 
93
101
  when options.settings? then puts project.settings.to_json
94
102
  when options.internals? then puts project.internals.to_json
@@ -141,11 +141,6 @@ module Git
141
141
  Git::Semaphore::API.rebuild(project_hash_id, branch_id, @auth_token)
142
142
  end
143
143
 
144
- def result
145
- Git::Semaphore::API.status(project_hash_id, branch_id, @auth_token)\
146
- ['result'] # the latest un-cached build result for the current branch
147
- end
148
-
149
144
  def browse
150
145
  `open #{branch_url}`
151
146
  { url: branch_url }
@@ -1,6 +1,6 @@
1
1
  module Git
2
2
  module Semaphore
3
3
  NAME = 'git-semaphore'.freeze
4
- VERSION = '2.6.0'.freeze
4
+ VERSION = '2.6.1'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-semaphore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk