Class: VagrantDockerCertificatesManager::Config
- Inherits:
-
Object
- Object
- VagrantDockerCertificatesManager::Config
- Defined in:
- lib/vagrant-docker-certificates-manager/config.rb
Instance Attribute Summary collapse
-
#cert_name ⇒ Object
Returns the value of attribute cert_name.
-
#cert_path ⇒ Object
Returns the value of attribute cert_path.
-
#container_name ⇒ Object
Returns the value of attribute container_name.
-
#install_on_up ⇒ Object
Returns the value of attribute install_on_up.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#manage_firefox ⇒ Object
Returns the value of attribute manage_firefox.
-
#manage_nss_browsers ⇒ Object
Returns the value of attribute manage_nss_browsers.
-
#remove_on_destroy ⇒ Object
Returns the value of attribute remove_on_destroy.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(_machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 9 def initialize @cert_path = "certs/rootca.cert.pem" @cert_name = "local.dev" @install_on_up = false @remove_on_destroy = false @manage_firefox = false @manage_nss_browsers = true @locale = "en" @verbose = false @container_name = nil end |
Instance Attribute Details
#cert_name ⇒ Object
Returns the value of attribute cert_name.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def cert_name @cert_name end |
#cert_path ⇒ Object
Returns the value of attribute cert_path.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def cert_path @cert_path end |
#container_name ⇒ Object
Returns the value of attribute container_name.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def container_name @container_name end |
#install_on_up ⇒ Object
Returns the value of attribute install_on_up.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def install_on_up @install_on_up end |
#locale ⇒ Object
Returns the value of attribute locale.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def locale @locale end |
#manage_firefox ⇒ Object
Returns the value of attribute manage_firefox.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def manage_firefox @manage_firefox end |
#manage_nss_browsers ⇒ Object
Returns the value of attribute manage_nss_browsers.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def manage_nss_browsers @manage_nss_browsers end |
#remove_on_destroy ⇒ Object
Returns the value of attribute remove_on_destroy.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def remove_on_destroy @remove_on_destroy end |
#verbose ⇒ Object
Returns the value of attribute verbose.
5 6 7 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 5 def verbose @verbose end |
Instance Method Details
#finalize! ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 21 def finalize! @cert_path = @container_name unless @container_name.to_s.strip.empty? @install_on_up = !!@install_on_up @remove_on_destroy = !!@remove_on_destroy @manage_firefox = !!@manage_firefox @manage_nss_browsers = !!@manage_nss_browsers @verbose = !!@verbose @locale = (@locale || "en").to_s end |
#validate(_machine) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/vagrant-docker-certificates-manager/config.rb', line 31 def validate(_machine) errors = [] errors << "cert_path must be provided" if @cert_path.to_s.strip.empty? errors << "cert_name must be provided" if @cert_name.to_s.strip.empty? { "vagrant-docker-certificates-manager" => errors } end |