Class: Vagrant::Provisioners::Shell::Config
- Inherits:
-
Config::Base
- Object
- Config::Base
- Vagrant::Provisioners::Shell::Config
- Defined in:
- lib/vagrant/provisioners/shell.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#upload_path ⇒ Object
Returns the value of attribute upload_path.
Attributes inherited from Config::Base
Instance Method Summary collapse
- #expanded_path ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(errors) ⇒ Object
Methods inherited from Config::Base
configures, #env, #instance_variables_hash, json_create, #set_options, #to_hash, #to_json
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 |
# File 'lib/vagrant/provisioners/shell.rb', line 10 def initialize @upload_path = "/tmp/vagrant-shell" end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/vagrant/provisioners/shell.rb', line 7 def path @path end |
#upload_path ⇒ Object
Returns the value of attribute upload_path.
8 9 10 |
# File 'lib/vagrant/provisioners/shell.rb', line 8 def upload_path @upload_path end |
Instance Method Details
#expanded_path ⇒ Object
14 15 16 |
# File 'lib/vagrant/provisioners/shell.rb', line 14 def Pathname.new(path).(env.root_path) if path end |
#validate(errors) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vagrant/provisioners/shell.rb', line 18 def validate(errors) super if !path errors.add(I18n.t("vagrant.provisioners.shell.path_not_set")) elsif !.file? errors.add(I18n.t("vagrant.provisioners.shell.path_invalid", :path => )) end if !upload_path errors.add(I18n.t("vagrant.provisioners.shell.upload_path_not_set")) end end |