Class: VagrantPlugins::ApplicationCookbooks::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::ApplicationCookbooks::Config
- Defined in:
- lib/vagrant-application-cookbooks/config.rb
Instance Attribute Summary collapse
-
#ref ⇒ Object
git ref / branch to checkout.
-
#url ⇒ Object
git url to clone from.
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.
12 13 14 15 |
# File 'lib/vagrant-application-cookbooks/config.rb', line 12 def initialize @url = UNSET_VALUE @ref = UNSET_VALUE end |
Instance Attribute Details
#ref ⇒ Object
git ref / branch to checkout
10 11 12 |
# File 'lib/vagrant-application-cookbooks/config.rb', line 10 def ref @ref end |
#url ⇒ Object
git url to clone from
8 9 10 |
# File 'lib/vagrant-application-cookbooks/config.rb', line 8 def url @url end |
Instance Method Details
#finalize! ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/vagrant-application-cookbooks/config.rb', line 25 def finalize! @url = nil if @url == UNSET_VALUE if @url != nil @ref = 'master' if @ref == UNSET_VALUE else @ref = nil if @ref == UNSET_VALUE end end |
#validate(machine) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/vagrant-application-cookbooks/config.rb', line 17 def validate(machine) errors = _detected_errors if @ref != nil errors << "'app_cookbook.url' must be specified when 'app_cookbook.ref' is used" if @url.nil? end { "vagrant-application-cookbooks" => errors } end |