summaryrefslogtreecommitdiff
path: root/lib/bundler/source/path.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/source/path.rb')
-rw-r--r--lib/bundler/source/path.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 1a32b132bd..2b53bc7831 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -130,7 +130,8 @@ module Bundler
index = Index.new
if File.directory?(expanded_path)
- Dir["#{expanded_path}/#{@glob}"].sort_by { |p| p.split(File::SEPARATOR).size }.each do |file|
+ # We sort depth-first since `<<` will override the earlier-found specs
+ Dir["#{expanded_path}/#{@glob}"].sort_by { |p| -p.split(File::SEPARATOR).size }.each do |file|
spec = Bundler.load_gemspec(file)
if spec
spec.loaded_from = file.to_s