aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/source_index.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-01 09:41:32 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-01 09:41:32 +0000
commit25a9b62d45ddd60a231272567c7dda9337da9b62 (patch)
treee72ba4c9c01cba5fb510eb1eafaba76d998baf4c /lib/rubygems/source_index.rb
parent86bb0af7ea3b50f72e6845a6f5f64cb1b23fd279 (diff)
downloadruby-25a9b62d45ddd60a231272567c7dda9337da9b62.tar.gz
Import rubygems 1.6.0 (released version @ 58d8a0b9)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/source_index.rb')
-rw-r--r--lib/rubygems/source_index.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb
index 7c571fff55..a6733fac31 100644
--- a/lib/rubygems/source_index.rb
+++ b/lib/rubygems/source_index.rb
@@ -131,7 +131,7 @@ class Gem::SourceIndex
# Returns an Array specifications for the latest released versions
# of each gem in this index.
- def latest_specs
+ def latest_specs(include_prerelease=false)
result = Hash.new { |h,k| h[k] = [] }
latest = {}
@@ -140,7 +140,7 @@ class Gem::SourceIndex
curr_ver = spec.version
prev_ver = latest.key?(name) ? latest[name].version : nil
- next if curr_ver.prerelease?
+ next if !include_prerelease && curr_ver.prerelease?
next unless prev_ver.nil? or curr_ver >= prev_ver or
latest[name].platform != Gem::Platform::RUBY
@@ -273,6 +273,7 @@ class Gem::SourceIndex
when Gem::Dependency then
only_platform = platform_only
requirement = gem_pattern.requirement
+
gem_pattern = if Regexp === gem_pattern.name then
gem_pattern.name
elsif gem_pattern.name.empty? then