mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Check for bundler environment or 2.x-style vendor/rails + rubygems
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
# Package management
|
||||
# Choose one
|
||||
|
||||
# Use Bundler (preferred)
|
||||
environment = File.expand_path('../../vendor/gems/environment', __FILE__)
|
||||
vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
|
||||
|
||||
if File.exist?(environment)
|
||||
# Use Bundler (preferred)
|
||||
require environment
|
||||
elsif File.exist?(vendor_rails)
|
||||
# Use 2.x style vendor/rails directory
|
||||
Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
|
||||
|
||||
# Use 2.x style vendor/rails and RubyGems
|
||||
else
|
||||
# Load Rails from traditional RubyGems
|
||||
vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
|
||||
if File.exist?(vendor_rails)
|
||||
Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
|
||||
end
|
||||
|
||||
require 'rubygems'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user