Sha256: 2e92e076f8bddb46e2fdfb0a71a57ffd95330ffba569b0272c19731293df84a9
Contents?: true
Size: 1.04 KB
Versions: 18
Compression:
Stored size: 1.04 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.map { |switch| switch.values.flatten.map { |value| top_level(switch) + nested(value) } }.flatten(1) end private def top_level(switch) [prefix, switch.switch] end def nested(value) 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
18 entries across 18 versions & 1 rubygems