summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2011-03-30 14:45:51 -0700
committerAndre Arko <andre@arko.net>2011-03-30 14:45:51 -0700
commitd5bc4bec4b42f541e933736a446f9e79104beb03 (patch)
treefc8c4f1422ea7545db75e3eb04b8895e8ed0d994
parentf121caab71eb84fceb391525a1bd63ea86e2b083 (diff)
downloadbundler-d5bc4bec4b42f541e933736a446f9e79104beb03.tar.gz
Comments and minor cleanup
-rw-r--r--lib/bundler/index.rb3
-rw-r--r--lib/bundler/rubygems_ext.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index b2105cf682..4d7f77251d 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -115,11 +115,10 @@ module Bundler
def search_by_dependency(dependency)
@cache[dependency.hash] ||= begin
specs = @specs[dependency.name]
+ found = specs.select { |spec| dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform) }
wants_prerelease = dependency.requirement.prerelease?
only_prerelease = specs.all? {|spec| spec.version.prerelease? }
- found = specs.select { |spec| dependency.matches_spec?(spec) && Gem::Platform.match(spec.platform) }
-
unless wants_prerelease || only_prerelease
found.reject! { |spec| spec.version.prerelease? }
end
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 0fee4b9cdf..ef689d1c22 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -124,6 +124,7 @@ module Gem
out
end
+ # Backport of performance enhancement added to Rubygems 1.4
def matches_spec?(spec)
# name can be a Regexp, so use ===
return false unless name === spec.name
@@ -134,6 +135,7 @@ module Gem
end
class Requirement
+ # Backport of performance enhancement added to Rubygems 1.4
def none?
@none ||= (to_s == ">= 0")
end unless allocate.respond_to?(:none?)