Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Add simple cache to Bundler.load_gemspec #1635

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,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
Expand Down