Class: Gem::Commands::DocsCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::DocsCommand
- Defined in:
- lib/rubygems/commands/docs_command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ DocsCommand
constructor
A new instance of DocsCommand.
Constructor Details
#initialize ⇒ DocsCommand
Returns a new instance of DocsCommand.
3 4 5 |
# File 'lib/rubygems/commands/docs_command.rb', line 3 def initialize super 'docs', "Open a gem's documentation" end |
Instance Method Details
#execute ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rubygems/commands/docs_command.rb', line 7 def execute require "rubygems/home/spec_loader" require "rubygems/home/browser" name = get_one_gem_name link = ::Gem::Home::SpecLoader.get_docs_url(name) if link ::Gem::Home::Browser.open_link(link) else puts "We did our best, but there are no links for this gem" exit 1 end end |