Class: Gem::Commands::GmanCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/gman_command.rb

Instance Method Summary collapse

Constructor Details

#initializeGmanCommand

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

#argumentsObject



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

#executeObject



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

#usageObject



10
11
12
# File 'lib/rubygems/commands/gman_command.rb', line 10

def usage
  "gem gman [GEMNAME]"
end