ci_toolkit 1.4.8 → 1.4.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 910885b713c894576eec434ed74390a2515fd052757cbe3f88dd6a2f57b7566d
4
- data.tar.gz: e12d83ad28862c5c3db7598eebfd5d2d15e6154aa240a14517b1b4661c56d604
3
+ metadata.gz: df7f5bba49c6c9e1161a6c7d5169173557d6a9f26e42936f92fcde54033563d1
4
+ data.tar.gz: a56c807056f491f5b08502ad54c5cc70139733be8119ad3bedd8f50fe795a3b7
5
5
  SHA512:
6
- metadata.gz: 1c45cca7b322bc882da4610b9ce9d7aea7a68a9f5ed1d1a1c14576e51bc4e4a75313895d10f2298f03202e00bbd4e2baecb3b65fb73c0441efbea7abc5a2a740
7
- data.tar.gz: 8c9efef28981894104b2bed2608a55a7b8aa446844cff5c6158fb58568c5f4ba9a21f1603d6365a25314d4ab6769d447bbaffe6e08a95101100eb630f606cb70
6
+ metadata.gz: b3f63b8e2454b4f9af57a82f99ae6c7c2bb62e39ae87d60246f5d9ad1d1163671af6d975437cacdeef62a788128c910890e77eb27725388f926a608a416c0da4
7
+ data.tar.gz: 84b8beecd8f3bf472aace619789500d10b0116b1b4b6b11b05039a0ee410ba9cc44cd34f9d9eab8863fc80117bd5e3bf4409a61d77d879d6a52e2d61b02ac8a1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.4.8)
4
+ ci_toolkit (1.4.9)
5
5
  faraday
6
6
  faraday_middleware
7
7
  jwt
@@ -49,7 +49,7 @@ module CiToolkit
49
49
  })
50
50
  end
51
51
 
52
- def abort_pull_request_builds(pull_request, branch, commit)
52
+ def abort_pull_request_builds(pull_request, branch, commit = nil)
53
53
  find_pull_request_builds(pull_request, branch, commit).each do |build|
54
54
  @connection.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build["slug"]}/abort", {
55
55
  abort_reason: "Aborting due to other build failed for pull request #{pull_request}"
@@ -57,14 +57,15 @@ module CiToolkit
57
57
  end
58
58
  end
59
59
 
60
- def find_pull_request_builds(pull_request, branch, commit)
60
+ def find_pull_request_builds(pull_request, branch, commit = nil)
61
61
  response = @connection.get("/#{API_VERSION}/apps/#{@app_slug}/builds", {
62
62
  branch: branch,
63
63
  pull_request_id: pull_request.to_i,
64
64
  status: 0 # status: 0 == not finished
65
65
  })
66
- builds = response.body["data"]
67
- filter_builds_by_commit(builds, commit)
66
+ builds = response.body["data"] || []
67
+ builds = filter_builds_by_commit(builds, commit) unless commit.nil?
68
+ builds
68
69
  end
69
70
 
70
71
  def filter_builds_by_commit(builds, commit)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.8
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller