check if runner is defined before aliasing it
This commit is contained in:
parent
0055c36aef
commit
4e0c357f4d
@ -3,6 +3,9 @@
|
|||||||
# define a new job for Rails 3 as the default runner.
|
# define a new job for Rails 3 as the default runner.
|
||||||
|
|
||||||
if File.exists?(File.join(Whenever.path, 'script', 'rails'))
|
if File.exists?(File.join(Whenever.path, 'script', 'rails'))
|
||||||
class_eval { alias_method :rails2_runner, :runner }
|
class_eval do
|
||||||
|
alias_method(:rails2_runner, :runner) if defined?(:runner)
|
||||||
|
end
|
||||||
|
|
||||||
job_type :runner, "cd :path && script/rails runner -e :environment ':task'"
|
job_type :runner, "cd :path && script/rails runner -e :environment ':task'"
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user