lib/bundler/source/git.rb in bundler-1.13.0.rc.1 vs lib/bundler/source/git.rb in bundler-1.13.0.rc.2
- old
+ new
@@ -150,11 +150,11 @@
# TODO: cache git specs
def specs(*)
set_local!(app_cache_path) if has_app_cache? && !local?
if requires_checkout? && !@copied
- git_proxy.checkout
+ fetch
git_proxy.copy_to(install_path, submodules)
serialize_gemspecs_in(install_path)
@copied = true
end
@@ -168,11 +168,11 @@
Bundler.ui.debug " * Checking out revision: #{ref}"
git_proxy.copy_to(install_path, submodules)
serialize_gemspecs_in(install_path)
@copied = true
end
- generate_bin(spec)
+ generate_bin(spec, !Bundler.rubygems.spec_missing_extensions?(spec))
requires_checkout? ? spec.post_install_message : nil
end
def cache(spec, custom_path = nil)
@@ -221,14 +221,10 @@
@allow_remote || @allow_cached
end
private
- def build_extensions(installer)
- super if Bundler.rubygems.spec_missing_extensions?(installer.spec)
- end
-
def serialize_gemspecs_in(destination)
destination = destination.expand_path(Bundler.root) if destination.relative?
Dir["#{destination}/#{@glob}"].each do |spec_path|
# Evaluate gemspecs and cache the result. Gemspecs
# in git might require git or other dependencies.
@@ -289,9 +285,16 @@
cache_path.exist?
end
def git_proxy
@git_proxy ||= GitProxy.new(cache_path, uri, ref, cached_revision, self)
+ end
+
+ def fetch
+ git_proxy.checkout
+ rescue GitError
+ raise unless Bundler.settings[:allow_offline_install]
+ Bundler.ui.warn "Using cached git data because of network errors"
end
end
end
end