lib/rake/funnel/support/argument_mapper/styles/nunit.rb in rake-funnel-0.18.0 vs lib/rake/funnel/support/argument_mapper/styles/nunit.rb in rake-funnel-0.19.0
- old
+ new
@@ -11,22 +11,23 @@
@separator = '='
@value_separator = ':'
end
def generate_from(model)
- model.map { |switch|
- switch.values.flatten.map { |value|
+ model.flat_map do |switch|
+ switch.values.flatten.map do |value|
top_level(switch) + nested(value)
- }
- }.flatten(1)
+ end
+ end
end
private
+
def top_level(switch)
[prefix, switch.switch]
end
- def nested(value)
+ def nested(value) # rubocop:disable Metrics/AbcSize
res = []
res << separator unless value.key.nil? && value.value.nil?
res << value.key
res << value_separator unless value.key.nil? || value.value.nil?
res << value.value