lopata 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lopata/role.rb +12 -0
- data/lib/lopata/scenario_builder.rb +1 -0
- data/lib/lopata/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b391941e9c4d4e42dca98434fc3ccae1275ec3681cc38a3c3aded8fbabff909
|
|
4
|
+
data.tar.gz: 7c8a4d068f8ffdf583413f0fa156441c20d4cab95643a430c02d8b28c7c0fdea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: efbd16b2aea6b5debe630e5739a730cda91de1311682d01527aabc56c5b755055dc9aaae4a003ad317a7b5739450db117423c491be628f077b6d94af4f21476f
|
|
7
|
+
data.tar.gz: 2a7db79eda5d90471d111c54093fab7470055bcedd54aa75b58e5b101af5007671a3f3315f92f4d0baf48086ed1800f7790e9db07d5219867abe915355fb7c44
|
data/lib/lopata/role.rb
CHANGED
|
@@ -133,6 +133,7 @@ module Lopata
|
|
|
133
133
|
# @private
|
|
134
134
|
def option_combinations
|
|
135
135
|
return super() unless @role_groups
|
|
136
|
+
share_role_group_metadata_keys
|
|
136
137
|
@role_groups.flat_map do |group|
|
|
137
138
|
begin
|
|
138
139
|
@current_role_group = group
|
|
@@ -146,6 +147,17 @@ module Lopata
|
|
|
146
147
|
|
|
147
148
|
private
|
|
148
149
|
|
|
150
|
+
# Variants of the same metadata key may be declared in several role groups. Each group knows only the keys
|
|
151
|
+
# of its own variants, so the keys used in other groups are not defined (NoMethodError on access).
|
|
152
|
+
# Share the keys across the groups to get nil for them, as for the variants of a single option.
|
|
153
|
+
def share_role_group_metadata_keys
|
|
154
|
+
all = @role_groups.flat_map { |g| g.options + g.diagonals }
|
|
155
|
+
all.group_by(&:key).each_value do |same_key|
|
|
156
|
+
keys = same_key.flat_map(&:available_metadata_keys).uniq
|
|
157
|
+
same_key.each { |o| o.available_metadata_keys = keys }
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
149
161
|
def add_role_group(roles, use_all_roles, &block)
|
|
150
162
|
if @roles || @without_user
|
|
151
163
|
raise ArgumentError, 'Role groups (as/as_first with block) can not be combined with plain role declaration'
|
data/lib/lopata/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lopata
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.39
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexey Volochnev
|
|
@@ -135,5 +135,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
135
135
|
requirements: []
|
|
136
136
|
rubygems_version: 4.0.20
|
|
137
137
|
specification_version: 4
|
|
138
|
-
summary: lopata-0.1.
|
|
138
|
+
summary: lopata-0.1.39
|
|
139
139
|
test_files: []
|