Class: VagrantPlugins::Rubber::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Rubber::Config
- Defined in:
- lib/rubber/vagrant/config.rb
Instance Attribute Summary collapse
-
#roles ⇒ Object
Returns the value of attribute roles.
-
#rubber_env ⇒ Object
Returns the value of attribute rubber_env.
-
#rvm_ruby_version ⇒ Object
Returns the value of attribute rvm_ruby_version.
-
#use_vagrant_ruby ⇒ Object
Returns the value of attribute use_vagrant_ruby.
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.
6 7 8 9 10 11 |
# File 'lib/rubber/vagrant/config.rb', line 6 def initialize @roles = UNSET_VALUE @rubber_env = UNSET_VALUE @use_vagrant_ruby = UNSET_VALUE @rvm_ruby_version = UNSET_VALUE end |
Instance Attribute Details
#roles ⇒ Object
Returns the value of attribute roles.
4 5 6 |
# File 'lib/rubber/vagrant/config.rb', line 4 def roles @roles end |
#rubber_env ⇒ Object
Returns the value of attribute rubber_env.
4 5 6 |
# File 'lib/rubber/vagrant/config.rb', line 4 def rubber_env @rubber_env end |
#rvm_ruby_version ⇒ Object
Returns the value of attribute rvm_ruby_version.
4 5 6 |
# File 'lib/rubber/vagrant/config.rb', line 4 def rvm_ruby_version @rvm_ruby_version end |
#use_vagrant_ruby ⇒ Object
Returns the value of attribute use_vagrant_ruby.
4 5 6 |
# File 'lib/rubber/vagrant/config.rb', line 4 def use_vagrant_ruby @use_vagrant_ruby end |
Instance Method Details
#finalize! ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/rubber/vagrant/config.rb', line 13 def finalize! @rubber_env = 'vagrant' if @rubber_env == UNSET_VALUE @use_vagrant_ruby = false if @use_vagrant_ruby == UNSET_VALUE @rvm_ruby_version = nil if @rvm_ruby_version == UNSET_VALUE ::Rubber::initialize(Dir.pwd, @rubber_env) @roles = ::Rubber.config['staging_roles'] if @roles == UNSET_VALUE end |
#validate(machine) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rubber/vagrant/config.rb', line 23 def validate(machine) if @rubber_env.nil? return { 'rubber' => ['rubber_env must be set to the Rubber environment to use for this cluster'] } end unless [true, false].include?(@use_vagrant_ruby) return { 'rubber' => ['use_vagrant_ruby must be set to a Boolean value'] } end if @roles.nil? return { 'rubber' => ['roles must be set to a list of roles to use for this machine'] } end {} end |