Class: VagrantWorkspace::Action::Run
- Inherits:
-
Object
- Object
- VagrantWorkspace::Action::Run
- Defined in:
- lib/vagrant_workspace/action/run.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#workspace_file ⇒ Object
readonly
Returns the value of attribute workspace_file.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Run
constructor
A new instance of Run.
Constructor Details
#initialize(app, env) ⇒ Run
Returns a new instance of Run.
6 7 8 9 10 11 |
# File 'lib/vagrant_workspace/action/run.rb', line 6 def initialize(app, env) @app = app @env = env @machine = env[:machine] @workspace_file = env[:workspace_file] end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
4 5 6 |
# File 'lib/vagrant_workspace/action/run.rb', line 4 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/vagrant_workspace/action/run.rb', line 4 def env @env end |
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
4 5 6 |
# File 'lib/vagrant_workspace/action/run.rb', line 4 def machine @machine end |
#workspace_file ⇒ Object (readonly)
Returns the value of attribute workspace_file.
4 5 6 |
# File 'lib/vagrant_workspace/action/run.rb', line 4 def workspace_file @workspace_file end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/vagrant_workspace/action/run.rb', line 13 def call(env) workspace_hash.each do |project_name, project| next if project_name == '_all' puts "Executing commands on #{project_name}:" execute(project_name, before_commands) execute(project_name, project['run']) execute(project_name, after_commands) end app.call(env) end |