Sha256: b38336203db7cf0a0e439bcf3e7bdc018ab164a1bf552e70dc4104d1d223fde0
Contents?: true
Size: 1.07 KB
Versions: 10
Compression:
Stored size: 1.07 KB
Contents
module Rake module Funnel module Support module ArgumentMapper module Styles class NUnit attr_reader :prefix, :separator, :value_separator def initialize @prefix = Rake::Win32.windows? ? '/' : '-' @separator = '=' @value_separator = ':' end def generate_from(model) model.flat_map do |switch| switch.values.flatten.map do |value| top_level(switch) + nested(value) end end end private def top_level(switch) [prefix, switch.switch] end 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 end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems