summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-04-03 18:00:58 +0000
committerThe Bundler Bot <bot@bundler.io>2017-04-03 18:00:58 +0000
commit7c1dc7ef164f845b3c07fc8fe731ea041c476ef1 (patch)
treec427d9e8f3ad1f78186de97c019ee718df397fef
parent6e14ebe9f75506bddf623fb83d275deaaca8d8b8 (diff)
parent574eaf4505bad2a9ba6fc09417567d1a30131d65 (diff)
downloadbundler-7c1dc7ef164f845b3c07fc8fe731ea041c476ef1.tar.gz
Auto merge of #5554 - bundler:seg-validate-git-specs, r=indirect
[Source::Git] Only validate specs once (on download) Instead of validating every time we setup, only do so when we re-serialize the spec \c @jules2689
-rw-r--r--lib/bundler/source/git.rb4
-rw-r--r--lib/bundler/source/path.rb6
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 30ff27c446..c95c94583f 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -234,6 +234,7 @@ module Bundler
# The gemspecs we cache should already be evaluated.
spec = Bundler.load_gemspec(spec_path)
next unless spec
+ Bundler.rubygems.validate(spec)
File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) }
end
end
@@ -298,6 +299,9 @@ module Bundler
raise unless Bundler.feature_flag.allow_offline_install?
Bundler.ui.warn "Using cached git data because of network errors"
end
+
+ # no-op, since we validate when re-serializing the gemspec
+ def validate_spec(_spec); end
end
end
end
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 2900b3f939..4b01496aac 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -144,6 +144,10 @@ module Bundler
SharedHelpers.in_bundle? && app_cache_path.exist?
end
+ def validate_spec(spec)
+ Bundler.rubygems.validate(spec)
+ end
+
def load_spec_files
index = Index.new
@@ -155,7 +159,7 @@ module Bundler
Bundler.rubygems.set_installed_by_version(spec)
# Validation causes extension_dir to be calculated, which depends
# on #source, so we validate here instead of load_gemspec
- Bundler.rubygems.validate(spec)
+ validate_spec(spec)
index << spec
end