Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: bundler/bundler
...
head fork: bundler/bundler
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Showing with 10 additions and 0 deletions.
  1. +1 −0  CHANGELOG.md
  2. +9 −0 lib/bundler.rb
View
1  CHANGELOG.md
@@ -7,6 +7,7 @@ Features:
- It is possible to override a git repository via configuration.
For instance, if you have a git dependency on rack, you can force
it to use a local repo with `bundle config local.rack ~/path/to/rack`
+ - Cache gemspec loads for performance (@dekellum, #1635)
## 1.1.3 (March 23, 2012)
View
9 lib/bundler.rb
@@ -270,6 +270,15 @@ def read_file(file)
end
def load_gemspec(file)
+ @gemspec_cache ||= {}
+ key = File.expand_path(file)
+ spec = ( @gemspec_cache[key] ||= load_gemspec_uncached(file) )
+ # Protect against caching side-effected gemspecs by returning a
+ # new instance each time.
+ spec.dup if spec
+ end
+
+ def load_gemspec_uncached(file)
path = Pathname.new(file)
# Eval the gemspec from its parent directory
Dir.chdir(path.dirname.to_s) do

No commit comments for this range

Something went wrong with that request. Please try again.