Class: Gem::Commands::WhoisCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/gem/commands/whois_command.rb

Instance Method Summary collapse

Constructor Details

#initializeWhoisCommand

Returns a new instance of WhoisCommand.



8
9
10
# File 'lib/gem/commands/whois_command.rb', line 8

def initialize
  super 'whois', 'Show information about the owner of a gem'
end

Instance Method Details

#executeObject



12
13
14
15
16
17
18
# File 'lib/gem/commands/whois_command.rb', line 12

def execute
  require 'rest-client'
  name = get_one_gem_name
  Gem.sources.each { |source| whois_from_source(name, source) }
rescue Exception => ex
  puts "Unhandled Exception: #{ex.class} #{ex.message}"
end