Module: Artifactory::Defaults

Defined in:
lib/artifactory/defaults.rb

Constant Summary collapse

ENDPOINT =

Default API endpoint

'http://localhost:8080/artifactory'.freeze
USER_AGENT =

Default User Agent header string

"Artifactory Ruby Gem #{Artifactory::VERSION}".freeze

Class Method Summary collapse

Class Method Details

.endpointString

The endpoint where artifactory lives

Returns:

  • (String)


26
27
28
# File 'lib/artifactory/defaults.rb', line 26

def endpoint
  ENV['ARTIFACTORY_ENDPOINT'] || ENDPOINT
end

.optionsHash

The list of calculated default options for the configuration.

Returns:

  • (Hash)


17
18
19
# File 'lib/artifactory/defaults.rb', line 17

def options
  Hash[Configurable.keys.map { |key| [key, send(key)] }]
end

.passwordString?

The HTTP Basic Authentication password

Returns:

  • (String, nil)


53
54
55
# File 'lib/artifactory/defaults.rb', line 53

def password
  ENV['ARTIFACTORY_PASSWORD']
end

.proxyString?

The HTTP Proxy information as a string

Returns:

  • (String, nil)


62
63
64
# File 'lib/artifactory/defaults.rb', line 62

def proxy
  ENV['ARTIFACTORY_PROXY']
end

.user_agentString

The User Agent header to send along

Returns:

  • (String)


35
36
37
# File 'lib/artifactory/defaults.rb', line 35

def user_agent
  ENV['ARTIFACTORY_USER_AGENT'] || USER_AGENT
end

.usernameString?

The HTTP Basic Authentication username

Returns:

  • (String, nil)


44
45
46
# File 'lib/artifactory/defaults.rb', line 44

def username
  ENV['ARTIFACTORY_USERNAME']
end