Class: Rake::Funnel::Support::ArgumentMapper::Styles::MSDeploy

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMSDeploy

Returns a new instance of MSDeploy.



9
10
11
12
13
14
# File 'lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb', line 9

def initialize
  @prefix = '-'
  @separator = ':'
  @value_separator = '='
  @value_list_separator = ','
end

Instance Attribute Details

#prefixObject (readonly)

Returns the value of attribute prefix.



7
8
9
# File 'lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb', line 7

def prefix
  @prefix
end

#separatorObject (readonly)

Returns the value of attribute separator.



7
8
9
# File 'lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb', line 7

def separator
  @separator
end

#value_list_separatorObject (readonly)

Returns the value of attribute value_list_separator.



7
8
9
# File 'lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb', line 7

def value_list_separator
  @value_list_separator
end

#value_separatorObject (readonly)

Returns the value of attribute value_separator.



7
8
9
# File 'lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb', line 7

def value_separator
  @value_separator
end

Instance Method Details

#generate_from(model) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb', line 16

def generate_from(model)
  model.flat_map do |switch|
    switch.values.map do |item|
      values = if item.is_a?(Enumerable)
                 item.map.with_index { |nested, index| nested(nested, index) }
               else
                 nested(item)
               end

      (top_level(switch) + values).flatten
    end
  end
end