Browse files

only look at latest specs to suggest name

This reduced HTTP requests. Reviewed by @zenspider
  • Loading branch information...
1 parent 1b92cc6 commit 66783d84cc961fad3d368fc182c41dd4c8d6a37e @tenderlove tenderlove committed Feb 5, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rubygems/spec_fetcher.rb
View
2 lib/rubygems/spec_fetcher.rb
@@ -186,7 +186,7 @@ def spec_for_dependency(dependency, matching_platform=true)
def suggest_gems_from_name gem_name
gem_name = gem_name.downcase.tr('_-', '')
max = gem_name.size / 2
- names = available_specs(:complete).first.values.flatten(1)
+ names = available_specs(:latest).first.values.flatten(1)
matches = names.map { |n|
next unless n.match_platform?

0 comments on commit 66783d8

Please sign in to comment.