Class: Autoproj::CLI::MainPlugin
- Inherits:
-
Thor
- Object
- Thor
- Autoproj::CLI::MainPlugin
- Defined in:
- lib/autoproj/cli/main_plugin.rb
Instance Method Summary collapse
Instance Method Details
#install(name) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/autoproj/cli/main_plugin.rb', line 37 def install(name) require "autoproj" = Hash.new if [:git] && [:path] raise CLIInvalidArguments, "you can provide only one of --git or --path" elsif [:git] [:git] = [:git] [:branch] = [:branch] elsif [:path] [:path] = [:path] end plugins = read_plugin_list updated_plugins = plugins.merge(name => [[:version], ]) write_plugin_list(updated_plugins) begin install_plugins rescue Exception write_plugin_list(plugins) install_plugins raise end end |
#list ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/autoproj/cli/main_plugin.rb', line 63 def list require "autoproj" read_plugin_list.sort_by(&:first).each do |name, (version, )| args = [version, *.map { |k, v| "#{k}: \"#{v}\"" }] puts "#{name}: #{args.join(', ')}" end end |
#remove(name) ⇒ Object
72 73 74 75 76 77 78 79 |
# File 'lib/autoproj/cli/main_plugin.rb', line 72 def remove(name) require "autoproj" plugins = read_plugin_list updated_plugins = plugins.dup updated_plugins.delete(name) write_plugin_list(updated_plugins) install_plugins end |