Class: TRMNLP::Commands::List
Defined Under Namespace
Classes: Options
Constant Summary collapse
- PRIVATE_PLUGIN_ID =
37- ID_WIDTH =
8- RULE_WIDTH =
50
Instance Method Summary collapse
Methods inherited from Base
#initialize, options_from, run
Constructor Details
This class inherits a constructor from TRMNLP::Commands::Base
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/trmnlp/commands/list.rb', line 15 def call authenticate! api = APIClient.new(config) response = api.get_plugin_settings plugins = (response || []) .select { |p| p['plugin_id'].nil? || p['plugin_id'] == PRIVATE_PLUGIN_ID } .sort_by { |p| (p['name'] || '').downcase } if plugins.empty? reporter.info 'No plugins found.' return end reporter.info "Your plugins:\n\n" report_table(plugins) reporter.info "\nTo clone a plugin:" reporter.info ' trmnlp clone [folder_name] [id]' end |