class Kuroko2::Workflow::Task::KurokoRunner

Public Instance Methods

before_execute() click to toggle source
# 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() click to toggle source
# File lib/autoload/kuroko2/workflow/task/kuroko_runner.rb, line 12
def chdir
  Rails.root.to_s
end
shell() click to toggle source
# 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