Class: VagrantPlugins::Sprinkle::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Sprinkle::Config
- Defined in:
- lib/vagrant-sprinkle/config.rb
Instance Attribute Summary collapse
-
#cloud ⇒ Object
Returns the value of attribute cloud.
-
#force ⇒ Object
Returns the value of attribute force.
-
#only ⇒ Object
Returns the value of attribute only.
-
#script ⇒ Object
Returns the value of attribute script.
-
#test ⇒ Object
Returns the value of attribute test.
-
#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.
11 12 13 14 15 16 17 18 |
# File 'lib/vagrant-sprinkle/config.rb', line 11 def initialize self.script = UNSET_VALUE self.only = UNSET_VALUE self.test = UNSET_VALUE self.verbose = UNSET_VALUE self.cloud = UNSET_VALUE self.force = UNSET_VALUE end |
Instance Attribute Details
#cloud ⇒ Object
Returns the value of attribute cloud.
8 9 10 |
# File 'lib/vagrant-sprinkle/config.rb', line 8 def cloud @cloud end |
#force ⇒ Object
Returns the value of attribute force.
9 10 11 |
# File 'lib/vagrant-sprinkle/config.rb', line 9 def force @force end |
#only ⇒ Object
Returns the value of attribute only.
5 6 7 |
# File 'lib/vagrant-sprinkle/config.rb', line 5 def only @only end |
#script ⇒ Object
Returns the value of attribute script.
4 5 6 |
# File 'lib/vagrant-sprinkle/config.rb', line 4 def script @script end |
#test ⇒ Object
Returns the value of attribute test.
6 7 8 |
# File 'lib/vagrant-sprinkle/config.rb', line 6 def test @test end |
#verbose ⇒ Object
Returns the value of attribute verbose.
7 8 9 |
# File 'lib/vagrant-sprinkle/config.rb', line 7 def verbose @verbose end |
Instance Method Details
#finalize! ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/vagrant-sprinkle/config.rb', line 20 def finalize! self.script = nil if script == UNSET_VALUE self.only = nil if only == UNSET_VALUE self.test = nil if test == UNSET_VALUE self.verbose = nil if verbose == UNSET_VALUE self.cloud = nil if cloud == UNSET_VALUE self.force = nil if force == UNSET_VALUE end |
#validate(machine) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/vagrant-sprinkle/config.rb', line 29 def validate(machine) errors = [] if script unless Pathname.new(script).(machine.env.root_path).file? errors << I18n.t( 'vagrant.provisioners.sprinkle.script_path_invalid', :path => ) end else errors << I18n.t('vagrant.provisioners.sprinkle.no_script') end { 'Sprinkle provisioner' => errors } end |