Check for bundler environment or 2.x-style vendor/rails + rubygems

This commit is contained in:
Jeremy Kemper
2009-10-19 18:10:14 -07:00
parent a49c3b0365
commit 3072bf7555

View File

@@ -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