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