Class: Engineyard::Local::Middleware::Rails::Command
- Inherits:
-
Object
- Object
- Engineyard::Local::Middleware::Rails::Command
- Includes:
- Helpers::Executable, Helpers::Rvm
- Defined in:
- lib/engineyard-local/middleware/rails/command.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
- #command_args ⇒ Object
- #commands ⇒ Object
-
#initialize(app, env) ⇒ Command
constructor
A new instance of Command.
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) ⇒ Command
Returns a new instance of Command.
9 10 11 |
# File 'lib/engineyard-local/middleware/rails/command.rb', line 9 def initialize(app, env) @app, @env = app, env end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 |
# File 'lib/engineyard-local/middleware/rails/command.rb', line 13 def call(env) ssh_exec!(env, commands) @app.call(env) end |
#command_args ⇒ Object
24 25 26 |
# File 'lib/engineyard-local/middleware/rails/command.rb', line 24 def command_args @env["eylocal.rails.command_args"].join(" ") end |
#commands ⇒ Object
18 19 20 21 22 |
# File 'lib/engineyard-local/middleware/rails/command.rb', line 18 def commands #rvm_env + [ "cd #{project_dir}", "rails #{command_args}" ] end |