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: ac777967c42be2ec828febf467411c658f65a87502d643dec04264dbca7c537c
4
- data.tar.gz: e08ceedc6255c027f2aac6a674d965a141f2bd8aec8efa0fd205e90e26d2cb8d
3
+ metadata.gz: 1440d31f3aedeccf5b8c89ec9167d8fd58fa5f2231ac0a4fc42d0c6888e9eee6
4
+ data.tar.gz: e9dbe8129f3d607055d688367a605ff71fb62c2c654177317700d126c50d47ec
5
5
  SHA512:
6
- metadata.gz: bf015bf6c8e15abf9c8549514be6e21f3911e6b7e5ada16cc065dd3518f19bc3e7e5acafa9d300f1fcb59a46a452bdb89c89d9a2f369eb8b5bd133c0394bd652
7
- data.tar.gz: 7178c57d7098897c8e3c6b871c7e1530cd8b6cf51a900bda7c65fbbe583ea04c39042fec411cfdc9dfe3ba58832044ed925c5c25ca2a8ee5d77e6b19e8aea08c
6
+ metadata.gz: bc98fe0ebb03d89745ac2256d2f3813ff887737aadbd7321f77e8be526bc9ccd52380c27cfa6f2e29ad4d720a7d6391778d4c33157fa521aa45057f493998e87
7
+ data.tar.gz: 59f5bbc8ad7ef5c7b8f6ba9ae5ecf50c6f784c95f39c8f9d2c3fc0cd124ec2772a2fadc2fddfcebb4b039a98e5ff8d4ba90011fcf08f467fb85f2008f2775681
data/.exrc CHANGED
@@ -1,7 +1,6 @@
1
- " To enable per-directory .exrc-files, add the following lines to your ~/.vimrc
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.22
1
+ 0.1.1.25
@@ -2,7 +2,20 @@ require "attr_extras"
2
2
 
3
3
  module BarsoomUtils
4
4
  class ParseSpaceSeparatedTokenValues
5
- method_object :value, [ :minimum_key_size!, :token_name! ]
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(api_tokens_value, minimum_key_size: minimum_key_size, token_name: token_name)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barsoom_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.22
4
+ version: 0.1.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Skogberg