[rubygems/rubygems] Remove code that makes suggest_gems_from_name give worse results.
https://github.com/rubygems/rubygems/commit/09ec67ffdf
This commit is contained in:
parent
b9e225fcbf
commit
47a3482a41
@ -176,19 +176,12 @@ class Gem::SpecFetcher
|
|||||||
|
|
||||||
matches = names.map do |n|
|
matches = names.map do |n|
|
||||||
next unless n.match_platform?
|
next unless n.match_platform?
|
||||||
[n.name, 0] if n.name.downcase.tr("_-", "").include?(gem_name)
|
distance = levenshtein_distance gem_name, n.name.downcase.tr("_-", "")
|
||||||
|
next if distance >= max
|
||||||
|
return [n.name] if distance == 0
|
||||||
|
[n.name, distance]
|
||||||
end.compact
|
end.compact
|
||||||
|
|
||||||
if matches.length < num_results
|
|
||||||
matches += names.map do |n|
|
|
||||||
next unless n.match_platform?
|
|
||||||
distance = levenshtein_distance gem_name, n.name.downcase.tr("_-", "")
|
|
||||||
next if distance >= max
|
|
||||||
return [n.name] if distance == 0
|
|
||||||
[n.name, distance]
|
|
||||||
end.compact
|
|
||||||
end
|
|
||||||
|
|
||||||
matches = if matches.empty? && type != :prerelease
|
matches = if matches.empty? && type != :prerelease
|
||||||
suggest_gems_from_name gem_name, :prerelease
|
suggest_gems_from_name gem_name, :prerelease
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user