Method: Gem::AbstractCommand#initialize

Defined in:
lib/commands/abstract_command.rb

#initialize(name, summary) ⇒ AbstractCommand

Returns a new instance of AbstractCommand.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/commands/abstract_command.rb', line 14

def initialize( name, summary )
  super
 
  add_option( '-r', '--repo KEY',
              "pick the configuration under that key.\n                                     can be used in conjuction with --clear-repo and the upload itself." ) do |value, options|
    options[ :nexus_repo ] = value
  end

  add_option( '-c', '--clear-repo',
              'Clears the nexus config for the given repo or the default repo' ) do |value, options|
    options[ :nexus_clear ] = value
  end

  add_option( '--url URL',
              'URL of the rubygems repository on a Nexus server' ) do |value, options|
    options[ :nexus_url ] = value
  end

  add_option( '--credential USER:PASS',
              'Enter your Nexus credentials in "Username:Password" format' ) do |value, options|
    options[ :nexus_credential ] = value
  end

  add_option( '--nexus-config FILE',
              "File location of nexus config to use.\n                                     default #{Nexus::Config.default_file}" ) do |value, options|
    options[ :nexus_config ] = File.expand_path( value )
  end

  add_option( '--ignore-ssl-errors',
              "No check certificate." ) do |value, options|
    options[ :ssl_verify_mode ] = OpenSSL::SSL::VERIFY_NONE
  end
end