strum-service 0.2.1 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -5
- data/Gemfile.lock +32 -33
- data/lib/strum/service/version.rb +1 -1
- data/lib/strum/service.rb +10 -6
- data/strum-service.gemspec +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5189e160a086e20e07bdcc593c18334e8a9b821bbc2f4d26567a2f5fcba08067
|
4
|
+
data.tar.gz: d8d80b04600eeb1b3a2d933b8811d2061b959ff385cee52f1d47d06d60a17aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29510b09777a53d1befe59a80efdb0dca47ed44721e9c3e27c99b6035e3c2084fa6ac5e120f71822e54d9ead423c281c88d1a57f8ef4932dba62504b97e4217b
|
7
|
+
data.tar.gz: fae7e288048a8b8cadccd9a322b211b6a7e9ccc3d248dba6c13150d31cfb0201634f6a094862f491916783ea18dbd5ab122339053a42912f2937fc11facd54c2
|
data/Gemfile
CHANGED
@@ -7,8 +7,8 @@ gemspec
|
|
7
7
|
|
8
8
|
gem "rake", "~> 12.0"
|
9
9
|
|
10
|
-
gem "rspec", "~> 3.
|
11
|
-
gem "rubocop", "~> 1.
|
12
|
-
gem "rubocop-ast", "~> 1.
|
13
|
-
gem "rubocop-rake", "~> 0.
|
14
|
-
gem "rubocop-rspec", "~> 2.
|
10
|
+
gem "rspec", "~> 3.11.0"
|
11
|
+
gem "rubocop", "~> 1.25.1"
|
12
|
+
gem "rubocop-ast", "~> 1.16.0"
|
13
|
+
gem "rubocop-rake", "~> 0.6.0"
|
14
|
+
gem "rubocop-rspec", "~> 2.9.0"
|
data/Gemfile.lock
CHANGED
@@ -1,63 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strum-service (0.2.
|
4
|
+
strum-service (0.2.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
-
diff-lcs (1.
|
11
|
-
parallel (1.
|
12
|
-
parser (3.
|
10
|
+
diff-lcs (1.5.0)
|
11
|
+
parallel (1.21.0)
|
12
|
+
parser (3.1.1.0)
|
13
13
|
ast (~> 2.4.1)
|
14
|
-
rainbow (3.
|
14
|
+
rainbow (3.1.1)
|
15
15
|
rake (12.3.3)
|
16
|
-
regexp_parser (2.
|
16
|
+
regexp_parser (2.2.1)
|
17
17
|
rexml (3.2.5)
|
18
|
-
rspec (3.
|
19
|
-
rspec-core (~> 3.
|
20
|
-
rspec-expectations (~> 3.
|
21
|
-
rspec-mocks (~> 3.
|
22
|
-
rspec-core (3.
|
23
|
-
rspec-support (~> 3.
|
24
|
-
rspec-expectations (3.
|
18
|
+
rspec (3.11.0)
|
19
|
+
rspec-core (~> 3.11.0)
|
20
|
+
rspec-expectations (~> 3.11.0)
|
21
|
+
rspec-mocks (~> 3.11.0)
|
22
|
+
rspec-core (3.11.0)
|
23
|
+
rspec-support (~> 3.11.0)
|
24
|
+
rspec-expectations (3.11.0)
|
25
25
|
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.
|
27
|
-
rspec-mocks (3.
|
26
|
+
rspec-support (~> 3.11.0)
|
27
|
+
rspec-mocks (3.11.0)
|
28
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-support (3.
|
31
|
-
rubocop (1.
|
29
|
+
rspec-support (~> 3.11.0)
|
30
|
+
rspec-support (3.11.0)
|
31
|
+
rubocop (1.25.1)
|
32
32
|
parallel (~> 1.10)
|
33
|
-
parser (>= 3.
|
33
|
+
parser (>= 3.1.0.0)
|
34
34
|
rainbow (>= 2.2.2, < 4.0)
|
35
35
|
regexp_parser (>= 1.8, < 3.0)
|
36
36
|
rexml
|
37
|
-
rubocop-ast (>= 1.
|
37
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
38
38
|
ruby-progressbar (~> 1.7)
|
39
39
|
unicode-display_width (>= 1.4.0, < 3.0)
|
40
|
-
rubocop-ast (1.
|
41
|
-
parser (>= 3.
|
42
|
-
rubocop-rake (0.
|
43
|
-
rubocop
|
44
|
-
rubocop-rspec (2.0.1)
|
40
|
+
rubocop-ast (1.16.0)
|
41
|
+
parser (>= 3.1.1.0)
|
42
|
+
rubocop-rake (0.6.0)
|
45
43
|
rubocop (~> 1.0)
|
46
|
-
|
44
|
+
rubocop-rspec (2.9.0)
|
45
|
+
rubocop (~> 1.19)
|
47
46
|
ruby-progressbar (1.11.0)
|
48
|
-
unicode-display_width (2.
|
47
|
+
unicode-display_width (2.1.0)
|
49
48
|
|
50
49
|
PLATFORMS
|
51
50
|
ruby
|
52
51
|
|
53
52
|
DEPENDENCIES
|
54
53
|
rake (~> 12.0)
|
55
|
-
rspec (~> 3.
|
56
|
-
rubocop (~> 1.
|
57
|
-
rubocop-ast (~> 1.
|
58
|
-
rubocop-rake (~> 0.
|
59
|
-
rubocop-rspec (~> 2.
|
54
|
+
rspec (~> 3.11.0)
|
55
|
+
rubocop (~> 1.25.1)
|
56
|
+
rubocop-ast (~> 1.16.0)
|
57
|
+
rubocop-rake (~> 0.6.0)
|
58
|
+
rubocop-rspec (~> 2.9.0)
|
60
59
|
strum-service!
|
61
60
|
|
62
61
|
BUNDLED WITH
|
63
|
-
2.
|
62
|
+
2.3.14
|
data/lib/strum/service.rb
CHANGED
@@ -45,8 +45,8 @@ module Strum
|
|
45
45
|
|
46
46
|
def execute
|
47
47
|
catch(:exit) do
|
48
|
-
audit
|
49
48
|
yield(self) if block_given?
|
49
|
+
audit
|
50
50
|
call if valid?
|
51
51
|
end
|
52
52
|
valid? ? valid_result : invalid_result
|
@@ -85,7 +85,7 @@ module Strum
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def respond_to_missing?(method_name, include_private = false)
|
88
|
-
input.is_a?(Hash) && input[method_name.to_sym] || super
|
88
|
+
(input.is_a?(Hash) && input[method_name.to_sym]) || super
|
89
89
|
end
|
90
90
|
|
91
91
|
protected
|
@@ -147,7 +147,7 @@ module Strum
|
|
147
147
|
|
148
148
|
def required(*keys)
|
149
149
|
if input.is_a?(Hash)
|
150
|
-
(keys -
|
150
|
+
(keys - service_keys).each { |key| add_error(key, :field_must_exist) }
|
151
151
|
else
|
152
152
|
add_error(:input, :must_be_hash)
|
153
153
|
end
|
@@ -155,7 +155,7 @@ module Strum
|
|
155
155
|
|
156
156
|
def any(*keys)
|
157
157
|
if input.is_a?(Hash)
|
158
|
-
add_error(:input, :any_field_must_exist) unless (keys &
|
158
|
+
add_error(:input, :any_field_must_exist) unless (keys & service_keys).count.positive?
|
159
159
|
else
|
160
160
|
add_error(:input, :must_be_hash)
|
161
161
|
end
|
@@ -163,14 +163,14 @@ module Strum
|
|
163
163
|
|
164
164
|
def sliced(*keys)
|
165
165
|
if input.is_a?(Hash)
|
166
|
-
self.input = input.slice(*keys)
|
166
|
+
self.input = input.merge(args).slice(*keys)
|
167
167
|
else
|
168
168
|
add_error(:input, :must_be_hash)
|
169
169
|
end
|
170
170
|
end
|
171
171
|
|
172
172
|
def sliced_list(*keys)
|
173
|
-
add_error(:input, :must_be_array) &&
|
173
|
+
add_error(:input, :must_be_array) && return unless input.is_a?(Array)
|
174
174
|
|
175
175
|
self.input = input.map do |item|
|
176
176
|
if item.is_a?(Hash)
|
@@ -181,6 +181,10 @@ module Strum
|
|
181
181
|
end
|
182
182
|
end
|
183
183
|
|
184
|
+
def service_keys
|
185
|
+
input.keys | args.keys
|
186
|
+
end
|
187
|
+
|
184
188
|
def array!
|
185
189
|
self.input = [*input]
|
186
190
|
end
|
data/strum-service.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strum-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serhiy Nazarov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Strum Service
|
14
14
|
email:
|
@@ -42,6 +42,7 @@ metadata:
|
|
42
42
|
source_code_uri: https://gitlab.com/strum-rb/strum-service
|
43
43
|
changelog_uri: https://gitlab.com/strum-rb/strum-service/-/blob/master/CHANGELOG.md
|
44
44
|
bug_tracker_uri: https://gitlab.com/strum-rb/strum-service/issues
|
45
|
+
rubygems_mfa_required: 'false'
|
45
46
|
post_install_message:
|
46
47
|
rdoc_options: []
|
47
48
|
require_paths:
|