class MiGA::Cli::Action::Plugins

Public Instance Methods

parse_cli() click to toggle source
# File lib/miga/cli/action/plugins.rb, line 8
def parse_cli
  cli.parse do |opt|
    cli.opt_object(opt, [:project])
    opt.on(
      '--install PATH',
      'Install the specified plugin in the project'
      ){ |v| cli[:install] = v }
    opt.on(
      '--uninstall PATH',
      'Uninstall the specified plugin from the project'
      ){ |v| cli[:uninstall] = v }
  end
end
perform() click to toggle source
# File lib/miga/cli/action/plugins.rb, line 22
def perform
  p = cli.load_project
  p.install_plugin(cli[:install]) unless cli[:install].nil?
  p.uninstall_plugin(cli[:uninstall]) unless cli[:uninstall].nil?
  p.plugins.each { |i| cli.puts i }
end