use Dir.pwd as default path instead of loading Rails and getting the Rails.root
This commit is contained in:
parent
8565a6547c
commit
c2e0320d2a
@ -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
|
||||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user