class Rake::Funnel::Support::ArgumentMapper::Styles::NUnit

Attributes

prefix[R]
separator[R]
value_separator[R]

Public Class Methods

new() click to toggle source
# File lib/rake/funnel/support/argument_mapper/styles/nunit.rb, line 11
def initialize
  @prefix = Rake::Win32.windows? ? '/' : '-'
  @separator = '='
  @value_separator = ':'
end

Public Instance Methods

generate_from(model) click to toggle source
# File lib/rake/funnel/support/argument_mapper/styles/nunit.rb, line 17
def generate_from(model)
  model.flat_map do |switch|
    switch.values.flatten.map do |value|
      top_level(switch) + nested(value)
    end
  end
end

Private Instance Methods

nested(value) click to toggle source
# File lib/rake/funnel/support/argument_mapper/styles/nunit.rb, line 31
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
  res.compact
end
top_level(switch) click to toggle source
# File lib/rake/funnel/support/argument_mapper/styles/nunit.rb, line 27
def top_level(switch)
  [prefix, switch.switch]
end