Class: Gem::Commands::DocCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::DocCommand
- Defined in:
- lib/rubygems/commands/doc_command.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ DocCommand
constructor
A new instance of DocCommand.
- #usage ⇒ Object
Constructor Details
#initialize ⇒ DocCommand
Returns a new instance of DocCommand.
4 5 6 |
# File 'lib/rubygems/commands/doc_command.rb', line 4 def initialize super 'doc', 'Open gem rdoc' end |
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rubygems/commands/doc_command.rb', line 8 def execute index = Gem::SourceIndex.from_installed_gems spec = index.find_name(get_one_gem_name, Gem::Requirement.default).last if spec.has_rdoc? exec 'open', File.join(spec.installation_path, 'doc', spec.full_name, 'rdoc', 'index.html') else $stderr.puts "#{spec.full_name} does not have rdoc." end def usage "#{program_name} GEMNAME" end end |
#usage ⇒ Object
18 19 20 |
# File 'lib/rubygems/commands/doc_command.rb', line 18 def usage "#{program_name} GEMNAME" end |