Method: Doing::Plugins.list_plugins

Defined in:
lib/doing/plugin_manager.rb

.list_plugins(options = {}) ⇒ Object

List available plugins to stdout

Parameters:

  • options (type, separator) (defaults to: {})


127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/doing/plugin_manager.rb', line 127

def list_plugins(options = {})
  separator = options[:column] ? "\n" : "\t"
  type = options[:type].nil? || options[:type] =~ /all/i ? 'all' : valid_type(options[:type])

  case type
  when :import
    puts plugin_names(type: :import, separator: separator)
  when :export
    puts plugin_names(type: :export, separator: separator)
  else
    print 'Import plugins: '
    puts plugin_names(type: :import, separator: ', ')
    print 'Export plugins: '
    puts plugin_names(type: :export, separator: ', ')
  end
end