knapsack_pro 5.4.1 → 5.5.0

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: e62965afc4edc8d9b00b2a2706499f2013b7e17df08d1864ba8bd6e25aae29ab
4
- data.tar.gz: 2b5c2d0a48780c1f71fa8d99dcae03d23d1001cabcd9a7dbe6a243b32e152e75
3
+ metadata.gz: 792df8662b070a5352ff707690d0ea394a938787a2656856aa5e8a4098954765
4
+ data.tar.gz: 668a573e3cda8c09b99013d8c2b9ea962e13abc1febc0e88bd8613daf7341bd3
5
5
  SHA512:
6
- metadata.gz: 4a4d493dc1b46234b78f231567d7bfc7c1a6cf356dc0e02306f7a7c3261afd600b72be07c389c051ed96e09e491abc95f8d703c1432a22d1ed97d875b8d1fdf6
7
- data.tar.gz: d406b157ef48520309ac3fb043738515105612f89389753a153ed074398f9b7f5bf5f6766f3c57a3407c25eb0982d81b5bc8109f8f8a4ac09911847a2c512c16
6
+ metadata.gz: 1bdd45d85651fc9528a45f9f8604accce2abc04788d0c81809617ce30319901020decb75bdb164cccda7e70fcc9de09c5d08fde4693420684100a502dc5d7bd0
7
+ data.tar.gz: 8c500895bf104fdde5e0817e55a30c2d3d54f3020e19039e291fe6dde836f9ede1e5dc5371c91b1413d23fc2fec998242bae539dbade17c21d08bb05a7d87cb5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ### 5.4.1
4
12
 
5
13
  * Fixes RSpec conflict (see https://github.com/KnapsackPro/knapsack_pro-ruby/issues/217)
@@ -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.1'
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.1
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