Skip to content

Instantly share code, notes, and snippets.

@bkabrda
Created June 5, 2012 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bkabrda/2875212 to your computer and use it in GitHub Desktop.
Save bkabrda/2875212 to your computer and use it in GitHub Desktop.
Bundler - prefer local gems
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 236eedd..eb35d3d 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -291,6 +291,10 @@ module Bundler
end
end
+ local = matching_versions.reject { |mv| mv[0].class == Bundler::RemoteSpecification }
+ others = matching_versions - local
+ matching_versions = others + local
+
matching_versions.reverse_each do |spec_group|
conflict = resolve_requirement(spec_group, current, reqs.dup, activated.dup)
conflicts << conflict if conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment