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:
parent
c2e4c6e68d
commit
50fc55dbef
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user