ci_toolkit 1.2.5 → 1.2.6

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
  SHA256:
3
- metadata.gz: 86221df14b2f00663b451d8a2d4855ad67cef074c3c48770966af2d8543fb134
4
- data.tar.gz: '0178ea21d74a4b047f2ac9e7d57176346fb777aa93b1c03fd18cd5bb6272584e'
3
+ metadata.gz: 7ea8b1d9d2121152ff2f48ecb1265130b549f3a88233711b6b741bc7f49e2405
4
+ data.tar.gz: 8e167d886d553a374a2b1e26a76a6fcd0bda777b295f685d98c944cd7305e704
5
5
  SHA512:
6
- metadata.gz: 6c3705ef9c44edc5a86d49be8dcef6f8b3c934e50e67fdffd9c3d8a8cdb8d502790e4968c2e036ea18c539848d2b4a59b9d39935d562edebc242d15d946da700
7
- data.tar.gz: 17c59b5188031c736c5885918874df044993f11499c9db65c267e85bc04c7928c009da12bb80b880829843102d281e2048dfa56ab731cd8a923a8893539eb81f
6
+ metadata.gz: 5241d883ecd2701c0b56e433934093bce2c095800376c0dc9deb0e88f65054b4db84f487a8280ee9a333f5185f79960a224a6052a60dadc6414ef562c569aa05
7
+ data.tar.gz: 05b5d77bb2699c5c811604e7b99ce96f1dd8506f767b4a77051bc37da6fcb0febe7b8f7568acfb869c05de2364f30c4088b15a0f312cdf4699ef3f12709488bb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.2.5)
4
+ ci_toolkit (1.2.6)
5
5
  faraday
6
6
  faraday_middleware
7
7
  jwt
@@ -9,7 +9,11 @@ module CiToolkit
9
9
  API_VERSION = "v0.1"
10
10
  attr_reader :connection
11
11
 
12
- def initialize(token = ENV["BITRISE_TOKEN"], app_slug = ENV["BITRISE_APP_SLUG"], faraday = nil)
12
+ def initialize(
13
+ token = ENV["BITRISE_TOKEN"],
14
+ app_slug = ENV["BITRISE_APP_SLUG"],
15
+ faraday = nil
16
+ )
13
17
  @token = token
14
18
  @app_slug = app_slug
15
19
  @connection = faraday
@@ -26,8 +30,8 @@ module CiToolkit
26
30
  )
27
31
  @connection.use Faraday::Request::UrlEncoded
28
32
  @connection.use Faraday::Request::Retry
29
- @connection.use FaradayMiddleware::ParseJson
30
33
  @connection.use FaradayMiddleware::EncodeJson
34
+ @connection.use FaradayMiddleware::ParseJson
31
35
  @connection.use FaradayMiddleware::FollowRedirects
32
36
  end
33
37
 
@@ -46,7 +50,7 @@ module CiToolkit
46
50
 
47
51
  def abort_pull_request_builds(pull_request, branch, commit)
48
52
  find_pull_request_builds(pull_request, branch, commit).each do |build|
49
- @connection&.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build[:slug]}/abort", {
53
+ @connection&.post("/#{API_VERSION}/apps/#{@app_slug}/builds/#{build["slug"]}/abort", {
50
54
  abort_reason: "Aborting due to other build failed for pull request #{pull_request}"
51
55
  })
52
56
  end
@@ -61,14 +65,14 @@ module CiToolkit
61
65
  puts "Response:\n"
62
66
  puts response.inspect
63
67
 
64
- builds = response.body[:data]
68
+ builds = response.body["data"]
65
69
  filter_builds_by_commit(builds, commit)
66
70
  end
67
71
 
68
72
  def filter_builds_by_commit(builds, commit)
69
73
  puts "Builds:\n"
70
74
  puts builds.inspect
71
- builds&.select! { |build| build[:commit_hash] == commit }
75
+ builds&.select! { |build| build["commit_hash"] == commit }
72
76
  builds || []
73
77
  end
74
78
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CiToolkit
4
- VERSION = "1.2.5"
4
+ VERSION = "1.2.6"
5
5
  end
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.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller