Class: VagrantPlugins::Vmpooler::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Vmpooler::Config
- Defined in:
- lib/vagrant-vmpooler/config.rb
Instance Attribute Summary collapse
-
#disk ⇒ Integer
Increases default disk space by this size.
-
#os ⇒ String
The type of operatingsystem to get from the pooler.
-
#password ⇒ String
The password to use to log into the vmpooler machine.
-
#token ⇒ String
The token used to obtain vms.
-
#ttl ⇒ Integer
How long the vm should stay active for.
-
#url ⇒ String
The url to your vmpooler installation.
-
#verbose ⇒ Boolean
Whether or not to run vmfloaty commands in verbose mode.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize(verbose = false) ⇒ Config
constructor
—————- Provider methods —————-.
-
#read_config ⇒ Object
—————- Internal methods —————-.
Constructor Details
#initialize(verbose = false) ⇒ Config
Provider methods
89 90 91 92 93 94 95 96 97 |
# File 'lib/vagrant-vmpooler/config.rb', line 89 def initialize(verbose=false) @token = UNSET_VALUE @url = UNSET_VALUE @verbose = UNSET_VALUE @os = UNSET_VALUE @ttl = UNSET_VALUE @disk = UNSET_VALUE @password = UNSET_VALUE end |
Instance Attribute Details
#disk ⇒ Integer
Increases default disk space by this size
45 46 47 |
# File 'lib/vagrant-vmpooler/config.rb', line 45 def disk @disk end |
#os ⇒ String
The type of operatingsystem to get from the pooler
27 28 29 |
# File 'lib/vagrant-vmpooler/config.rb', line 27 def os @os end |
#password ⇒ String
The password to use to log into the vmpooler machine
33 34 35 |
# File 'lib/vagrant-vmpooler/config.rb', line 33 def password @password end |
#token ⇒ String
The token used to obtain vms
10 11 12 |
# File 'lib/vagrant-vmpooler/config.rb', line 10 def token @token end |
#ttl ⇒ Integer
How long the vm should stay active for
39 40 41 |
# File 'lib/vagrant-vmpooler/config.rb', line 39 def ttl @ttl end |
#url ⇒ String
The url to your vmpooler installation
15 16 17 |
# File 'lib/vagrant-vmpooler/config.rb', line 15 def url @url end |
#verbose ⇒ Boolean
Whether or not to run vmfloaty commands in verbose mode
21 22 23 |
# File 'lib/vagrant-vmpooler/config.rb', line 21 def verbose @verbose end |
Instance Method Details
#finalize! ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/vagrant-vmpooler/config.rb', line 63 def finalize! conf_file = read_config if conf_file['token'] @token = conf_file['token'] else @token = nil end if conf_file['url'] @url = conf_file['url'] else @url = nil end @verbose = false if @verbose == UNSET_VALUE @os = nil if @os == UNSET_VALUE @ttl = nil if @ttl == UNSET_VALUE @disk = nil if @disk == UNSET_VALUE @password = nil if @password == UNSET_VALUE end |
#read_config ⇒ Object
Internal methods
53 54 55 56 57 58 59 60 61 |
# File 'lib/vagrant-vmpooler/config.rb', line 53 def read_config conf_file = {} begin conf_file = YAML.load_file("#{Dir.home}/.vmfloaty.yml") rescue # vagrant debug? end conf_file end |