use Dir.pwd as default path instead of loading Rails and getting the Rails.root

This commit is contained in:
Javan Makhmali 2010-06-24 13:51:17 -04:00
parent 8565a6547c
commit c2e0320d2a
2 changed files with 1 additions and 14 deletions

View File

@ -1,14 +1,5 @@
require 'chronic' require 'chronic'
# 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.
# It was previously defined as a dependency of this gem, but that became # It was previously defined as a dependency of this gem, but that became
# problematic. See: http://github.com/javan/whenever/issues#issue/1 # problematic. See: http://github.com/javan/whenever/issues#issue/1
begin begin

View File

@ -5,11 +5,7 @@ module Whenever
end end
def self.path def self.path
if defined?(Rails) Dir.pwd
Rails.root.to_s
elsif defined?(::Rails)
::Rails.root.to_s
end
end end
end end