Method: Doing::Plugins.list_plugins

Defined in:
lib/doing/plugin_manager.rb

.list_plugins(options = {}) ⇒ Object

List available plugins to stdout

Parameters:

  • options (Hash) (defaults to: {})

    additional options

Options Hash (options):

  • :column (Boolean)

    display results in a single column

  • :type (String)

    Plugin type: all, import, or export



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/doing/plugin_manager.rb', line 147

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