Class: Kuroko2::Workflow::Task::KurokoRunner
- Defined in:
- lib/kuroko2/workflow/task/kuroko_runner.rb
Constant Summary
Constants inherited from Execute
Execute::DEFAULT_EXPECTED_TIME, Execute::EXPECTED_TIME_NOTIFY_REMIND_TERM
Instance Method Summary collapse
Methods inherited from Execute
Methods inherited from Base
#execute, #initialize, #validate
Constructor Details
This class inherits a constructor from Kuroko2::Workflow::Task::Base
Instance Method Details
#before_execute ⇒ Object
5 6 7 8 9 10 |
# File 'lib/kuroko2/workflow/task/kuroko_runner.rb', line 5 def before_execute env = token.context['ENV'] || {} env.merge!('BUNDLE_GEMFILE' => Rails.root.join('Gemfile').to_s) token.context['ENV'] = env end |
#chdir ⇒ Object
12 13 14 |
# File 'lib/kuroko2/workflow/task/kuroko_runner.rb', line 12 def chdir Rails.root.to_s end |
#shell ⇒ Object
16 17 18 19 20 |
# File 'lib/kuroko2/workflow/task/kuroko_runner.rb', line 16 def shell rails = Rails.root.join('bin/rails').to_s kuroko_script = Kuroko2::Engine.root.join("bin/#{option}.rb") "bundle exec #{rails} runner -e #{Rails.env} #{kuroko_script}" end |