From 50fc55dbef69c501b85e0ab1aa7dba1e85217fd9 Mon Sep 17 00:00:00 2001 From: Damien Date: Wed, 26 May 2010 17:39:54 +0800 Subject: [PATCH] A couple of small changes so whenever plays nice with rails 3.. Don't load up the Rakefile and use the new syntax for getting rails root --- lib/whenever.rb | 12 ++++++------ lib/whenever/base.rb | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/whenever.rb b/lib/whenever.rb index 9230cb9..2be2dca 100644 --- a/lib/whenever.rb +++ b/lib/whenever.rb @@ -1,11 +1,11 @@ require 'chronic' -# Hoping to load Rails' Rakefile -begin - load 'Rakefile' -rescue LoadError - nil -end +# # Hoping to load Rails' Rakefile +# begin +# load 'Rakefile' +# rescue LoadError +# nil +# end # If Rails' rakefile was loaded than so was active_support, but # if this is being used in a non-rails enviroment we need to require it. diff --git a/lib/whenever/base.rb b/lib/whenever/base.rb index d1ca531..45d6944 100644 --- a/lib/whenever/base.rb +++ b/lib/whenever/base.rb @@ -5,10 +5,10 @@ module Whenever end def self.path - if defined?(RAILS_ROOT) - RAILS_ROOT - elsif defined?(::RAILS_ROOT) - ::RAILS_ROOT + if defined?(Rails) + Rails.root.to_s + elsif defined?(::Rails) + ::Rails.root.to_s end end