barsoom_utils 0.1.1.23 → 0.1.1.26

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: 8c5296ac79801731d811f20918a97549e16fd0976421af34c152c28fcf287a59
4
- data.tar.gz: a9f683bb10d8039b24c6d72326f60650d819335731e29282a894b07aa751156d
3
+ metadata.gz: 10930d55fc2f41382fd84181928eadfd8810a7bc15eeb2e780d238d258c6fff2
4
+ data.tar.gz: f7ed3af86e081334055e176ee8f9224110c016dd7ea282c56fb34671f6b831b7
5
5
  SHA512:
6
- metadata.gz: 707dc2525e0a8073c8c7bda645b8362ce26404f4e572b929c8c473297872a4738e68ad39efa56811c235db08a8aa56ba29d4eb28aa116376b8566446784a27f5
7
- data.tar.gz: 9c87b37e7dca2195357848180d54df9594dea3d4e7319e461bda2397a5d59ab883006e361bf90188c6bcfd1c545737334f974450343998deced22262e569facd
6
+ metadata.gz: 4ea10d1960577ef29d3e639d0b0fe86a8a00426d801292e05ba58246f93c14d5b1add923fb3da0cb6f112d6a7cfa8b74265ff05cbdc225e785b52589d19bdbf8
7
+ data.tar.gz: ed65c3c531f562f2bc6fb93e39e8724edd6196274a0768a334a3eeab698b2b7b623ce4f464af67de94b2e69777a0aa8e68b825cd03d1c414369e7e22c8c7473e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1.23
1
+ 0.1.1.26
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barsoom_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.23
4
+ version: 0.1.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Skogberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-24 00:00:00.000000000 Z
11
+ date: 2022-05-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -30,14 +30,12 @@ files:
30
30
  - lib/barsoom_utils.rb
31
31
  - lib/barsoom_utils/exception_notifier.rb
32
32
  - lib/barsoom_utils/feature_toggle.rb
33
- - lib/barsoom_utils/parse_space_separated_token_values.rb
34
33
  - lib/barsoom_utils/ping_health_check.rb
35
34
  - lib/barsoom_utils/spec/debug_helpers.rb
36
35
  - lib/barsoom_utils/version.rb
37
36
  - script/test
38
37
  - shared_rubocop.yml
39
38
  - shared_rubocop_rails.yml
40
- - spec/barsoom_utils/parse_space_separated_token_values_spec.rb
41
39
  - spec/exception_notifier_spec.rb
42
40
  - spec/feature_toggle_spec.rb
43
41
  - spec/ping_health_check_spec.rb
@@ -1,17 +0,0 @@
1
- require "attr_extras"
2
-
3
- module BarsoomUtils
4
- class ParseSpaceSeparatedTokenValues
5
- method_object :value, [ :minimum_key_size!, :token_name! ]
6
-
7
- def call
8
- keys = value.split
9
-
10
- raise "Missing #{token_name}. Quitting." if keys.empty?
11
-
12
- raise "Invalid #{token_name}: a too-short element found. Did a key contain a space? Quitting!" if keys.any? { |api_key| api_key.size < minimum_key_size }
13
-
14
- keys.freeze
15
- end
16
- end
17
- end
@@ -1,39 +0,0 @@
1
- require "barsoom_utils/parse_space_separated_token_values"
2
-
3
- RSpec.describe BarsoomUtils::ParseSpaceSeparatedTokenValues do
4
- let(:minimum_key_size) { 4 }
5
- let(:long_enough_api_key) { "xyza" }
6
- let(:token_name) { "API_TOKENS" }
7
-
8
- subject(:parsed_value) {
9
- described_class.call(api_tokens_value, minimum_key_size: minimum_key_size, token_name: token_name)
10
- }
11
-
12
- context "with a valid set of tokens" do
13
- let(:api_tokens_value) { "#{long_enough_api_key} b#{long_enough_api_key}" }
14
-
15
- it "returns a frozen array" do
16
- expect(parsed_value).to(
17
- be_an(Array)
18
- .and(have_attributes(size: 2))
19
- .and(be_frozen)
20
- )
21
- end
22
- end
23
-
24
- context "with one too-short token" do
25
- let(:api_tokens_value) { "x #{long_enough_api_key}" }
26
-
27
- it "raises an error" do
28
- expect { parsed_value }.to raise_error(/Invalid API_TOKENS/)
29
- end
30
- end
31
-
32
- context "with a blank value" do
33
- let(:api_tokens_value) { " " }
34
-
35
- it "raises an error" do
36
- expect { parsed_value }.to raise_error(/Missing API_TOKENS/)
37
- end
38
- end
39
- end