servactory 1.9.4 → 1.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/servactory/context/workspace/inputs.rb +13 -1
- data/lib/servactory/context/workspace/internals.rb +15 -3
- data/lib/servactory/context/workspace/outputs.rb +15 -3
- data/lib/servactory/context/workspace.rb +10 -10
- data/lib/servactory/inputs/collection.rb +11 -4
- data/lib/servactory/inputs/dsl.rb +1 -1
- data/lib/servactory/inputs/input.rb +4 -4
- data/lib/servactory/inputs/option_helpers_collection.rb +0 -1
- data/lib/servactory/inputs/options_collection.rb +0 -1
- data/lib/servactory/inputs/tools/check_errors.rb +0 -1
- data/lib/servactory/inputs/validations/errors.rb +0 -1
- data/lib/servactory/internals/collection.rb +11 -4
- data/lib/servactory/internals/internal.rb +1 -1
- data/lib/servactory/methods/aliases_for_make/collection.rb +0 -1
- data/lib/servactory/methods/method_collection.rb +0 -1
- data/lib/servactory/methods/shortcuts_for_make/collection.rb +0 -1
- data/lib/servactory/methods/stage_collection.rb +0 -1
- data/lib/servactory/outputs/collection.rb +11 -4
- data/lib/servactory/result.rb +1 -1
- data/lib/servactory/test_kit/result.rb +3 -3
- data/lib/servactory/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024a5ab65e8e000967f41494655da939111a0a43b4f6d4a941b28daff015def8
|
4
|
+
data.tar.gz: 7ae8df0285b2d9510ddabcbb92d2f0b8061ac74490b0a129793c4a389027bcc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a7541d4d78732b0dcbf549ca15460a96625c1e1a342bb5a6046f18f3e7b036eed2e1e2f44e90db3c70a25f2b0dfdc4ce755d7af1c73f5824d06b54e2329d8e4
|
7
|
+
data.tar.gz: 4cc045df6054d694587c2038de8e63a1e1eda45d93a8912ecdee2d6bfcd42b9955a196c6f8d2f49a9076b078c2dd248d816b6526307961e89fcb5e151c2c894c
|
@@ -10,7 +10,19 @@ module Servactory
|
|
10
10
|
@collection_of_inputs = collection_of_inputs
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def only(*names)
|
14
|
+
@collection_of_inputs
|
15
|
+
.only(*names)
|
16
|
+
.to_h { |input| [input.internal_name, send(input.internal_name)] }
|
17
|
+
end
|
18
|
+
|
19
|
+
def except(*names)
|
20
|
+
@collection_of_inputs
|
21
|
+
.except(*names)
|
22
|
+
.to_h { |input| [input.internal_name, send(input.internal_name)] }
|
23
|
+
end
|
24
|
+
|
25
|
+
def method_missing(name, *_args)
|
14
26
|
if name.to_s.end_with?("=")
|
15
27
|
prepared_name = name.to_s.delete("=").to_sym
|
16
28
|
|
@@ -9,7 +9,19 @@ module Servactory
|
|
9
9
|
@collection_of_internals = collection_of_internals
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def only(*names)
|
13
|
+
@collection_of_internals
|
14
|
+
.only(*names)
|
15
|
+
.to_h { |internal| [internal.name, send(internal.name)] }
|
16
|
+
end
|
17
|
+
|
18
|
+
def except(*names)
|
19
|
+
@collection_of_internals
|
20
|
+
.except(*names)
|
21
|
+
.to_h { |internal| [internal.name, send(internal.name)] }
|
22
|
+
end
|
23
|
+
|
24
|
+
def method_missing(name, *args)
|
13
25
|
if name.to_s.end_with?("=")
|
14
26
|
prepared_name = name.to_s.delete("=").to_sym
|
15
27
|
|
@@ -38,7 +50,7 @@ module Servactory
|
|
38
50
|
value: value
|
39
51
|
)
|
40
52
|
|
41
|
-
@context.send(:
|
53
|
+
@context.send(:assign_servactory_service_storage_internal, internal.name, value)
|
42
54
|
end
|
43
55
|
|
44
56
|
def getter_with(name:, &block) # rubocop:disable Lint/UnusedMethodArgument
|
@@ -47,7 +59,7 @@ module Servactory
|
|
47
59
|
|
48
60
|
return yield if internal.nil?
|
49
61
|
|
50
|
-
internal_value = @context.send(:
|
62
|
+
internal_value = @context.send(:fetch_servactory_service_storage_internal, internal.name)
|
51
63
|
|
52
64
|
if name.to_s.end_with?("?")
|
53
65
|
Servactory::Utils.query_attribute(internal_value)
|
@@ -9,7 +9,19 @@ module Servactory
|
|
9
9
|
@collection_of_outputs = collection_of_outputs
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def only(*names)
|
13
|
+
@collection_of_outputs
|
14
|
+
.only(*names)
|
15
|
+
.to_h { |output| [output.name, send(output.name)] }
|
16
|
+
end
|
17
|
+
|
18
|
+
def except(*names)
|
19
|
+
@collection_of_outputs
|
20
|
+
.except(*names)
|
21
|
+
.to_h { |output| [output.name, send(output.name)] }
|
22
|
+
end
|
23
|
+
|
24
|
+
def method_missing(name, *args)
|
13
25
|
if name.to_s.end_with?("=")
|
14
26
|
prepared_name = name.to_s.delete("=").to_sym
|
15
27
|
|
@@ -38,7 +50,7 @@ module Servactory
|
|
38
50
|
value: value
|
39
51
|
)
|
40
52
|
|
41
|
-
@context.send(:
|
53
|
+
@context.send(:assign_servactory_service_storage_output, output.name, value)
|
42
54
|
end
|
43
55
|
|
44
56
|
def getter_with(name:, &block) # rubocop:disable Lint/UnusedMethodArgument
|
@@ -47,7 +59,7 @@ module Servactory
|
|
47
59
|
|
48
60
|
return yield if output.nil?
|
49
61
|
|
50
|
-
output_value = @context.send(:
|
62
|
+
output_value = @context.send(:fetch_servactory_service_storage_output, output.name)
|
51
63
|
|
52
64
|
if name.to_s.end_with?("?")
|
53
65
|
Servactory::Utils.query_attribute(output_value)
|
@@ -84,24 +84,24 @@ module Servactory
|
|
84
84
|
)
|
85
85
|
end
|
86
86
|
|
87
|
-
def
|
88
|
-
@
|
87
|
+
def servactory_service_storage
|
88
|
+
@servactory_service_storage ||= { internals: {}, outputs: {} }
|
89
89
|
end
|
90
90
|
|
91
|
-
def
|
92
|
-
|
91
|
+
def assign_servactory_service_storage_internal(key, value)
|
92
|
+
servactory_service_storage[:internals].merge!({ key => value })
|
93
93
|
end
|
94
94
|
|
95
|
-
def
|
96
|
-
|
95
|
+
def fetch_servactory_service_storage_internal(key)
|
96
|
+
servactory_service_storage.fetch(:internals).fetch(key, nil)
|
97
97
|
end
|
98
98
|
|
99
|
-
def
|
100
|
-
|
99
|
+
def assign_servactory_service_storage_output(key, value)
|
100
|
+
servactory_service_storage[:outputs].merge!({ key => value })
|
101
101
|
end
|
102
102
|
|
103
|
-
def
|
104
|
-
|
103
|
+
def fetch_servactory_service_storage_output(key)
|
104
|
+
servactory_service_storage.fetch(:outputs).fetch(key, nil)
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
@@ -3,12 +3,19 @@
|
|
3
3
|
module Servactory
|
4
4
|
module Inputs
|
5
5
|
class Collection
|
6
|
-
# NOTE: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes
|
7
6
|
extend Forwardable
|
8
|
-
def_delegators :@collection, :<<, :each, :map, :merge, :find
|
7
|
+
def_delegators :@collection, :<<, :filter, :each, :map, :to_h, :merge, :find
|
9
8
|
|
10
|
-
def initialize(
|
11
|
-
@collection =
|
9
|
+
def initialize(collection = Set.new)
|
10
|
+
@collection = collection
|
11
|
+
end
|
12
|
+
|
13
|
+
def only(*names)
|
14
|
+
Collection.new(filter { |input| names.include?(input.internal_name) })
|
15
|
+
end
|
16
|
+
|
17
|
+
def except(*names)
|
18
|
+
Collection.new(filter { |input| !names.include?(input.internal_name) })
|
12
19
|
end
|
13
20
|
|
14
21
|
def names
|
@@ -9,7 +9,7 @@ module Servactory
|
|
9
9
|
|
10
10
|
attr_reader :name,
|
11
11
|
:internal_name,
|
12
|
-
:
|
12
|
+
:option_helpers
|
13
13
|
|
14
14
|
# rubocop:disable Style/KeywordParametersOrder
|
15
15
|
def initialize(
|
@@ -17,12 +17,12 @@ module Servactory
|
|
17
17
|
*helpers,
|
18
18
|
as: nil,
|
19
19
|
type:,
|
20
|
-
|
20
|
+
option_helpers:,
|
21
21
|
**options
|
22
22
|
)
|
23
23
|
@name = name
|
24
24
|
@internal_name = as.present? ? as : name
|
25
|
-
@
|
25
|
+
@option_helpers = option_helpers
|
26
26
|
|
27
27
|
options = apply_helpers_for_options(helpers: helpers, options: options) if helpers.present?
|
28
28
|
|
@@ -46,7 +46,7 @@ module Servactory
|
|
46
46
|
prepared_options = {}
|
47
47
|
|
48
48
|
helpers.each do |helper|
|
49
|
-
found_helper =
|
49
|
+
found_helper = option_helpers.find_by(name: helper)
|
50
50
|
|
51
51
|
next if found_helper.blank?
|
52
52
|
|
@@ -3,12 +3,19 @@
|
|
3
3
|
module Servactory
|
4
4
|
module Internals
|
5
5
|
class Collection
|
6
|
-
# NOTE: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes
|
7
6
|
extend Forwardable
|
8
|
-
def_delegators :@collection, :<<, :each, :map, :merge, :find
|
7
|
+
def_delegators :@collection, :<<, :filter, :each, :map, :to_h, :merge, :find
|
9
8
|
|
10
|
-
def initialize(
|
11
|
-
@collection =
|
9
|
+
def initialize(collection = Set.new)
|
10
|
+
@collection = collection
|
11
|
+
end
|
12
|
+
|
13
|
+
def only(*names)
|
14
|
+
Collection.new(filter { |internal| names.include?(internal.name) })
|
15
|
+
end
|
16
|
+
|
17
|
+
def except(*names)
|
18
|
+
Collection.new(filter { |internal| !names.include?(internal.name) })
|
12
19
|
end
|
13
20
|
|
14
21
|
def names
|
@@ -3,12 +3,19 @@
|
|
3
3
|
module Servactory
|
4
4
|
module Outputs
|
5
5
|
class Collection
|
6
|
-
# NOTE: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes
|
7
6
|
extend Forwardable
|
8
|
-
def_delegators :@collection, :<<, :each, :map, :merge, :find
|
7
|
+
def_delegators :@collection, :<<, :filter, :each, :map, :to_h, :merge, :find
|
9
8
|
|
10
|
-
def initialize(
|
11
|
-
@collection =
|
9
|
+
def initialize(collection = Set.new)
|
10
|
+
@collection = collection
|
11
|
+
end
|
12
|
+
|
13
|
+
def only(*names)
|
14
|
+
Collection.new(filter { |internal| names.include?(internal.name) })
|
15
|
+
end
|
16
|
+
|
17
|
+
def except(*names)
|
18
|
+
Collection.new(filter { |internal| !names.include?(internal.name) })
|
12
19
|
end
|
13
20
|
|
14
21
|
def names
|
data/lib/servactory/result.rb
CHANGED
@@ -25,7 +25,7 @@ module Servactory
|
|
25
25
|
define_singleton_method(:success?) { true }
|
26
26
|
define_singleton_method(:failure?) { false }
|
27
27
|
|
28
|
-
@context.send(:
|
28
|
+
@context.send(:servactory_service_storage).fetch(:outputs).each_pair do |key, value|
|
29
29
|
define_singleton_method(:"#{key}?") { Servactory::Utils.query_attribute(value) }
|
30
30
|
define_singleton_method(key) { value }
|
31
31
|
end
|
@@ -13,7 +13,7 @@ module Servactory
|
|
13
13
|
|
14
14
|
def initialize(attributes = {})
|
15
15
|
attributes.each_pair do |name, value|
|
16
|
-
|
16
|
+
servactory_service_storage[:outputs].merge!({ name => value })
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -21,8 +21,8 @@ module Servactory
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def
|
25
|
-
@
|
24
|
+
def servactory_service_storage
|
25
|
+
@servactory_service_storage ||= { outputs: {} }
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.0.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 7.0.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: i18n
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '13.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rbs
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.1.3
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.1.3
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +170,14 @@ dependencies:
|
|
156
170
|
requirements:
|
157
171
|
- - "~>"
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: '1.
|
173
|
+
version: '1.5'
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - "~>"
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: '1.
|
180
|
+
version: '1.5'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: yard
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|