Class: Gem::Commands::ScanCommand

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

Constant Summary collapse

GemrageHost =
'http://gemrage.com/'

Instance Method Summary collapse

Constructor Details

#initializeScanCommand

Returns a new instance of ScanCommand.



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rubygems/commands/scan_command.rb', line 25

def initialize
  super('scan', description)
  defaults.merge!(:host => GemrageHost, :force_basic => false)
  add_option('-H', '--host HOST', 'Host to push to. Really only so we can debug') do |v, o|
    o[:host] = v
  end

  add_option('-b', '--basic', 'Force a basic scan') do |v,o|
    o[:force_basic] = true
  end
end

Instance Method Details

#argumentsObject



41
42
43
# File 'lib/rubygems/commands/scan_command.rb', line 41

def arguments
  '[DIR]        Optional directory to scan for project files'
end

#descriptionObject



37
38
39
# File 'lib/rubygems/commands/scan_command.rb', line 37

def description
  'Scan your gems and upload to gemrage.com'
end

#executeObject



49
50
51
52
53
54
55
# File 'lib/rubygems/commands/scan_command.rb', line 49

def execute
  if dir = get_one_optional_argument
    send_project_to_gemrage(project_scan(File.expand_path(dir)))
  else
    send_system_to_gemrage(system_scan)
  end
end

#usageObject



45
46
47
# File 'lib/rubygems/commands/scan_command.rb', line 45

def usage
  program_name
end