lib/bundler/source/git.rb in bundler-1.14.6 vs lib/bundler/source/git.rb in bundler-1.15.0.pre.1

- old
+ new

@@ -169,11 +169,14 @@ if requires_checkout? && !@copied && !force Bundler.ui.debug " * Checking out revision: #{ref}" git_proxy.copy_to(install_path, submodules) serialize_gemspecs_in(install_path) @copied = true + elsif force + git_proxy.copy_to(install_path, submodules) end + generate_bin_options = { :disable_extensions => !Bundler.rubygems.spec_missing_extensions?(spec), :build_args => options[:build_args] } generate_bin(spec, generate_bin_options) requires_checkout? ? spec.post_install_message : nil end @@ -232,10 +235,12 @@ # Evaluate gemspecs and cache the result. Gemspecs # in git might require git or other dependencies. # The gemspecs we cache should already be evaluated. spec = Bundler.load_gemspec(spec_path) next unless spec + Bundler.rubygems.set_installed_by_version(spec) + Bundler.rubygems.validate(spec) File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) } end end def set_local!(path) @@ -295,9 +300,20 @@ def fetch git_proxy.checkout rescue GitError 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 + + if Bundler.rubygems.stubs_provide_full_functionality? + def load_gemspec(file) + stub = Gem::StubSpecification.gemspec_stub(file, install_path.parent, install_path.parent) + stub.full_gem_path = Pathname.new(file).dirname.expand_path(root).to_s.untaint + StubSpecification.from_stub(stub) + end end end end end