Module: VagrantCloud::Defaults
- Included in:
- Configurable
- Defined in:
- lib/vagrant-cloud/defaults.rb
Constant Summary collapse
- USER_AGENT =
Default User Agent header string
"Vagrant Cloud Ruby Gem #{VagrantCloud::VERSION}".freeze
Class Method Summary collapse
-
.access_token ⇒ String?
The Vagrant Cloud access token to authenticate with.
-
.endpoint ⇒ String
The Vagrant Cloud endpoint.
-
.options ⇒ Hash
The list of calculated default options for the configuration.
-
.proxy_address ⇒ String?
The HTTP Proxy server address.
-
.proxy_password ⇒ String?
The HTTP Proxy server user’s password.
-
.proxy_port ⇒ String?
The HTTP Proxy server port.
-
.proxy_username ⇒ String?
The HTTP Proxy server username.
-
.ssl_pem_file ⇒ String?
The path to a pem file on disk for use with a custom SSL verification.
-
.ssl_verify ⇒ true, false
Verify SSL requests (default: true).
-
.user_agent ⇒ String
The User Agent header to send along.
-
.username ⇒ String?
The Vagrant Cloud username or organization to authenticate with.
Class Method Details
.access_token ⇒ String?
The Vagrant Cloud access token to authenticate with.
49 50 51 |
# File 'lib/vagrant-cloud/defaults.rb', line 49 def access_token ENV['VAGRANT_CLOUD_ACCESS_TOKEN'] end |
.endpoint ⇒ String
The Vagrant Cloud endpoint. For enterprise installations, this must be overriden. Defaults to the public Vagrant Cloud installation.
22 23 24 |
# File 'lib/vagrant-cloud/defaults.rb', line 22 def endpoint ENV['VAGRANT_CLOUD_ENDPOINT'] || 'https://vagrantcloud.com/api/v1' end |
.options ⇒ Hash
The list of calculated default options for the configuration.
12 13 14 |
# File 'lib/vagrant-cloud/defaults.rb', line 12 def Hash[Configurable.keys.map { |key| [key, send(key)] }] end |
.proxy_address ⇒ String?
The HTTP Proxy server address.
58 59 60 |
# File 'lib/vagrant-cloud/defaults.rb', line 58 def proxy_address ENV['VAGRANT_CLOUD_PROXY_ADDRESS'] end |
.proxy_password ⇒ String?
The HTTP Proxy server user’s password.
67 68 69 |
# File 'lib/vagrant-cloud/defaults.rb', line 67 def proxy_password ENV['VAGRANT_CLOUD_PROXY_PASSWORD'] end |
.proxy_port ⇒ String?
The HTTP Proxy server port.
76 77 78 |
# File 'lib/vagrant-cloud/defaults.rb', line 76 def proxy_port ENV['VAGRANT_CLOUD_PROXY_PORT'] end |
.proxy_username ⇒ String?
The HTTP Proxy server username.
85 86 87 |
# File 'lib/vagrant-cloud/defaults.rb', line 85 def proxy_username ENV['VAGRANT_CLOUD_PROXY_USERNAME'] end |
.ssl_pem_file ⇒ String?
The path to a pem file on disk for use with a custom SSL verification
94 95 96 |
# File 'lib/vagrant-cloud/defaults.rb', line 94 def ssl_pem_file ENV['VAGRANT_CLOUD_SSL_PEM_FILE'] end |
.ssl_verify ⇒ true, false
Verify SSL requests (default: true)
103 104 105 106 |
# File 'lib/vagrant-cloud/defaults.rb', line 103 def ssl_verify key = ENV.fetch('VAGRANT_CLOUD_SSL_VERIFY', 'yes').downcase[0] %w[1 t y].include?(key) end |
.user_agent ⇒ String
The User Agent header to send along.
31 32 33 |
# File 'lib/vagrant-cloud/defaults.rb', line 31 def user_agent ENV['VAGRANT_CLOUD_USER_AGENT'] || USER_AGENT end |
.username ⇒ String?
The Vagrant Cloud username or organization to authenticate with.
40 41 42 |
# File 'lib/vagrant-cloud/defaults.rb', line 40 def username ENV['VAGRANT_CLOUD_USERNAME'] end |