Skip to content

Commit aaaceb7

Browse files
committed
try to fall back to RAILS_ROOT if Rails.root is not available, before using .
1 parent 50a85d0 commit aaaceb7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/jammit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Jammit
88

99
ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
1010

11-
ASSET_ROOT = File.expand_path((defined?(Rails) && Rails.root.to_s.length > 0) ? Rails.root : ".") unless defined?(ASSET_ROOT)
11+
ASSET_ROOT = File.expand_path((defined?(Rails) && Rails.root.to_s.length > 0) ? Rails.root : ENV['RAILS_ROOT'] || ".") unless defined?(ASSET_ROOT)
1212

1313
PUBLIC_ROOT = (defined?(Rails) && Rails.public_path.to_s.length > 0) ? Rails.public_path : File.join(ASSET_ROOT, 'public') unless defined?(PUBLIC_ROOT)
1414

0 commit comments

Comments
 (0)