Class: GemSearch::Commands::Run

Inherits:
Base
  • Object
show all
Defined in:
lib/gem_search/commands/run.rb

Constant Summary collapse

ENABLE_SORT_OPTS =
{
  'v' => 'version_downloads',
  'a' => 'downloads',
  'n' => 'name',
}

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from GemSearch::Commands::Base

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gem_search/commands/run.rb', line 10

def call
  unless valid?(options.arguments)
    puts options
    abort
  end
  executor = Executor.new
  gem = options.arguments[0]
  executor.search(gem, setup_opts)
rescue GemSearch::LibraryNotFound => e
  puts e.message
  abort
rescue => e
  puts "An unexpected #{e.class} has occurred."
  puts e.message
  puts e.backtrace if ENV['DEBUG']
  abort
end