[DRE-commits] [bundler] 01/04: Imported Upstream version 1.5.2+dfsg

Christian Hofstaedtler zeha at moszumanska.debian.org
Thu Jan 16 15:30:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

zeha pushed a commit to branch master
in repository bundler.

commit 515ccefbc841a949982c6a5dd34a0ae1d34bc9ca
Author: Christian Hofstaedtler <zeha at debian.org>
Date:   Thu Jan 16 16:02:18 2014 +0100

    Imported Upstream version 1.5.2+dfsg
---
 CHANGELOG.md                                    |  28 +++-
 bin/bundle                                      |   4 +-
 bundler.gemspec                                 |   2 +-
 lib/bundler/cli.rb                              |   6 +-
 lib/bundler/fetcher.rb                          |  25 +--
 lib/bundler/installer.rb                        |  45 ++----
 lib/bundler/man/bundle                          |   2 +-
 lib/bundler/man/bundle-config                   |   2 +-
 lib/bundler/man/bundle-config.txt               |   2 +-
 lib/bundler/man/bundle-exec                     |   2 +-
 lib/bundler/man/bundle-exec.txt                 |   2 +-
 lib/bundler/man/bundle-install                  |   4 +-
 lib/bundler/man/bundle-install.txt              | 203 ++++++++++++------------
 lib/bundler/man/bundle.txt                      |   2 +-
 lib/bundler/man/gemfile.5                       |   4 +-
 lib/bundler/man/gemfile.5.txt                   |   6 +-
 lib/bundler/parallel_workers/unix_worker.rb     |  16 +-
 lib/bundler/parallel_workers/worker.rb          |   1 +
 lib/bundler/rubygems_ext.rb                     |   2 +-
 lib/bundler/rubygems_integration.rb             |  23 ++-
 lib/bundler/templates/newgem/newgem.gemspec.tt  |   2 +-
 lib/bundler/version.rb                          |   2 +-
 man/bundle-install.ronn                         |   2 +-
 man/gemfile.5.ronn                              |   3 +-
 metadata.yml                                    |  17 +-
 spec/commands/binstubs_spec.rb                  |  13 ++
 spec/install/gemfile/git_spec.rb                |   4 +-
 spec/install/gems/dependency_api_spec.rb        |  34 ++++
 spec/install/gems/packed_spec.rb                |   6 +-
 spec/quality_spec.rb                            |   4 +-
 spec/realworld/parallel_install_spec.rb         |  23 ---
 spec/realworld/parallel_spec.rb                 |  69 ++++++++
 spec/realworld/parallel_update_spec.rb          |  31 ----
 spec/runtime/setup_spec.rb                      |   5 +-
 spec/spec_helper.rb                             |   1 +
 spec/support/artifice/endpoint_host_redirect.rb |  15 ++
 spec/support/permissions.rb                     |  11 ++
 37 files changed, 361 insertions(+), 262 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 49ba83a..318d794 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+## 1.5.2 (2014-01-10)
+
+Bugfixes:
+
+  - fix integration with Rubygems 1.8.0-1.8.19
+  - handle ENETDOWN exception during network requests
+  - gracefully shut down after interrupt during parallel install (@Who828)
+  - allow Rails to run Thor without debug mode (@rafaelfranca)
+  - set git binstub permissions by umask (@v-yarotsky)
+  - remove parallel install debug log
+
 ## 1.5.1 (2013-12-28)
 
 Bugfixes:
@@ -96,12 +107,25 @@ Bugfixes:
   - allow the same options hash to be passed to multiple gems (#2447)
   - handle missing binaries without an exception (#2019, @luismreis)
 
-## 1.3.6
+## 1.3.6 (8 January 2014)
 
 Bugfixes:
 
-  - set --no-cache when bundle install --local is called (@TimMoore)
   - make gemspec path option preserve relative paths in lock file (@bwillis)
+  - use umask when creating binstubs (#1618, @v-yarotsky)
+  - warn if graphviz is not installed (#2435, @Agis-)
+  - show git errors while loading gemspecs
+  - don't mutate gem method options hash (#2447)
+  - print Thor errors (#2478, @pjvds)
+  - print Rubygems system exit errors (James Cook)
+  - more Pathnames into Strings for MacRuby (@kml)
+  - preserve original gemspec path (@bwillis)
+  - remove warning about deps with :git (#1651, @ixti)
+  - split git files on null (#2634, @jasonmp85)
+  - handle cross-host redirects without SSL (#2686, @grddev)
+  - handle Rubygems 2 security exception (@zzak)
+  - reinstall gems if they are missing with spec present
+  - set binstub permissions using umask (#1618, @v-yarotsky)
 
 ## 1.3.5 (3 April 2013)
 
diff --git a/bin/bundle b/bin/bundle
index 3456c5e..7bfdd3a 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -15,8 +15,6 @@ $LOAD_PATH.each do |path|
 end
 
 require 'bundler/cli'
-# Force Thor to raise exceptions so we can exit non-zero.
-ENV["THOR_DEBUG"] = "1"
 
 require 'bundler/friendly_errors'
-Bundler.with_friendly_errors { Bundler::CLI.start }
+Bundler.with_friendly_errors { Bundler::CLI.start(ARGV, :debug => true) }
diff --git a/bundler.gemspec b/bundler.gemspec
index 6344e2d..c05d32a 100644
--- a/bundler.gemspec
+++ b/bundler.gemspec
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
   spec.add_development_dependency 'ronn', '~> 0.7.3'
   spec.add_development_dependency 'rspec', '~> 2.11'
 
-  spec.files       = `git ls-files`.split($/)
+  spec.files       = `git ls-files -z`.split("\x0")
   spec.files      += Dir.glob('lib/bundler/man/**/*') # man/ is ignored by git
   spec.test_files  = spec.files.grep(%r{^spec/})
 
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 20c6826..1e2b985 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -21,7 +21,7 @@ module Bundler
     rescue UnknownArgumentError => e
       raise InvalidOption, e.message
     ensure
-      options ||= {}
+      self.options ||= {}
       Bundler.ui = UI::Shell.new(options)
       Bundler.ui.level = "debug" if options["verbose"]
     end
@@ -232,8 +232,6 @@ module Bundler
         opts[:system] = true
       end
 
-      opts["no-cache"] ||= opts[:local]
-
       Bundler.settings[:path]     = nil if opts[:system]
       Bundler.settings[:path]     = "vendor/bundle" if opts[:deployment]
       Bundler.settings[:path]     = opts["path"] if opts["path"]
@@ -255,7 +253,7 @@ module Bundler
       definition = Bundler.definition
       definition.validate_ruby!
       Installer.install(Bundler.root, definition, opts)
-      Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !opts["no-cache"]
+      Bundler.load.cache if Bundler.root.join("vendor/cache").exist? && !options["no-cache"]
 
       if Bundler.settings[:path]
         absolute_path = File.expand_path(Bundler.settings[:path])
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 548002f..940eb4f 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -226,7 +226,7 @@ module Bundler
   private
 
     HTTP_ERRORS = [
-      Timeout::Error, EOFError, SocketError,
+      Timeout::Error, EOFError, SocketError, Errno::ENETDOWN,
       Errno::EINVAL, Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EAGAIN,
       Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
       Net::HTTP::Persistent::Error
@@ -235,17 +235,7 @@ module Bundler
     def fetch(uri, counter = 0)
       raise HTTPError, "Too many redirects" if counter >= @redirect_limit
 
-      begin
-        Bundler.ui.debug "Fetching from: #{uri}"
-        req = Net::HTTP::Get.new uri.request_uri
-        req.basic_auth(uri.user, uri.password) if uri.user
-        response = connection.request(uri, req)
-      rescue OpenSSL::SSL::SSLError
-        raise CertificateFailureError.new(uri)
-      rescue *HTTP_ERRORS
-        raise HTTPError, "Network error while fetching #{uri}"
-      end
-
+      response = request(uri)
       case response
       when Net::HTTPRedirection
         Bundler.ui.debug("HTTP Redirection")
@@ -265,6 +255,17 @@ module Bundler
       end
     end
 
+    def request(uri)
+      Bundler.ui.debug "Fetching from: #{uri}"
+      req = Net::HTTP::Get.new uri.request_uri
+      req.basic_auth(uri.user, uri.password) if uri.user
+      response = connection.request(uri, req)
+    rescue OpenSSL::SSL::SSLError
+      raise CertificateFailureError.new(uri)
+    rescue *HTTP_ERRORS
+      raise HTTPError, "Network error while fetching #{uri}"
+    end
+
     def dependency_api_uri(gem_names = [])
       url = "#{@remote_uri}api/v1/dependencies"
       url << "?gems=#{URI.encode(gem_names.join(","))}" if gem_names.any?
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 5e8fbba..ede4a05 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -113,7 +113,6 @@ module Bundler
         Bundler.ui.debug debug_message if debug_message
         spec_info = "#{worker}:  #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
         Bundler.ui.debug spec_info
-        logger.info spec_info
       end
 
       if Bundler.settings[:bin] && standalone
@@ -139,7 +138,6 @@ module Bundler
         msg << " #{spec.name} -v '#{spec.version}'` succeeds before bundling."
       end
       Bundler.ui.debug e.backtrace.join("\n")
-      logger.error("#{e.class}: #{e.message}\n#{e.backtrace.join('  \n')}")
       raise Bundler::InstallError, msg
     end
 
@@ -176,7 +174,7 @@ module Bundler
           next
         end
 
-        File.open(binstub_path, 'w', 0755) do |f|
+        File.open(binstub_path, 'w', 0777 & ~File.umask) do |f|
           f.puts ERB.new(template, nil, '-').result(binding)
         end
       end
@@ -198,15 +196,6 @@ module Bundler
 
   private
 
-    def logger
-      # Create a debug installation log limited to 1MB
-      @logger ||= begin
-        require 'logger'
-        Bundler.app_config_path.mkpath
-        Logger.new(Bundler.app_config_path.join("install.log"), 1, 1048576)
-      end
-    end
-
     def can_install_parallely?
       min_rubygems = "2.0.7"
       if Bundler.current_ruby.mri? || Bundler.rubygems.provides?(">= #{min_rubygems}")
@@ -219,25 +208,6 @@ module Bundler
       end
     end
 
-    def check_rubygems_cache_dir
-      require 'digest'
-      cached_gems = Dir["#{Bundler.rubygems.gem_dir}/cache/*.gem"]
-
-      same_size_gems = cached_gems.group_by { |f| File.size(f) }.
-        values.select { |names| names.size > 1 }
-
-      same_hash_gems = same_size_gems.flatten.group_by do |f|
-        Digest::SHA1.hexdigest(File.read(f))
-      end.values.select { |names| names.size > 1 }
-
-      if same_hash_gems.any?
-        Bundler.ui.warn "It looks like some of your gems are corrupted!"
-        same_hash_gems.each { |name| Bundler.ui.warn "  * #{name}" }
-        Bundler.ui.warn "Please report this issue to the Bundler issue tracker " \
-          "on Github, and include the log file at .bundle/install.log. Thanks!"
-      end
-    end
-
     def generate_standalone_bundler_executable_stubs(spec)
       # double-assignment to avoid warnings about variables that will be used by ERB
       bin_path = Bundler.bin_path
@@ -314,8 +284,7 @@ module Bundler
         { :name => spec.name, :post_install => message }
       }
       specs.each do |spec|
-        deps = spec.dependencies.select { |dep| dep.type != :development }
-        if deps.empty?
+        if ready_to_install?(spec, remains)
           worker_pool.enq spec.name
           enqueued[spec.name] = true
         end
@@ -330,17 +299,21 @@ module Bundler
         remains.keys.each do |name|
           next if enqueued[name]
           spec = name2spec[name]
-          deps = spec.dependencies.select { |dep| remains[dep.name] and dep.type != :development }
-          if deps.empty?
+          if ready_to_install?(spec, remains)
             worker_pool.enq name
             enqueued[name] = true
           end
         end
       end
-      check_rubygems_cache_dir
       message
     ensure
       worker_pool && worker_pool.stop
     end
+
+    def ready_to_install?(spec, remains)
+      spec.dependencies.none? do |dep|
+        remains[dep.name] && dep.type != :development && dep.name != spec.name
+      end
+    end
   end
 end
diff --git a/lib/bundler/man/bundle b/lib/bundler/man/bundle
index f90637c..54f32b7 100644
--- a/lib/bundler/man/bundle
+++ b/lib/bundler/man/bundle
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "BUNDLE" "1" "December 2013" "" ""
+.TH "BUNDLE" "1" "January 2014" "" ""
 .
 .SH "NAME"
 \fBbundle\fR \- Ruby Dependency Management
diff --git a/lib/bundler/man/bundle-config b/lib/bundler/man/bundle-config
index bf3ce0e..7e46fa4 100644
--- a/lib/bundler/man/bundle-config
+++ b/lib/bundler/man/bundle-config
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "BUNDLE\-CONFIG" "1" "December 2013" "" ""
+.TH "BUNDLE\-CONFIG" "1" "January 2014" "" ""
 .
 .SH "NAME"
 \fBbundle\-config\fR \- Set bundler configuration options
diff --git a/lib/bundler/man/bundle-config.txt b/lib/bundler/man/bundle-config.txt
index a47b985..8668f74 100644
--- a/lib/bundler/man/bundle-config.txt
+++ b/lib/bundler/man/bundle-config.txt
@@ -181,4 +181,4 @@ MIRRORS OF GEM REPOSITORIES
 
 
 
-				 December 2013		      BUNDLE-CONFIG(1)
+				 January 2014		      BUNDLE-CONFIG(1)
diff --git a/lib/bundler/man/bundle-exec b/lib/bundler/man/bundle-exec
index db6f347..c383144 100644
--- a/lib/bundler/man/bundle-exec
+++ b/lib/bundler/man/bundle-exec
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "BUNDLE\-EXEC" "1" "December 2013" "" ""
+.TH "BUNDLE\-EXEC" "1" "January 2014" "" ""
 .
 .SH "NAME"
 \fBbundle\-exec\fR \- Execute a command in the context of the bundle
diff --git a/lib/bundler/man/bundle-exec.txt b/lib/bundler/man/bundle-exec.txt
index 4cfc0eb..cd8650a 100644
--- a/lib/bundler/man/bundle-exec.txt
+++ b/lib/bundler/man/bundle-exec.txt
@@ -160,4 +160,4 @@ RUBYGEMS PLUGINS
 
 
 
-				 December 2013			BUNDLE-EXEC(1)
+				 January 2014			BUNDLE-EXEC(1)
diff --git a/lib/bundler/man/bundle-install b/lib/bundler/man/bundle-install
index d2ffd14..a8c3fed 100644
--- a/lib/bundler/man/bundle-install
+++ b/lib/bundler/man/bundle-install
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "BUNDLE\-INSTALL" "1" "December 2013" "" ""
+.TH "BUNDLE\-INSTALL" "1" "January 2014" "" ""
 .
 .SH "NAME"
 \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -57,7 +57,7 @@ A space\-separated list of groups to skip installing\. This is a \fIremembered o
 .
 .TP
 \fB\-\-local\fR
-Do not attempt to connect to \fBrubygems\.org\fR, instead using just the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if a more appropriate platform\-specific gem exists on \fBrubygems\.org\fR, it will not be found\. This option implies \fB\-\-no\-cache\fR\.
+Do not attempt to connect to \fBrubygems\.org\fR, instead using just the gems already present in Rubygems\' cache or in \fBvendor/cache\fR\. Note that if a more appropriate platform\-specific gem exists on \fBrubygems\.org\fR, it will not be found\.
 .
 .TP
 \fB\-\-deployment\fR
diff --git a/lib/bundler/man/bundle-install.txt b/lib/bundler/man/bundle-install.txt
index 8146d32..da0cbec 100644
--- a/lib/bundler/man/bundle-install.txt
+++ b/lib/bundler/man/bundle-install.txt
@@ -66,37 +66,36 @@ OPTIONS
 	      Do not attempt to connect to rubygems.org,  instead  using  just
 	      the  gems already present in Rubygems' cache or in vendor/cache.
 	      Note that if a more appropriate platform-specific gem exists  on
-	      rubygems.org,   it  will	not  be  found.  This  option  implies
-	      --no-cache.
+	      rubygems.org, it will not be found.
 
        --deployment
-	      Switches bundler's defaults into deployment  mode.  Do  not  use
+	      Switches	bundler's  defaults  into  deployment mode. Do not use
 	      this flag on development machines.
 
        --binstubs[=<directory>]
-	      Create  a  directory  (defaults to bin) containing an executable
-	      that runs in the context of the bundle.  For  instance,  if  the
+	      Create a directory (defaults to bin)  containing	an  executable
+	      that  runs  in  the  context of the bundle. For instance, if the
 	      rails gem comes with a rails executable, this flag will create a
-	      bin/rails executable that ensures  that  all  dependencies  used
+	      bin/rails  executable  that  ensures  that all dependencies used
 	      come from the bundled gems.
 
        --shebang ruby-install-name
-	      Uses  the ruby executable (usually ruby) provided to execute the
+	      Uses the ruby executable (usually ruby) provided to execute  the
 	      scripts created with --binstubs. For instance, if you use --bin-
-	      stubs  with  --shebang jruby, all executables will be created to
+	      stubs with --shebang jruby, all executables will be  created  to
 	      use jruby instead.
 
        --standalone[=<list>]
 	      Make a bundle that can work without Ruby Gems or Bundler at run-
-	      time.  It  takes a space separated list of groups to install. It
-	      creates a bundle directory and installs  the  bundle  there.  It
-	      also   generates	 a  bundle/bundler/setup.rb  file  to  replace
+	      time. It takes a space separated list of groups to  install.  It
+	      creates  a  bundle  directory  and installs the bundle there. It
+	      also  generates  a  bundle/bundler/setup.rb  file   to   replace
 	      Bundler's own setup.
 
        --trust-policy=[<policy>]
 	      Apply the Rubygems security policy named policy, where policy is
 	      one of HighSecurity, MediumSecurity, LowSecurity, or NoSecurity.
-	      For more detail, see the Rubygems signing documentation,	linked
+	      For  more detail, see the Rubygems signing documentation, linked
 	      below in SEE ALSO.
 
        --jobs=[<size>]
@@ -107,64 +106,64 @@ OPTIONS
 	      Retries failed network or git requests tries times.
 
        --no-cache
-	      Do not update the cache in vendor/cache with the	newly  bundled
-	      gems.  This does not remove any existing cached gems, only stops
+	      Do  not  update the cache in vendor/cache with the newly bundled
+	      gems. This does not remove any existing cached gems, only  stops
 	      the newly bundled gems from being cached during the install.
 
        --quiet
-	      Do not print progress information to stdout.  Instead,  communi-
-	      cate  the success of the install operation via exit status code.
+	      Do  not  print progress information to stdout. Instead, communi-
+	      cate the success of the install operation via exit status  code.
 
 DEPLOYMENT MODE
        Bundler's defaults are optimized for development. To switch to defaults
-       optimized  for  deployment,  use the --deployment flag. Do not activate
-       deployment mode on development machines, as it will cause in  an  error
+       optimized for deployment, use the --deployment flag.  Do  not  activate
+       deployment  mode  on development machines, as it will cause in an error
        when the Gemfile is modified.
 
        1.  A Gemfile.lock is required.
 
 	   To ensure that the same versions of the gems you developed with and
-	   tested with	are  also  used  in  deployments,  a  Gemfile.lock  is
+	   tested  with  are  also  used  in  deployments,  a  Gemfile.lock is
 	   required.
 
-	   This  is  mainly  to  ensure  that  you remember to check your Gem-
+	   This is mainly to ensure that  you  remember  to  check  your  Gem-
 	   file.lock into version control.
 
        2.  The Gemfile.lock must be up to date
 
-	   In development, you can modify your Gemfile(5)  and	re-run	bundle
+	   In  development,  you  can modify your Gemfile(5) and re-run bundle
 	   install to conservatively update your Gemfile.lock snapshot.
 
-	   In  deployment, your Gemfile.lock should be up-to-date with changes
+	   In deployment, your Gemfile.lock should be up-to-date with  changes
 	   made in your Gemfile(5).
 
-       3.  Gems are installed to vendor/bundle not your default  system  loca-
+       3.  Gems  are  installed to vendor/bundle not your default system loca-
 	   tion
 
-	   In  development,  it's  convenient  to  share the gems used in your
-	   application with other applications and other scripts  run  on  the
+	   In development, it's convenient to share  the  gems	used  in  your
+	   application	with  other  applications and other scripts run on the
 	   system.
 
-	   In  deployment, isolation is a more important default. In addition,
-	   the user deploying the  application	may  not  have	permission  to
-	   install  gems to the system, or the web server may not have permis-
+	   In deployment, isolation is a more important default. In  addition,
+	   the	user  deploying  the  application  may	not have permission to
+	   install gems to the system, or the web server may not have  permis-
 	   sion to read them.
 
-	   As a result, bundle install --deployment installs gems to the  ven-
-	   dor/bundle  directory  in  the  application. This may be overridden
+	   As  a result, bundle install --deployment installs gems to the ven-
+	   dor/bundle directory in the application.  This  may	be  overridden
 	   using the --path option.
 
 
 
 SUDO USAGE
-       By default, bundler installs gems to the same location as gem  install.
+       By  default, bundler installs gems to the same location as gem install.
 
-       In  some cases, that location may not be writable by your Unix user. In
+       In some cases, that location may not be writable by your Unix user.  In
        that case, bundler will stage everything in a temporary directory, then
-       ask  you  for  your  sudo password in order to copy the gems into their
+       ask you for your sudo password in order to copy	the  gems  into  their
        system location.
 
-       From your perspective,  this  is  identical  to	installing  them  gems
+       From  your  perspective,  this  is  identical  to  installing them gems
        directly into the system.
 
        You should never use sudo bundle install. This is because several other
@@ -178,36 +177,36 @@ SUDO USAGE
 
 
 
-       Of these three, the first  two  could  theoretically  be  performed  by
-       chowning  the  resulting  files	to $SUDO_USER. The third, however, can
-       only be performed by actually invoking the git command as  the  current
-       user.  Therefore,  git gems are downloaded and installed into ~/.bundle
+       Of  these  three,  the  first  two  could theoretically be performed by
+       chowning the resulting files to $SUDO_USER.  The  third,  however,  can
+       only  be  performed by actually invoking the git command as the current
+       user. Therefore, git gems are downloaded and installed  into  ~/.bundle
        rather than $GEM_HOME or $BUNDLE_PATH.
 
-       As a result, you should run bundle install as  the  current  user,  and
+       As  a  result,  you  should run bundle install as the current user, and
        bundler will ask for your password if it is needed to put the gems into
        their final location.
 
 INSTALLING GROUPS
-       By default, bundle install will install all gems in all groups in  your
+       By  default, bundle install will install all gems in all groups in your
        Gemfile(5), except those declared for a different platform.
 
-       However,  you  can  explicitly  tell bundler to skip installing certain
-       groups with the --without option. This option takes  a  space-separated
+       However, you can explicitly tell bundler  to  skip  installing  certain
+       groups  with  the --without option. This option takes a space-separated
        list of groups.
 
-       While  the --without option will skip installing the gems in the speci-
-       fied groups, it will still download those gems and use them to  resolve
+       While the --without option will skip installing the gems in the	speci-
+       fied  groups, it will still download those gems and use them to resolve
        the dependencies of every gem in your Gemfile(5).
 
        This is so that installing a different set of groups on another machine
-       (such as a production server) will not change  the  gems  and  versions
+       (such  as  a  production  server) will not change the gems and versions
        that you have already developed and tested against.
 
        Bundler offers a rock-solid guarantee that the third-party code you are
        running in development and testing is also the third-party code you are
-       running	in  production. You can choose to exclude some of that code in
-       different environments, but you will never  be  caught  flat-footed  by
+       running in production. You can choose to exclude some of that  code  in
+       different  environments,  but  you  will never be caught flat-footed by
        different versions of third-party code being used in different environ-
        ments.
 
@@ -225,86 +224,86 @@ INSTALLING GROUPS
 
 
 
-       In this case, sinatra depends on any version of	Rack  (>=  1.0,  while
+       In  this  case,	sinatra  depends on any version of Rack (>= 1.0, while
        rack-perftools-profiler depends on 1.x (~> 1.0).
 
-       When  you  run  bundle  install --without production in development, we
-       look at the dependencies of rack-perftools-profiler as well. That  way,
-       you  do	not spend all your time developing against Rack 2.0, using new
-       APIs unavailable in Rack 1.x, only to have bundler switch to  Rack  1.2
+       When you run bundle install --without  production  in  development,  we
+       look  at the dependencies of rack-perftools-profiler as well. That way,
+       you do not spend all your time developing against Rack 2.0,  using  new
+       APIs  unavailable  in Rack 1.x, only to have bundler switch to Rack 1.2
        when the production group is used.
 
-       This  should  not  cause  any  problems	in practice, because we do not
-       attempt to install the gems in the excluded groups, and	only  evaluate
+       This should not cause any problems  in  practice,  because  we  do  not
+       attempt	to  install the gems in the excluded groups, and only evaluate
        as part of the dependency resolution process.
 
-       This  also means that you cannot include different versions of the same
-       gem in different groups, because doing so  would  result  in  different
+       This also means that you cannot include different versions of the  same
+       gem  in	different  groups,  because doing so would result in different
        sets of dependencies used in development and production. Because of the
-       vagaries of the dependency resolution  process,	this  usually  affects
-       more  than just the gems you list in your Gemfile(5), and can (surpris-
+       vagaries  of  the  dependency  resolution process, this usually affects
+       more than just the gems you list in your Gemfile(5), and can  (surpris-
        ingly) radically change the gems you are using.
 
 REMEMBERED OPTIONS
-       Some options (marked above  in  the  OPTIONS  section)  are  remembered
+       Some  options  (marked  above  in  the  OPTIONS section) are remembered
        between calls to bundle install, and by the Bundler runtime.
 
-       For  instance,  if  you run bundle install --without test, a subsequent
-       call to bundle install that does not  include  a  --without  flag  will
+       For instance, if you run bundle install --without  test,  a  subsequent
+       call  to  bundle  install  that	does not include a --without flag will
        remember your previous choice.
 
-       In  addition, a call to Bundler.setup will not attempt to make the gems
-       in those groups available on the Ruby  load  path,  as  they  were  not
+       In addition, a call to Bundler.setup will not attempt to make the  gems
+       in  those  groups  available  on  the  Ruby load path, as they were not
        installed.
 
        The settings that are remembered are:
 
        --deployment
-	      At  runtime, this remembered setting will also result in Bundler
+	      At runtime, this remembered setting will also result in  Bundler
 	      raising an exception if the Gemfile.lock is out of date.
 
-       --path Subsequent calls to bundle install  will	install  gems  to  the
-	      directory  originally passed to --path. The Bundler runtime will
-	      look for gems in that location. You can revert  this  option  by
+       --path Subsequent  calls  to  bundle  install  will install gems to the
+	      directory originally passed to --path. The Bundler runtime  will
+	      look  for  gems  in that location. You can revert this option by
 	      running bundle install --system.
 
        --binstubs
-	      Bundler  will  update  the  executables every subsequent call to
+	      Bundler will update the executables  every  subsequent  call  to
 	      bundle install.
 
        --without
-	      As described above, Bundler will	skip  the  gems  specified  by
-	      --without  in  subsequent  calls	to bundle install. The Bundler
+	      As  described  above,  Bundler  will  skip the gems specified by
+	      --without in subsequent calls to	bundle	install.  The  Bundler
 	      runtime will also not try to make the gems in the skipped groups
 	      available.
 
 THE GEMFILE.LOCK
-       When  you  run  bundle install, Bundler will persist the full names and
-       versions of all gems that you used (including dependencies of the  gems
+       When you run bundle install, Bundler will persist the  full  names  and
+       versions  of all gems that you used (including dependencies of the gems
        specified in the Gemfile(5)) into a file called Gemfile.lock.
 
        Bundler uses this file in all subsequent calls to bundle install, which
        guarantees that you always use the same exact code, even as your appli-
        cation moves across machines.
 
-       Because	of the way dependency resolution works, even a seemingly small
+       Because of the way dependency resolution works, even a seemingly  small
        change (for instance, an update to a point-release of a dependency of a
-       gem  in	your  Gemfile(5)) can result in radically different gems being
+       gem in your Gemfile(5)) can result in radically	different  gems  being
        needed to satisfy all dependencies.
 
-       As a result, you SHOULD check your Gemfile.lock into  version  control.
+       As  a  result, you SHOULD check your Gemfile.lock into version control.
        If you do not, every machine that checks out your repository (including
        your production server) will resolve all dependencies again, which will
-       result  in  different versions of third-party code being used if any of
-       the gems in the Gemfile(5) or  any  of  their  dependencies  have  been
+       result in different versions of third-party code being used if  any  of
+       the  gems  in  the  Gemfile(5)  or  any of their dependencies have been
        updated.
 
 CONSERVATIVE UPDATING
-       When  you  make a change to the Gemfile(5) and then run bundle install,
+       When you make a change to the Gemfile(5) and then run  bundle  install,
        Bundler will update only the gems that you modified.
 
-       In other words, if a gem that you did  not  modify  worked  before  you
-       called  bundle install, it will continue to use the exact same versions
+       In  other  words,  if  a  gem that you did not modify worked before you
+       called bundle install, it will continue to use the exact same  versions
        of all dependencies as it used before the update.
 
        Let's take a look at an example. Here's your original Gemfile(5):
@@ -318,13 +317,13 @@ CONSERVATIVE UPDATING
 
 
 
-       In this case, both actionpack and activemerchant depend	on  activesup-
-       port.  The  actionpack  gem  depends on activesupport 2.3.8 and rack ~>
-       1.1.0, while the activemerchant gem depends on activesupport >=	2.3.2,
+       In  this  case, both actionpack and activemerchant depend on activesup-
+       port. The actionpack gem depends on activesupport  2.3.8  and  rack  ~>
+       1.1.0,  while the activemerchant gem depends on activesupport >= 2.3.2,
        braintree >= 2.0.0, and builder >= 2.0.0.
 
-       When   the   dependencies  are  first  resolved,  Bundler  will	select
-       activesupport 2.3.8, which satisfies the requirements of both  gems  in
+       When  the  dependencies	are  first  resolved,  Bundler	 will	select
+       activesupport  2.3.8,  which satisfies the requirements of both gems in
        your Gemfile(5).
 
        Next, you modify your Gemfile(5) to:
@@ -338,40 +337,40 @@ CONSERVATIVE UPDATING
 
 
 
-       The  actionpack	3.0.0.rc  gem  has  a  number of new dependencies, and
-       updates the activesupport dependency to = 3.0.0.rc and the rack	depen-
+       The actionpack 3.0.0.rc gem has	a  number  of  new  dependencies,  and
+       updates	the activesupport dependency to = 3.0.0.rc and the rack depen-
        dency to ~> 1.2.1.
 
-       When  you  run  bundle  install,  Bundler  notices that you changed the
-       actionpack gem, but not the activemerchant gem. It evaluates  the  gems
+       When you run bundle install,  Bundler  notices  that  you  changed  the
+       actionpack  gem,  but not the activemerchant gem. It evaluates the gems
        currently being used to satisfy its requirements:
 
        activesupport 2.3.8
-	      also  used  to  satisfy a dependency in activemerchant, which is
+	      also used to satisfy a dependency in  activemerchant,  which  is
 	      not being updated
 
        rack ~> 1.1.0
 	      not currently being used to satisfy another dependency
 
-       Because you did not explicitly ask to update activemerchant, you  would
-       not  expect it to suddenly stop working after updating actionpack. How-
-       ever, satisfying the new activesupport 3.0.0.rc dependency  of  action-
+       Because	you did not explicitly ask to update activemerchant, you would
+       not expect it to suddenly stop working after updating actionpack.  How-
+       ever,  satisfying  the new activesupport 3.0.0.rc dependency of action-
        pack requires updating one of its dependencies.
 
-       Even  though activemerchant declares a very loose dependency that theo-
-       retically matches activesupport 3.0.0.rc, bundler treats gems  in  your
-       Gemfile(5)  that have not changed as an atomic unit together with their
+       Even though activemerchant declares a very loose dependency that  theo-
+       retically  matches  activesupport 3.0.0.rc, bundler treats gems in your
+       Gemfile(5) that have not changed as an atomic unit together with  their
        dependencies. In this case, the activemerchant dependency is treated as
-       activemerchant  1.7.1  +  activesupport	2.3.8,	so bundle install will
+       activemerchant 1.7.1 + activesupport  2.3.8,  so  bundle  install  will
        report that it cannot update actionpack.
 
        To explicitly update actionpack, including its dependencies which other
-       gems  in  the  Gemfile(5) still depend on, run bundle update actionpack
+       gems in the Gemfile(5) still depend on, run  bundle  update  actionpack
        (see bundle update(1)).
 
-       Summary: In general, after making a change  to  the  Gemfile(5)	,  you
-       should  first  try  to run bundle install, which will guarantee that no
-       other gems in the Gemfile(5) are impacted by the change. If  that  does
+       Summary:  In  general,  after  making  a change to the Gemfile(5) , you
+       should first try to run bundle install, which will  guarantee  that  no
+       other  gems  in the Gemfile(5) are impacted by the change. If that does
        not work, run bundle update(1) bundle-update.1.html.
 
 SEE ALSO
@@ -384,4 +383,4 @@ SEE ALSO
 
 
 
-				 December 2013		     BUNDLE-INSTALL(1)
+				 January 2014		     BUNDLE-INSTALL(1)
diff --git a/lib/bundler/man/bundle.txt b/lib/bundler/man/bundle.txt
index c9772af..bac3565 100644
--- a/lib/bundler/man/bundle.txt
+++ b/lib/bundler/man/bundle.txt
@@ -94,4 +94,4 @@ OBSOLETE
 
 
 
-				 December 2013			     BUNDLE(1)
+				 January 2014			     BUNDLE(1)
diff --git a/lib/bundler/man/gemfile.5 b/lib/bundler/man/gemfile.5
index adc32c3..b0942a3 100644
--- a/lib/bundler/man/gemfile.5
+++ b/lib/bundler/man/gemfile.5
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "GEMFILE" "5" "December 2013" "" ""
+.TH "GEMFILE" "5" "January 2014" "" ""
 .
 .SH "NAME"
 \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -323,7 +323,7 @@ gem "rails", :git => "git://github\.com/rails/rails\.git"
 .IP "" 0
 .
 .P
-A git repository \fBSHOULD\fR have at least one file, at the root of the directory containing the gem, with the extension \fB\.gemspec\fR\. This file \fBMUST\fR contain a valid gem specification, as expected by the \fBgem build\fR command\. It \fBMUST NOT\fR have any dependencies, other than on the files in the git repository itself and any built\-in functionality of Ruby or Rubygems\.
+A git repository \fBSHOULD\fR have at least one file, at the root of the directory containing the gem, with the extension \fB\.gemspec\fR\. This file \fBMUST\fR contain a valid gem specification, as expected by the \fBgem build\fR command\.
 .
 .P
 If a git repository does not have a \fB\.gemspec\fR, bundler will attempt to create one, but it will not contain any dependencies, executables, or C extension compilation instructions\. As a result, it may fail to properly integrate into your application\.
diff --git a/lib/bundler/man/gemfile.5.txt b/lib/bundler/man/gemfile.5.txt
index 9e78d6b..461176c 100644
--- a/lib/bundler/man/gemfile.5.txt
+++ b/lib/bundler/man/gemfile.5.txt
@@ -275,9 +275,7 @@ GEMS (#gem)
        A  git  repository  SHOULD  have  at least one file, at the root of the
        directory containing the gem, with the extension  .gemspec.  This  file
        MUST  contain  a  valid gem specification, as expected by the gem build
-       command. It MUST NOT have any dependencies, other than on the files  in
-       the  git  repository  itself  and any built-in functionality of Ruby or
-       Rubygems.
+       command.
 
        If a git repository does not have a .gemspec, bundler will  attempt  to
        create one, but it will not contain any dependencies, executables, or C
@@ -445,4 +443,4 @@ SOURCE PRIORITY
 
 
 
-				 December 2013			    GEMFILE(5)
+				 January 2014			    GEMFILE(5)
diff --git a/lib/bundler/parallel_workers/unix_worker.rb b/lib/bundler/parallel_workers/unix_worker.rb
index 51c2d0d..94a07bf 100644
--- a/lib/bundler/parallel_workers/unix_worker.rb
+++ b/lib/bundler/parallel_workers/unix_worker.rb
@@ -80,12 +80,20 @@ module Bundler
       # Kill the forked workers by sending SIGINT to them
       def stop_workers
         @workers.each do |worker|
-          worker.io_r.close
-          worker.io_w.close
-          Process.kill :INT, worker.pid
+          worker.io_r.close unless worker.io_r.closed?
+          worker.io_w.close unless worker.io_w.closed?
+          begin
+            Process.kill :INT, worker.pid
+          rescue Errno::ESRCH
+            nil
+          end
         end
         @workers.each do |worker|
-          Process.waitpid worker.pid
+          begin
+            Process.waitpid worker.pid
+          rescue Errno::ECHILD
+            nil
+          end
         end
       end
     end
diff --git a/lib/bundler/parallel_workers/worker.rb b/lib/bundler/parallel_workers/worker.rb
index 6e22eb4..379f79d 100644
--- a/lib/bundler/parallel_workers/worker.rb
+++ b/lib/bundler/parallel_workers/worker.rb
@@ -19,6 +19,7 @@ module Bundler
         @response_queue = Queue.new
         prepare_workers size, func
         prepare_threads size
+        trap("INT") { @threads.each {|i| i.exit }; stop_workers; exit 1 }
       end
 
       # Enque a request to be executed in the worker pool
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 9f50d96..583e35c 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -56,7 +56,7 @@ module Gem
     end
 
     def git_version
-      if @loaded_from && File.exist?(File.join(full_gem_path, ".git"))
+      if loaded_from && File.exist?(File.join(full_gem_path, ".git"))
         sha = Bundler::SharedHelpers.chdir(full_gem_path){ `git rev-parse HEAD`.strip }
         " #{sha[0..6]}"
       end
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 7fb40c3..b24f6c6 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -422,7 +422,7 @@ module Bundler
       end
     end
 
-    # Rubygems ~> 1.8.5
+    # Rubygems 1.8.5-1.8.19
     class Modern < RubygemsIntegration
       def stub_rubygems(specs)
         Gem::Specification.all = specs
@@ -441,11 +441,6 @@ module Bundler
       def find_name(name)
         Gem::Specification.find_all_by_name name
       end
-
-      def build(spec, skip_validation = false)
-        require 'rubygems/builder'
-        Gem::Builder.new(spec).build(skip_validation)
-      end
     end
 
     # Rubygems 1.8.0 to 1.8.4
@@ -460,14 +455,24 @@ module Bundler
       end
     end
 
+    # Rubygems 1.8.20+
+    class MoreModern < Modern
+      # Rubygems 1.8.20 and adds the skip_validation parameter, so that's
+      # when we start passing it through.
+      def build(spec, skip_validation = false)
+        require 'rubygems/builder'
+        Gem::Builder.new(spec).build(skip_validation)
+      end
+    end
+
     # Rubygems 2.0
     class Future < RubygemsIntegration
       def stub_rubygems(specs)
         Gem::Specification.all = specs
 
-        Gem.post_reset {
+        Gem.post_reset do
           Gem::Specification.all = specs
-        }
+        end
       end
 
       def all_specs
@@ -529,6 +534,8 @@ module Bundler
 
   if RubygemsIntegration.provides?(">= 1.99.99")
     @rubygems = RubygemsIntegration::Future.new
+  elsif RubygemsIntegration.provides?('>= 1.8.20')
+    @rubygems = RubygemsIntegration::MoreModern.new
   elsif RubygemsIntegration.provides?('>= 1.8.5')
     @rubygems = RubygemsIntegration::Modern.new
   elsif RubygemsIntegration.provides?('>= 1.8.0')
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index 5a3c312..34072c3 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
   spec.homepage      = ""
   spec.license       = "MIT"
 
-  spec.files         = `git ls-files`.split($/)
+  spec.files         = `git ls-files -z`.split("\x0")
   spec.executables   = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
   spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
   spec.require_paths = ["lib"]
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index 3fa04a8..8db1d63 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -2,5 +2,5 @@ module Bundler
   # We're doing this because we might write tests that deal
   # with other versions of bundler and we are unsure how to
   # handle this better.
-  VERSION = "1.5.1" unless defined?(::Bundler::VERSION)
+  VERSION = "1.5.2" unless defined?(::Bundler::VERSION)
 end
diff --git a/man/bundle-install.ronn b/man/bundle-install.ronn
index 2af9c45..92a1923 100644
--- a/man/bundle-install.ronn
+++ b/man/bundle-install.ronn
@@ -61,7 +61,7 @@ update process below under [CONSERVATIVE UPDATING][].
   Do not attempt to connect to `rubygems.org`, instead using just
   the gems already present in Rubygems' cache or in `vendor/cache`.
   Note that if a more appropriate platform-specific gem exists on
-  `rubygems.org`, it will not be found. This option implies `--no-cache`.
+  `rubygems.org`, it will not be found.
 
 * `--deployment`:
   Switches bundler's defaults into [deployment mode][DEPLOYMENT MODE].
diff --git a/man/gemfile.5.ronn b/man/gemfile.5.ronn
index 1dec8b9..a024da7 100644
--- a/man/gemfile.5.ronn
+++ b/man/gemfile.5.ronn
@@ -217,8 +217,7 @@ as they would for a normal gem.
 A git repository `SHOULD` have at least one file, at the root of the
 directory containing the gem, with the extension `.gemspec`. This file
 `MUST` contain a valid gem specification, as expected by the `gem build`
-command. It `MUST NOT` have any dependencies, other than on the files in
-the git repository itself and any built-in functionality of Ruby or Rubygems.
+command.
 
 If a git repository does not have a `.gemspec`, bundler will attempt to
 create one, but it will not contain any dependencies, executables, or
diff --git a/metadata.yml b/metadata.yml
index 45c6aa9..883718b 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: bundler
 version: !ruby/object:Gem::Version
-  version: 1.5.1
+  version: 1.5.2
   prerelease: 
 platform: ruby
 authors:
@@ -12,7 +12,7 @@ authors:
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2013-12-28 00:00:00.000000000 Z
+date: 2014-01-11 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: ronn
@@ -168,6 +168,9 @@ files:
 - lib/bundler/vendor/thor/error.rb
 - lib/bundler/vendor/thor/group.rb
 - lib/bundler/vendor/thor/invocation.rb
+- lib/bundler/vendor/thor/line_editor.rb
+- lib/bundler/vendor/thor/line_editor/basic.rb
+- lib/bundler/vendor/thor/line_editor/readline.rb
 - lib/bundler/vendor/thor/parser.rb
 - lib/bundler/vendor/thor/parser/argument.rb
 - lib/bundler/vendor/thor/parser/arguments.rb
@@ -258,8 +261,7 @@ files:
 - spec/quality_spec.rb
 - spec/realworld/dependency_api_spec.rb
 - spec/realworld/edgecases_spec.rb
-- spec/realworld/parallel_install_spec.rb
-- spec/realworld/parallel_update_spec.rb
+- spec/realworld/parallel_spec.rb
 - spec/resolver/basic_spec.rb
 - spec/resolver/platform_spec.rb
 - spec/runtime/executable_spec.rb
@@ -278,6 +280,7 @@ files:
 - spec/support/artifice/endpoint_extra.rb
 - spec/support/artifice/endpoint_extra_missing.rb
 - spec/support/artifice/endpoint_fallback.rb
+- spec/support/artifice/endpoint_host_redirect.rb
 - spec/support/artifice/endpoint_marshal_fail.rb
 - spec/support/artifice/endpoint_redirect.rb
 - spec/support/artifice/endpoint_timeout.rb
@@ -289,6 +292,7 @@ files:
 - spec/support/indexes.rb
 - spec/support/matchers.rb
 - spec/support/path.rb
+- spec/support/permissions.rb
 - spec/support/platforms.rb
 - spec/support/ruby_ext.rb
 - spec/support/rubygems_ext.rb
@@ -403,8 +407,7 @@ test_files:
 - spec/quality_spec.rb
 - spec/realworld/dependency_api_spec.rb
 - spec/realworld/edgecases_spec.rb
-- spec/realworld/parallel_install_spec.rb
-- spec/realworld/parallel_update_spec.rb
+- spec/realworld/parallel_spec.rb
 - spec/resolver/basic_spec.rb
 - spec/resolver/platform_spec.rb
 - spec/runtime/executable_spec.rb
@@ -423,6 +426,7 @@ test_files:
 - spec/support/artifice/endpoint_extra.rb
 - spec/support/artifice/endpoint_extra_missing.rb
 - spec/support/artifice/endpoint_fallback.rb
+- spec/support/artifice/endpoint_host_redirect.rb
 - spec/support/artifice/endpoint_marshal_fail.rb
 - spec/support/artifice/endpoint_redirect.rb
 - spec/support/artifice/endpoint_timeout.rb
@@ -434,6 +438,7 @@ test_files:
 - spec/support/indexes.rb
 - spec/support/matchers.rb
 - spec/support/path.rb
+- spec/support/permissions.rb
 - spec/support/platforms.rb
 - spec/support/ruby_ext.rb
 - spec/support/rubygems_ext.rb
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index 3d3ed0f..0f04ad4 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -90,6 +90,19 @@ describe "bundle binstubs <gem>" do
 
       expect(bundled_app("bin/foo")).to exist
     end
+
+    it "sets correct permissions for binstubs" do
+      with_umask(0002) do
+        install_gemfile <<-G
+          source "file://#{gem_repo1}"
+          gem "rack"
+        G
+
+        bundle "binstubs rack"
+        binary = bundled_app("bin/rackup")
+        expect(File.stat(binary).mode.to_s(8)).to eq("100775")
+      end
+    end
   end
 
   context "--path" do
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index ef36fb5..14910e6 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -34,7 +34,7 @@ describe "bundle install with git sources" do
       git = update_git "foo" do |s|
         s.executables = ["foobar"] # we added this the first time, so keep it now
         s.files = ["bin/foobar"] # updating git nukes the files list
-        foospec = s.to_ruby.gsub(/s\.files.*/, 's.files = `git ls-files`.split("\n")')
+        foospec = s.to_ruby.gsub(/s\.files.*/, 's.files = `git ls-files -z`.split("\x0")')
         s.write "foo.gemspec", foospec
       end
 
@@ -911,4 +911,4 @@ describe "bundle install with git sources" do
       expect(out).to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git")
     end
   end
-end
\ No newline at end of file
+end
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index da95513..a88e459 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -162,6 +162,40 @@ describe "gemcutter's dependency API" do
     should_be_installed "rack 1.0.0"
   end
 
+  it "handles host redirects" do
+    gemfile <<-G
+      source "#{source_uri}"
+      gem "rack"
+    G
+
+    bundle :install, :artifice => "endpoint_host_redirect"
+    should_be_installed "rack 1.0.0"
+  end
+
+  it "handles host redirects without Net::HTTP::Persistent" do
+    gemfile <<-G
+      source "#{source_uri}"
+      gem "rack"
+    G
+
+    FileUtils.mkdir_p lib_path
+    File.open(lib_path("disable_net_http_persistent.rb"), "w") do |h|
+      h.write <<-H
+        module Kernel
+          alias require_without_disabled_net_http require
+          def require(*args)
+            raise LoadError, 'simulated' if args.first == 'openssl' && !caller.grep(/vendored_persistent/).empty?
+            require_without_disabled_net_http(*args)
+          end
+        end
+      H
+    end
+
+    bundle :install, :artifice => "endpoint_host_redirect", :requires => [lib_path("disable_net_http_persistent.rb")]
+    expect(out).to_not match(/Too many redirects/)
+    should_be_installed "rack 1.0.0"
+  end
+
   it "timeouts when Bundler::Fetcher redirects too much" do
     gemfile <<-G
       source "#{source_uri}"
diff --git a/spec/install/gems/packed_spec.rb b/spec/install/gems/packed_spec.rb
index 1992f5d..cce3b4a 100644
--- a/spec/install/gems/packed_spec.rb
+++ b/spec/install/gems/packed_spec.rb
@@ -2,7 +2,7 @@ require "spec_helper"
 
 describe "bundle install with gem sources" do
   describe "when cached and locked" do
-    it "does not hit the remote at all if --local is passed" do
+    it "does not hit the remote at all" do
       build_repo2
       install_gemfile <<-G
         source "file://#{gem_repo2}"
@@ -14,11 +14,10 @@ describe "bundle install with gem sources" do
       FileUtils.rm_rf gem_repo2
 
       bundle "install --local"
-      expect(out).not_to include("Updating files in vendor/cache")
       should_be_installed "rack 1.0.0"
     end
 
-    it "does not hit the remote at all if --deployment is passed" do
+    it "does not hit the remote at all" do
       build_repo2
       install_gemfile <<-G
         source "file://#{gem_repo2}"
@@ -30,7 +29,6 @@ describe "bundle install with gem sources" do
       FileUtils.rm_rf gem_repo2
 
       bundle "install --deployment"
-      expect(out).not_to include("Updating files in vendor/cache")
       should_be_installed "rack 1.0.0"
     end
 
diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb
index 840f2be..ca3dfc1 100644
--- a/spec/quality_spec.rb
+++ b/spec/quality_spec.rb
@@ -55,7 +55,7 @@ describe "The library itself" do
     exempt = /\.gitmodules|\.marshal|fixtures|vendor|ssl_certs|LICENSE/
     error_messages = []
     Dir.chdir(File.expand_path("../..", __FILE__)) do
-      `git ls-files`.split("\n").each do |filename|
+      `git ls-files -z`.split("\x0").each do |filename|
         next if filename =~ exempt
         error_messages << check_for_tab_characters(filename)
         error_messages << check_for_extra_spaces(filename)
@@ -68,7 +68,7 @@ describe "The library itself" do
     included = /spec/
     error_messages = []
     Dir.chdir(File.expand_path("../", __FILE__)) do
-      `git ls-files`.split("\n").each do |filename|
+      `git ls-files -z`.split("\x0").each do |filename|
         next unless filename =~ included
         error_messages << check_for_spec_defs_with_single_quotes(filename)
       end
diff --git a/spec/realworld/parallel_install_spec.rb b/spec/realworld/parallel_install_spec.rb
deleted file mode 100644
index d70eb32..0000000
--- a/spec/realworld/parallel_install_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'spec_helper'
-
-describe "installing dependencies parallely", :realworld => true do
-  it "installs gems parallely" do
-    gemfile <<-G
-      source "https://rubygems.org"
-      gem 'activesupport', '~> 3.2.13'
-      gem 'faker', '~> 1.1.2'
-    G
-
-    bundle :install, :jobs => 4, :env => {"DEBUG" => "1"}
-    (0..3).each {|i| expect(out).to include("#{i}: ") }
-
-    bundle "show activesupport"
-    expect(out).to match(/activesupport/)
-
-    bundle "show faker"
-    expect(out).to match(/faker/)
-
-    bundle "config jobs"
-    expect(out).to match(/: "4"/)
-  end
-end
diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb
new file mode 100644
index 0000000..457139b
--- /dev/null
+++ b/spec/realworld/parallel_spec.rb
@@ -0,0 +1,69 @@
+require 'spec_helper'
+
+describe "parallel", :realworld => true do
+  it "installs", :ruby => "1.8" do
+    gemfile <<-G
+      source "https://rubygems.org"
+      gem 'activesupport', '~> 3.2.13'
+      gem 'faker', '~> 1.1.2'
+    G
+
+    bundle :install, :jobs => 4, :env => {"DEBUG" => "1"}
+    expect(out).to match(/[1-3]: /)
+
+    bundle "show activesupport"
+    expect(out).to match(/activesupport/)
+
+    bundle "show faker"
+    expect(out).to match(/faker/)
+
+    bundle "config jobs"
+    expect(out).to match(/: "4"/)
+  end
+
+  it "installs even with circular dependency", :ruby => "1.9" do
+    gemfile <<-G
+      source 'https://rubygems.org'
+      gem 'activesupport', '~> 3.2.13'
+      gem 'mongoid_auto_increment', "0.1.1"
+    G
+
+    bundle :install, :jobs => 4, :env => {"DEBUG" => "1"}
+    expect(out).to match(/[1-3]: /)
+
+    bundle "show activesupport"
+    expect(out).to match(/activesupport/)
+
+    bundle "show mongoid_auto_increment"
+    expect(out).to match(%r{gems/mongoid_auto_increment})
+
+    bundle "config jobs"
+    expect(out).to match(/: "4"/)
+  end
+
+  it "updates" do
+    install_gemfile <<-G
+      source "https://rubygems.org"
+      gem 'activesupport', '3.2.12'
+      gem 'faker', '~> 1.1.2'
+    G
+
+    gemfile <<-G
+      source "https://rubygems.org"
+      gem 'activesupport', '~> 3.2.12'
+      gem 'faker', '~> 1.1.2'
+    G
+
+    bundle :update, :jobs => 4, :env => {"DEBUG" => "1"}
+     expect(out).to match(/[1-3]: /)
+
+    bundle "show activesupport"
+    expect(out).to match(/activesupport-3\.2\.1[3-9]/)
+
+    bundle "show faker"
+    expect(out).to match(/faker/)
+
+    bundle "config jobs"
+    expect(out).to match(/: "4"/)
+  end
+end
diff --git a/spec/realworld/parallel_update_spec.rb b/spec/realworld/parallel_update_spec.rb
deleted file mode 100644
index 3f7f103..0000000
--- a/spec/realworld/parallel_update_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'spec_helper'
-
-describe "updating dependencies parallely", :realworld => true do
-  before :each do
-    install_gemfile <<-G
-      source "https://rubygems.org"
-      gem 'activesupport', '~> 3.2.12'
-      gem 'faker', '~> 1.1.2'
-    G
-  end
-
-  it "installs gems parallely" do
-    gemfile <<-G
-      source "https://rubygems.org"
-      gem 'activesupport', '3.2.13'
-      gem 'faker', '~> 1.1.2'
-    G
-
-    bundle :update, :jobs => 4, :env => {"DEBUG" => "1"}
-    (0..3).each {|i| expect(out).to include("#{i}: ") }
-
-    bundle "show activesupport"
-    expect(out).to match(/activesupport-3\.2\.13/)
-
-    bundle "show faker"
-    expect(out).to match(/faker/)
-
-    bundle "config jobs"
-    expect(out).to match(/: "4"/)
-  end
-end
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 00e8e1b..05f9a32 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -631,7 +631,7 @@ describe "Bundler.setup" do
     expect(out).to eq("yay")
   end
 
-  it "ignores Gem.refresh" do
+  it "stubs out Gem.refresh so it does not reveal system gems" do
     system_gems "rack-1.0.0"
 
     install_gemfile <<-G
@@ -640,11 +640,12 @@ describe "Bundler.setup" do
     G
 
     run <<-R
+      puts Bundler.rubygems.find_name("rack").inspect
       Gem.refresh
       puts Bundler.rubygems.find_name("rack").inspect
     R
 
-    expect(out).to eq("[]")
+    expect(out).to eq("[]\n[]")
   end
 
   describe "when a vendored gem specification uses the :path option" do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 0c56913..6fd6d1f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -43,6 +43,7 @@ RSpec.configure do |config|
   config.include Spec::Rubygems
   config.include Spec::Platforms
   config.include Spec::Sudo
+  config.include Spec::Permissions
 
   if Spec::Sudo.test_sudo?
     config.filter_run :sudo => true
diff --git a/spec/support/artifice/endpoint_host_redirect.rb b/spec/support/artifice/endpoint_host_redirect.rb
new file mode 100644
index 0000000..e44d63e
--- /dev/null
+++ b/spec/support/artifice/endpoint_host_redirect.rb
@@ -0,0 +1,15 @@
+require File.expand_path("../endpoint", __FILE__)
+
+Artifice.deactivate
+
+class EndpointHostRedirect < Endpoint
+  get "/fetch/actual/gem/:id", :host_name => 'localgemserver.test' do
+    redirect "http://bundler.localgemserver.test#{request.path_info}"
+  end
+
+  get "/api/v1/dependencies" do
+    status 404
+  end
+end
+
+Artifice.activate_with(EndpointHostRedirect)
diff --git a/spec/support/permissions.rb b/spec/support/permissions.rb
new file mode 100644
index 0000000..2f57961
--- /dev/null
+++ b/spec/support/permissions.rb
@@ -0,0 +1,11 @@
+module Spec
+  module Permissions
+    def with_umask(new_umask)
+      old_umask = File.umask(new_umask)
+      yield if block_given?
+    ensure
+      File.umask(old_umask)
+    end
+  end
+end
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/bundler.git



More information about the Pkg-ruby-extras-commits mailing list