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'
|
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.
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user