Method: Gem::Commands::OpenCommand#execute

Defined in:
lib/rubygems/commands/open.rb

#executeObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rubygems/commands/open.rb', line 20

def execute
  gemname = options[:args].first

  unless gemname
    say "Usage: #{usage}"
    return terminate_interaction
  end

  spec = search(gemname)

  if spec
    open(spec)
  else
    say "The #{gemname.inspect} gem couldn't be found"
    return terminate_interaction
  end
end