Class: Kuroko2::Workflow::Task::KurokoRunner
- Inherits:
-
Execute
- Object
- Base
- Execute
- Kuroko2::Workflow::Task::KurokoRunner
show all
- Defined in:
- lib/autoload/kuroko2/workflow/task/kuroko_runner.rb
Instance Method Summary
collapse
Methods inherited from Execute
#execute, #validate
Methods inherited from Base
#execute, #initialize, #validate
Instance Method Details
#before_execute ⇒ Object
5
6
7
8
9
10
|
# File 'lib/autoload/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/autoload/kuroko2/workflow/task/kuroko_runner.rb', line 12
def chdir
Rails.root.to_s
end
|
#shell ⇒ Object
16
17
18
19
20
|
# File 'lib/autoload/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
|