Class: Gem::Commands::GmanCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::GmanCommand
- Defined in:
- lib/rubygems/commands/gman_command.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #document(gem) ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ GmanCommand
constructor
A new instance of GmanCommand.
- #usage ⇒ Object
Constructor Details
#initialize ⇒ GmanCommand
Returns a new instance of GmanCommand.
6 7 8 |
# File 'lib/rubygems/commands/gman_command.rb', line 6 def initialize super "gman", "Generate and install man pages for gems" end |
Instance Method Details
#arguments ⇒ Object
14 15 16 |
# File 'lib/rubygems/commands/gman_command.rb', line 14 def arguments "GEMNAME name of gem to generate man pages for" end |
#document(gem) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rubygems/commands/gman_command.rb', line 26 def document(gem) inside_gem_directory gem do if files(gem).empty? say "No source files found for #{gem.full_name}." else say "Generating man pages for #{gem.full_name}..." run_rdoc(gem) end end rescue => exception say "Failed to generate man pages for #{gem.full_name} (#{exception})." end |
#execute ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rubygems/commands/gman_command.rb', line 18 def execute if name = get_one_optional_argument document_gem_with_name name else document_all_gems end end |
#usage ⇒ Object
10 11 12 |
# File 'lib/rubygems/commands/gman_command.rb', line 10 def usage "gem gman [GEMNAME]" end |