Class: Commands::About
- Inherits:
-
Object
- Object
- Commands::About
- Defined in:
- lib/commands/plugin/commands.rb
Instance Method Summary collapse
-
#initialize(base_command) ⇒ About
constructor
A new instance of About.
- #options ⇒ Object
- #parse!(args) ⇒ Object
Constructor Details
#initialize(base_command) ⇒ About
Returns a new instance of About.
520 521 522 |
# File 'lib/commands/plugin/commands.rb', line 520 def initialize(base_command) @base_command = base_command end |
Instance Method Details
#options ⇒ Object
524 525 526 527 528 529 530 |
# File 'lib/commands/plugin/commands.rb', line 524 def OptionParser.new do |o| o.set_summary_indent(' ') o. = "Usage: #{@base_command.script_name} about name [name]..." o.define_head "Shows plugin info at {url}/about.yml." end end |
#parse!(args) ⇒ Object
532 533 534 535 536 537 538 539 540 541 542 543 544 545 |
# File 'lib/commands/plugin/commands.rb', line 532 def parse!(args) .parse!(args) args.each do |name| if plugin = ::Plugin.find(name) if about_hash = plugin.about puts about_hash.to_yaml + "\n" next end end puts "Plugin #{name} could not be found in the known repositories." puts end end |