ci_toolkit 1.2.6 → 1.3.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: 7ea8b1d9d2121152ff2f48ecb1265130b549f3a88233711b6b741bc7f49e2405
4
- data.tar.gz: 8e167d886d553a374a2b1e26a76a6fcd0bda777b295f685d98c944cd7305e704
3
+ metadata.gz: 160daff3a62b281256f06b811ada074374535c501cf18aac0eb5db4f55372c28
4
+ data.tar.gz: eaf573f7e9a981a29e9092ccb394d9f995df7a154123f66c071f5ead8a6de6f7
5
5
  SHA512:
6
- metadata.gz: 5241d883ecd2701c0b56e433934093bce2c095800376c0dc9deb0e88f65054b4db84f487a8280ee9a333f5185f79960a224a6052a60dadc6414ef562c569aa05
7
- data.tar.gz: 05b5d77bb2699c5c811604e7b99ce96f1dd8506f767b4a77051bc37da6fcb0febe7b8f7568acfb869c05de2364f30c4088b15a0f312cdf4699ef3f12709488bb
6
+ metadata.gz: 9a0cb804aeb575f2db2afed70c41011707c16a6c17bd479ad8d12e0ba4a4d4a96b6ff0ee7ae5236fedc93cf5ae993e40d9d56770436edd59819b5d7523912504
7
+ data.tar.gz: 5b775395bd969cd817a92c3509474dbb98a8fcd7de594f303d942847b7545eea3f89a1f99b6b6e3c376f70097b67f982d4e6ae8c9fe9916d590f9e487c00dab7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.2.6)
4
+ ci_toolkit (1.3.6)
5
5
  faraday
6
6
  faraday_middleware
7
7
  jwt
@@ -39,7 +39,7 @@ GEM
39
39
  faraday_middleware (1.1.0)
40
40
  faraday (~> 1.0)
41
41
  json (2.5.1)
42
- jwt (2.2.3)
42
+ jwt (2.3.0)
43
43
  multipart-post (2.1.1)
44
44
  octokit (4.21.0)
45
45
  faraday (>= 0.9)
data/README.md CHANGED
@@ -17,10 +17,6 @@ Or install it yourself as:
17
17
 
18
18
  $ gem install ci_toolkit
19
19
 
20
- ## Usage
21
-
22
- TODO: Write usage instructions here
23
-
24
20
  ## Development
25
21
 
26
22
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec/test/test-unit` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -9,16 +9,18 @@ module CiToolkit
9
9
  API_VERSION = "v0.1"
10
10
  attr_reader :connection
11
11
 
12
- def initialize(
13
- token = ENV["BITRISE_TOKEN"],
14
- app_slug = ENV["BITRISE_APP_SLUG"],
15
- faraday = nil
16
- )
17
- @token = token
18
- @app_slug = app_slug
12
+ # noinspection Metrics/ParameterLists
13
+ def initialize(options = {
14
+ build_number: ENV["BITRISE_BUILD_NUMBER"],
15
+ token: ENV["BITRISE_TOKEN"],
16
+ app_slug: ENV["BITRISE_APP_SLUG"]
17
+ },
18
+ faraday = nil)
19
+ @build_number = options[:build_number].to_i
20
+ @token = options[:token]
21
+ @app_slug = options[:app_slug]
19
22
  @connection = faraday
20
23
  configure_connection
21
- @connection&.use Faraday::Response::Logger, nil, { headers: true, bodies: true }
22
24
  end
23
25
 
24
26
  def configure_connection
@@ -62,17 +64,12 @@ module CiToolkit
62
64
  pull_request_id: pull_request.to_i,
63
65
  status: 0 # status: 0 == not finished
64
66
  })
65
- puts "Response:\n"
66
- puts response.inspect
67
-
68
67
  builds = response.body["data"]
69
68
  filter_builds_by_commit(builds, commit)
70
69
  end
71
70
 
72
71
  def filter_builds_by_commit(builds, commit)
73
- puts "Builds:\n"
74
- puts builds.inspect
75
- builds&.select! { |build| build["commit_hash"] == commit }
72
+ builds&.select! { |build| build["commit_hash"] == commit && build["build_number"] != @build_number }
76
73
  builds || []
77
74
  end
78
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CiToolkit
4
- VERSION = "1.2.6"
4
+ VERSION = "1.3.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.6
4
+ version: 1.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
236
  requirements: []
237
- rubygems_version: 3.0.3
237
+ rubygems_version: 3.0.3.1
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: Set of CI utilities