Class: Gem::Commands::DescCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems_plugin.rb

Instance Method Summary collapse

Constructor Details

#initializeDescCommand

Returns a new instance of DescCommand.



24
25
26
27
# File 'lib/rubygems_plugin.rb', line 24

def initialize
  super 'desc', 'Get description of a gem given its name',
        :version => Gem::Requirement.default
end

Instance Method Details

#argumentsObject

:nodoc:



29
30
31
# File 'lib/rubygems_plugin.rb', line 29

def arguments # :nodoc:
  'GEMNAME       name of a gem to describe'
end

#executeObject



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rubygems_plugin.rb', line 37

def execute
  name = get_one_gem_name
  remote_gem = RemoteGem.info_for(name)
  if remote_gem
    say "version: #{remote_gem.version}"
    say "authors: #{remote_gem.authors}"
    say "downloads: #{remote_gem.downloads}"
    say ""
    say "\t#{remote_gem.info}"
  else
    say "Couldn't find #{name} in repository"
  end
end

#usageObject

:nodoc:



33
34
35
# File 'lib/rubygems_plugin.rb', line 33

def usage # :nodoc:
  "#{program_name} GEMNAME [options]"
end