Sha256: f071a1f3d74cd7b6d9ea6d60f61aa2a809e1bfc4aa6503501044c5aeab23bfe6
Contents?: true
Size: 790 Bytes
Versions: 6
Compression:
Stored size: 790 Bytes
Contents
module Rake::Funnel::Support::MapperStyles 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
Version data entries
6 entries across 6 versions & 1 rubygems