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

This commit is contained in:
Damien 2010-05-26 17:39:54 +08:00 committed by Javan Makhmali
parent c2e4c6e68d
commit 50fc55dbef
2 changed files with 10 additions and 10 deletions

View File

@ -1,11 +1,11 @@
require 'chronic' require 'chronic'
# Hoping to load Rails' Rakefile # # Hoping to load Rails' Rakefile
begin # begin
load 'Rakefile' # load 'Rakefile'
rescue LoadError # rescue LoadError
nil # nil
end # end
# If Rails' rakefile was loaded than so was active_support, but # 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. # if this is being used in a non-rails enviroment we need to require it.

View File

@ -5,10 +5,10 @@ module Whenever
end end
def self.path def self.path
if defined?(RAILS_ROOT) if defined?(Rails)
RAILS_ROOT Rails.root.to_s
elsif defined?(::RAILS_ROOT) elsif defined?(::Rails)
::RAILS_ROOT ::Rails.root.to_s
end end
end end