Class: Engineyard::Local::Middleware::Exec
- Inherits:
-
Object
- Object
- Engineyard::Local::Middleware::Exec
- Includes:
- Helpers::Executable, Helpers::Rvm
- Defined in:
- lib/engineyard-local/middleware/exec.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
- #command_args ⇒ Object
- #commands ⇒ Object
-
#initialize(app, env) ⇒ Exec
constructor
A new instance of Exec.
Methods included from Helpers::Executable
#project_dir, #ssh_exec, #ssh_exec!
Methods included from Helpers::Rvm
#bash_rvm_setup, #export_ruby, #ruby_env_const, #rvm_env, #use_ruby_with_gemset
Constructor Details
#initialize(app, env) ⇒ Exec
Returns a new instance of Exec.
8 9 10 |
# File 'lib/engineyard-local/middleware/exec.rb', line 8 def initialize(app, env) @app, @env = app, env end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 |
# File 'lib/engineyard-local/middleware/exec.rb', line 12 def call(env) ssh_exec!(env, commands, :prefix => false) @app.call(env) end |
#command_args ⇒ Object
22 23 24 |
# File 'lib/engineyard-local/middleware/exec.rb', line 22 def command_args @env["eylocal.exec.command_args"].join(" ") end |
#commands ⇒ Object
17 18 19 20 |
# File 'lib/engineyard-local/middleware/exec.rb', line 17 def commands rvm_env + [ "cd #{project_dir}", command_args ] end |