barsoom_utils 0.1.1.22 → 0.1.1.25
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1440d31f3aedeccf5b8c89ec9167d8fd58fa5f2231ac0a4fc42d0c6888e9eee6
|
4
|
+
data.tar.gz: e9dbe8129f3d607055d688367a605ff71fb62c2c654177317700d126c50d47ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc98fe0ebb03d89745ac2256d2f3813ff887737aadbd7321f77e8be526bc9ccd52380c27cfa6f2e29ad4d720a7d6391778d4c33157fa521aa45057f493998e87
|
7
|
+
data.tar.gz: 59f5bbc8ad7ef5c7b8f6ba9ae5ecf50c6f784c95f39c8f9d2c3fc0cd124ec2772a2fadc2fddfcebb4b039a98e5ff8d4ba90011fcf08f467fb85f2008f2775681
|
data/.exrc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
" To enable per-directory .exrc
|
1
|
+
" To enable per-directory .exrc files, add the following lines to your ~/.vimrc
|
2
2
|
"
|
3
3
|
" set exrc " enable per-directory .exrc files
|
4
4
|
" set secure " disable unsafe commands in local .exrc files
|
5
5
|
|
6
6
|
let g:turbux_command_rspec = 'script/test'
|
7
|
-
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.1.
|
1
|
+
0.1.1.25
|
@@ -2,7 +2,20 @@ require "attr_extras"
|
|
2
2
|
|
3
3
|
module BarsoomUtils
|
4
4
|
class ParseSpaceSeparatedTokenValues
|
5
|
-
|
5
|
+
attr_private :minimum_key_size, :value, :token_name
|
6
|
+
|
7
|
+
# @param token_name [String] name of ENV key to look up
|
8
|
+
# @param minimum_key_size [Integer] required size of each element
|
9
|
+
# @param data [Hash] defaults to ENV
|
10
|
+
def initialize(token_name, minimum_key_size:, data:)
|
11
|
+
@value = data[token_name].to_s
|
12
|
+
@token_name = token_name
|
13
|
+
@minimum_key_size = minimum_key_size
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.call(token_name, minimum_key_size:, data: ENV)
|
17
|
+
new(token_name, minimum_key_size: minimum_key_size, data: data).call
|
18
|
+
end
|
6
19
|
|
7
20
|
def call
|
8
21
|
keys = value.split
|
@@ -6,7 +6,7 @@ RSpec.describe BarsoomUtils::ParseSpaceSeparatedTokenValues do
|
|
6
6
|
let(:token_name) { "API_TOKENS" }
|
7
7
|
|
8
8
|
subject(:parsed_value) {
|
9
|
-
described_class.call(
|
9
|
+
described_class.call(token_name, minimum_key_size: minimum_key_size, data: { "API_TOKENS" => api_tokens_value })
|
10
10
|
}
|
11
11
|
|
12
12
|
context "with a valid set of tokens" do
|