Skip to content

Commit

Permalink
check if runner is defined before aliasing it
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed Oct 19, 2010
1 parent 0055c36 commit 4e0c357
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/whenever/job_types/rails3.rb
Expand Up @@ -3,6 +3,9 @@
# define a new job for Rails 3 as the default runner.

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'"
end

0 comments on commit 4e0c357

Please sign in to comment.