From 26637b7ef7b75ea5705d0b51492490cc93d5515a Mon Sep 17 00:00:00 2001 From: David Kellum Date: Sun, 8 Apr 2012 16:00:14 -0700 Subject: [PATCH] Resurrect "Add simple cache to Bundler.load_gemspec" This reverts prior revert 6b45e28, restoring 3d4163a0. --- lib/bundler.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/bundler.rb b/lib/bundler.rb index 8a9873c26b8..31251a30ef3 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -270,6 +270,11 @@ def read_file(file) end def load_gemspec(file) + @gemspec_cache ||= {} + @gemspec_cache[File.expand_path(file)] ||= load_gemspec_uncached(file) + end + + def load_gemspec_uncached(file) path = Pathname.new(file) # Eval the gemspec from its parent directory Dir.chdir(path.dirname.to_s) do