From 326036de46b0a89d8f23eabfde8b772bd31a7ad6 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 21 Oct 2008 01:47:27 +0100 Subject: [PATCH] Fix script/generate warning --- railties/lib/rails_generator/lookup.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/railties/lib/rails_generator/lookup.rb b/railties/lib/rails_generator/lookup.rb index 0526d526ad..a3525364a2 100644 --- a/railties/lib/rails_generator/lookup.rb +++ b/railties/lib/rails_generator/lookup.rb @@ -208,7 +208,8 @@ module Rails class GemGeneratorSource < AbstractGemSource # Yield latest versions of generator gems. def each - Gem::cache.search(/_generator$/).inject({}) { |latest, gem| + dependency = Gem::Dependency.new(/_generator$/, Gem::Requirement.default) + Gem::cache.search(dependency).inject({}) { |latest, gem| hem = latest[gem.name] latest[gem.name] = gem if hem.nil? or gem.version > hem.version latest