mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Skip addition to load path if an externally-provided lib is already in place. Just to keep the path shorter.
This commit is contained in:
@@ -4,7 +4,10 @@
|
||||
gem lib, "~> #{version}"
|
||||
# Use the vendored lib if the gem's missing or we aren't using RubyGems.
|
||||
rescue LoadError, NoMethodError
|
||||
# Push, not unshift, so the vendored lib is lowest priority.
|
||||
$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib")
|
||||
# Skip if there's already a vendored lib already provided.
|
||||
if $LOAD_PATH.grep(Regexp.new(lib)).empty?
|
||||
# Push, not unshift, so the vendored lib is lowest priority.
|
||||
$LOAD_PATH << File.expand_path("#{File.dirname(__FILE__)}/vendor/#{lib}-#{version}/lib")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user