Method: Fastlane::ActionsList.parse_options

Defined in:
fastlane/lib/fastlane/documentation/actions_list.rb

.parse_options(options, fill_all = true) ⇒ Object

Helper:

[View source]

193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'fastlane/lib/fastlane/documentation/actions_list.rb', line 193

def self.parse_options(options, fill_all = true)
  rows = []
  rows << [options] if options.kind_of?(String)

  if options.kind_of?(Array)
    options.each do |current|
      if current.kind_of?(FastlaneCore::ConfigItem)
        rows << [current.key.to_s.yellow, current.deprecated ? current.description.red : current.description, current.env_name, current.help_default_value]
      elsif current.kind_of?(Array)
        # Legacy actions that don't use the new config manager
        UI.user_error!("Invalid number of elements in this row: #{current}. Must be 2 or 3") unless [2, 3].include?(current.count)
        rows << current
        rows.last[0] = rows.last.first.yellow # color it yellow :)
        rows.last << nil while fill_all && rows.last.count < 4 # to have a nice border in the table
      end
    end
  end

  rows
end