knapsack_pro 5.4.0 → 5.5.0

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: 9403659bbc5c95b9b6f0998b7ffdbffbe919522811c651644428eea2df6f3887
4
- data.tar.gz: 139709a119b184958ef73d2268bfeca618f5456c0a410e6198baf8a4d269e05b
3
+ metadata.gz: 792df8662b070a5352ff707690d0ea394a938787a2656856aa5e8a4098954765
4
+ data.tar.gz: 668a573e3cda8c09b99013d8c2b9ea962e13abc1febc0e88bd8613daf7341bd3
5
5
  SHA512:
6
- metadata.gz: 9a5152b40b810546160663243f259b82de186be4c01169cb2881315eadbacaf50a47bc6a8f851dcf0c08aa0f392aeaff3d618886f0cd8aaa1cbb06eac6d2f8b2
7
- data.tar.gz: e20d7cb45f17fffd7420d16ed15cca4c44a0bc022407f97871d6e03290b09fd69da11e06d5dced21a77dcab059c00394909c7977eed849496e805f18a99c7580
6
+ metadata.gz: 1bdd45d85651fc9528a45f9f8604accce2abc04788d0c81809617ce30319901020decb75bdb164cccda7e70fcc9de09c5d08fde4693420684100a502dc5d7bd0
7
+ data.tar.gz: 8c500895bf104fdde5e0817e55a30c2d3d54f3020e19039e291fe6dde836f9ede1e5dc5371c91b1413d23fc2fec998242bae539dbade17c21d08bb05a7d87cb5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ### 5.5.0
4
+
5
+ * Detect user seats for AppVeyor, Codefresh, Codeship
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/221
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.4.1...v5.5.0
10
+
11
+ ### 5.4.1
12
+
13
+ * Fixes RSpec conflict (see https://github.com/KnapsackPro/knapsack_pro-ruby/issues/217)
14
+
15
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/218
16
+
17
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.4.0...v5.4.1
18
+
3
19
  ### 5.4.0
4
20
 
5
21
  * Send to the API the CI provider with a header
@@ -27,6 +27,10 @@ module KnapsackPro
27
27
  ENV['APPVEYOR_BUILD_FOLDER']
28
28
  end
29
29
 
30
+ def user_seat
31
+ ENV['APPVEYOR_REPO_COMMIT_AUTHOR']
32
+ end
33
+
30
34
  def detected
31
35
  ENV.key?('APPVEYOR') ? self.class : nil
32
36
  end
@@ -26,6 +26,10 @@ module KnapsackPro
26
26
  ENV['CIRRUS_WORKING_DIR']
27
27
  end
28
28
 
29
+ def user_seat
30
+ # not provided
31
+ end
32
+
29
33
  def detected
30
34
  ENV.key?('CIRRUS_CI') ? self.class : nil
31
35
  end
@@ -27,6 +27,10 @@ module KnapsackPro
27
27
  # not provided
28
28
  end
29
29
 
30
+ def user_seat
31
+ ENV['CF_BUILD_INITIATOR']
32
+ end
33
+
30
34
  def detected
31
35
  ENV.key?('CF_BUILD_ID') ? self.class : nil
32
36
  end
@@ -26,6 +26,10 @@ module KnapsackPro
26
26
  # not provided
27
27
  end
28
28
 
29
+ def user_seat
30
+ ENV['CI_COMMITTER_NAME']
31
+ end
32
+
29
33
  def detected
30
34
  ENV['CI_NAME'] == 'codeship' ? self.class : nil
31
35
  end
@@ -26,6 +26,10 @@ module KnapsackPro
26
26
  '/app' if node_build_id
27
27
  end
28
28
 
29
+ def user_seat
30
+ # not provided
31
+ end
32
+
29
33
  def detected
30
34
  ENV.key?('HEROKU_TEST_RUN_ID') ? self.class : nil
31
35
  end
@@ -1,6 +1,8 @@
1
1
  module KnapsackPro
2
2
  module Config
3
3
  module CI
4
+ # Semaphore Classic is deprecated
5
+ # https://semaphoreci.com/blog/semaphore-classic-deprecation
4
6
  class Semaphore < Base
5
7
  def node_total
6
8
  ENV['SEMAPHORE_THREAD_COUNT']
@@ -30,6 +30,10 @@ module KnapsackPro
30
30
  end
31
31
  end
32
32
 
33
+ def user_seat
34
+ # not provided
35
+ end
36
+
33
37
  def detected
34
38
  # check 2 keys to be sure we are using Semaphore 2.0
35
39
  ENV.key?('SEMAPHORE') && ENV.key?('SEMAPHORE_WORKFLOW_ID') ? self.class : nil
@@ -18,6 +18,10 @@ module KnapsackPro
18
18
  ENV['TRAVIS_BUILD_DIR']
19
19
  end
20
20
 
21
+ def user_seat
22
+ # not provided
23
+ end
24
+
21
25
  def detected
22
26
  ENV.key?('TRAVIS') ? self.class : nil
23
27
  end
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '5.4.0'
2
+ VERSION = '5.5.0'
3
3
  end
@@ -70,4 +70,18 @@ describe KnapsackPro::Config::CI::AppVeyor do
70
70
  it { should be nil }
71
71
  end
72
72
  end
73
+
74
+ describe '#user_seat' do
75
+ subject { described_class.new.user_seat }
76
+
77
+ context 'when the APPVEYOR_REPO_COMMIT_AUTHOR environment variable exists' do
78
+ let(:env) { { 'APPVEYOR_REPO_COMMIT_AUTHOR' => 'jane_doe' } }
79
+
80
+ it { should eql 'jane_doe' }
81
+ end
82
+
83
+ context "when the APPVEYOR_REPO_COMMIT_AUTHOR environment variable doesn't exist" do
84
+ it { should be nil }
85
+ end
86
+ end
73
87
  end
@@ -63,4 +63,19 @@ describe KnapsackPro::Config::CI::Codefresh do
63
63
 
64
64
  it { should be nil }
65
65
  end
66
+
67
+
68
+ describe '#user_seat' do
69
+ subject { described_class.new.user_seat }
70
+
71
+ context 'when the CF_BUILD_INITIATOR environment variable exists' do
72
+ let(:env) { { 'CF_BUILD_INITIATOR' => 'jane_doe' } }
73
+
74
+ it { should eql 'jane_doe' }
75
+ end
76
+
77
+ context "when the CF_BUILD_INITIATOR environment variable doesn't exist" do
78
+ it { should be nil }
79
+ end
80
+ end
66
81
  end
@@ -63,4 +63,18 @@ describe KnapsackPro::Config::CI::Codeship do
63
63
 
64
64
  it { should be nil }
65
65
  end
66
+
67
+ describe '#user_seat' do
68
+ subject { described_class.new.user_seat }
69
+
70
+ context 'when the CI_COMMITTER_NAME environment variable exists' do
71
+ let(:env) { { 'CI_COMMITTER_NAME' => 'jane_doe' } }
72
+
73
+ it { should eql 'jane_doe' }
74
+ end
75
+
76
+ context "when the CI_COMMITTER_NAME environment variable doesn't exist" do
77
+ it { should be nil }
78
+ end
79
+ end
66
80
  end
@@ -1082,7 +1082,7 @@ describe KnapsackPro::Config::Env do
1082
1082
  ['Other', { 'CI' => 'true'}],
1083
1083
  [nil, {}],
1084
1084
  ].each do |ci, env|
1085
- it "detects #{ci} name" do
1085
+ it "detects #{ci || 'missing CI from env or development'}" do
1086
1086
  stub_const("ENV", env)
1087
1087
 
1088
1088
  expect(described_class.ci_provider).to eq(ci)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -186,7 +186,6 @@ email:
186
186
  - arturtrzop@gmail.com
187
187
  executables:
188
188
  - knapsack_pro
189
- - rspec
190
189
  extensions: []
191
190
  extra_rdoc_files: []
192
191
  files:
@@ -202,7 +201,6 @@ files:
202
201
  - README.md
203
202
  - Rakefile
204
203
  - bin/knapsack_pro
205
- - bin/rspec
206
204
  - knapsack_pro.gemspec
207
205
  - lib/knapsack_pro.rb
208
206
  - lib/knapsack_pro/adapters/base_adapter.rb
data/bin/rspec DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- #
5
- # This file was generated by Bundler.
6
- #
7
- # The application 'rspec' is installed as part of a gem, and
8
- # this file is here to facilitate running it.
9
- #
10
-
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
-
13
- bundle_binstub = File.expand_path("bundle", __dir__)
14
-
15
- if File.file?(bundle_binstub)
16
- if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
17
- load(bundle_binstub)
18
- else
19
- abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20
- Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21
- end
22
- end
23
-
24
- require "rubygems"
25
- require "bundler/setup"
26
-
27
- load Gem.bin_path("rspec-core", "rspec")