bundler 2.5.9 → 2.5.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -0
  3. data/lib/bundler/build_metadata.rb +2 -2
  4. data/lib/bundler/cli/install.rb +1 -1
  5. data/lib/bundler/cli.rb +5 -22
  6. data/lib/bundler/compact_index_client/cache.rb +16 -7
  7. data/lib/bundler/constants.rb +8 -1
  8. data/lib/bundler/definition.rb +70 -50
  9. data/lib/bundler/dependency.rb +2 -1
  10. data/lib/bundler/environment_preserver.rb +2 -20
  11. data/lib/bundler/errors.rb +14 -0
  12. data/lib/bundler/gem_helper.rb +1 -1
  13. data/lib/bundler/injector.rb +2 -1
  14. data/lib/bundler/installer.rb +8 -8
  15. data/lib/bundler/man/bundle-add.1 +1 -1
  16. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  17. data/lib/bundler/man/bundle-cache.1 +1 -1
  18. data/lib/bundler/man/bundle-check.1 +3 -1
  19. data/lib/bundler/man/bundle-check.1.ronn +3 -0
  20. data/lib/bundler/man/bundle-clean.1 +1 -1
  21. data/lib/bundler/man/bundle-config.1 +1 -3
  22. data/lib/bundler/man/bundle-config.1.ronn +0 -3
  23. data/lib/bundler/man/bundle-console.1 +1 -1
  24. data/lib/bundler/man/bundle-doctor.1 +1 -1
  25. data/lib/bundler/man/bundle-exec.1 +1 -1
  26. data/lib/bundler/man/bundle-gem.1 +1 -1
  27. data/lib/bundler/man/bundle-help.1 +1 -1
  28. data/lib/bundler/man/bundle-info.1 +1 -1
  29. data/lib/bundler/man/bundle-init.1 +1 -1
  30. data/lib/bundler/man/bundle-inject.1 +1 -1
  31. data/lib/bundler/man/bundle-install.1 +1 -1
  32. data/lib/bundler/man/bundle-list.1 +1 -1
  33. data/lib/bundler/man/bundle-lock.1 +1 -1
  34. data/lib/bundler/man/bundle-open.1 +1 -1
  35. data/lib/bundler/man/bundle-outdated.1 +1 -1
  36. data/lib/bundler/man/bundle-platform.1 +1 -1
  37. data/lib/bundler/man/bundle-plugin.1 +1 -1
  38. data/lib/bundler/man/bundle-pristine.1 +1 -1
  39. data/lib/bundler/man/bundle-remove.1 +1 -1
  40. data/lib/bundler/man/bundle-show.1 +1 -1
  41. data/lib/bundler/man/bundle-update.1 +1 -1
  42. data/lib/bundler/man/bundle-version.1 +1 -1
  43. data/lib/bundler/man/bundle-viz.1 +1 -1
  44. data/lib/bundler/man/bundle.1 +1 -1
  45. data/lib/bundler/man/gemfile.5 +1 -1
  46. data/lib/bundler/rubygems_ext.rb +29 -9
  47. data/lib/bundler/self_manager.rb +1 -1
  48. data/lib/bundler/settings.rb +0 -1
  49. data/lib/bundler/setup.rb +3 -0
  50. data/lib/bundler/shared_helpers.rb +6 -4
  51. data/lib/bundler/source/git/git_proxy.rb +8 -0
  52. data/lib/bundler/source/metadata.rb +2 -0
  53. data/lib/bundler/source/rubygems.rb +6 -18
  54. data/lib/bundler/source_list.rb +28 -4
  55. data/lib/bundler/spec_set.rb +1 -1
  56. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  57. data/lib/bundler/version.rb +1 -1
  58. data/lib/bundler.rb +20 -0
  59. metadata +3 -3
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CHECK" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CHECK" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
6
6
  .SH "SYNOPSIS"
@@ -9,6 +9,8 @@
9
9
  \fBcheck\fR searches the local machine for each of the gems requested in the Gemfile\. If all gems are found, Bundler prints a success message and exits with a status of 0\.
10
10
  .P
11
11
  If not, the first missing gem is listed and Bundler exits status 1\.
12
+ .P
13
+ If the lockfile needs to be updated then it will be resolved using the gems installed on the local machine, if they satisfy the requirements\.
12
14
  .SH "OPTIONS"
13
15
  .TP
14
16
  \fB\-\-dry\-run\fR
@@ -15,6 +15,9 @@ a status of 0.
15
15
 
16
16
  If not, the first missing gem is listed and Bundler exits status 1.
17
17
 
18
+ If the lockfile needs to be updated then it will be resolved using the gems
19
+ installed on the local machine, if they satisfy the requirements.
20
+
18
21
  ## OPTIONS
19
22
 
20
23
  * `--dry-run`:
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CLEAN" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CLEAN" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONFIG" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CONFIG" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-config\fR \- Set bundler configuration options
6
6
  .SH "SYNOPSIS"
@@ -95,8 +95,6 @@ Any periods in the configuration keys must be replaced with two underscores when
95
95
  .SH "LIST OF AVAILABLE KEYS"
96
96
  The following is a list of all configuration keys and their purpose\. You can learn more about their operation in bundle install(1) \fIbundle\-install\.1\.html\fR\.
97
97
  .IP "\(bu" 4
98
- \fBallow_deployment_source_credential_changes\fR (\fBBUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES\fR): When in deployment mode, allow changing the credentials to a gem's source\. Ex: \fBhttps://some\.host\.com/gems/path/\fR \-> \fBhttps://user_name:password@some\.host\.com/gems/path\fR
99
- .IP "\(bu" 4
100
98
  \fBallow_offline_install\fR (\fBBUNDLE_ALLOW_OFFLINE_INSTALL\fR): Allow Bundler to use cached data when installing without network access\.
101
99
  .IP "\(bu" 4
102
100
  \fBauto_clean_without_path\fR (\fBBUNDLE_AUTO_CLEAN_WITHOUT_PATH\fR): Automatically run \fBbundle clean\fR after installing when an explicit \fBpath\fR has not been set and Bundler is not installing into the system gems\.
@@ -137,9 +137,6 @@ the environment variable `BUNDLE_LOCAL__RACK`.
137
137
  The following is a list of all configuration keys and their purpose. You can
138
138
  learn more about their operation in [bundle install(1)](bundle-install.1.html).
139
139
 
140
- * `allow_deployment_source_credential_changes` (`BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES`):
141
- When in deployment mode, allow changing the credentials to a gem's source.
142
- Ex: `https://some.host.com/gems/path/` -> `https://user_name:password@some.host.com/gems/path`
143
140
  * `allow_offline_install` (`BUNDLE_ALLOW_OFFLINE_INSTALL`):
144
141
  Allow Bundler to use cached data when installing without network access.
145
142
  * `auto_clean_without_path` (`BUNDLE_AUTO_CLEAN_WITHOUT_PATH`):
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONSOLE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-CONSOLE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-DOCTOR" "1" "March 2024" ""
3
+ .TH "BUNDLE\-DOCTOR" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-EXEC" "1" "March 2024" ""
3
+ .TH "BUNDLE\-EXEC" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-GEM" "1" "March 2024" ""
3
+ .TH "BUNDLE\-GEM" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-HELP" "1" "March 2024" ""
3
+ .TH "BUNDLE\-HELP" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INFO" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INFO" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INIT" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INIT" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INJECT" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INJECT" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INSTALL" "1" "March 2024" ""
3
+ .TH "BUNDLE\-INSTALL" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-LIST" "1" "March 2024" ""
3
+ .TH "BUNDLE\-LIST" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-list\fR \- List all the gems in the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-LOCK" "1" "March 2024" ""
3
+ .TH "BUNDLE\-LOCK" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-OPEN" "1" "March 2024" ""
3
+ .TH "BUNDLE\-OPEN" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-OUTDATED" "1" "March 2024" ""
3
+ .TH "BUNDLE\-OUTDATED" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PLATFORM" "1" "March 2024" ""
3
+ .TH "BUNDLE\-PLATFORM" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-platform\fR \- Displays platform compatibility information
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PLUGIN" "1" "March 2024" ""
3
+ .TH "BUNDLE\-PLUGIN" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-plugin\fR \- Manage Bundler plugins
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-PRISTINE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-PRISTINE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-REMOVE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-REMOVE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-SHOW" "1" "March 2024" ""
3
+ .TH "BUNDLE\-SHOW" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-UPDATE" "1" "March 2024" ""
3
+ .TH "BUNDLE\-UPDATE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-update\fR \- Update your gems to the latest available versions
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-VERSION" "1" "March 2024" ""
3
+ .TH "BUNDLE\-VERSION" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-version\fR \- Prints Bundler version information
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-VIZ" "1" "March 2024" ""
3
+ .TH "BUNDLE\-VIZ" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE" "1" "March 2024" ""
3
+ .TH "BUNDLE" "1" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\fR \- Ruby Dependency Management
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "GEMFILE" "5" "March 2024" ""
3
+ .TH "GEMFILE" "5" "May 2024" ""
4
4
  .SH "NAME"
5
5
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
6
6
  .SH "SYNOPSIS"
@@ -1,11 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "pathname"
4
-
5
3
  require "rubygems" unless defined?(Gem)
6
4
 
7
- require "rubygems/specification"
8
-
9
5
  # We can't let `Gem::Source` be autoloaded in the `Gem::Specification#source`
10
6
  # redefinition below, so we need to load it upfront. The reason is that if
11
7
  # Bundler monkeypatches are loaded before RubyGems activates an executable (for
@@ -17,10 +13,6 @@ require "rubygems/specification"
17
13
  # `Gem::Source` from the redefined `Gem::Specification#source`.
18
14
  require "rubygems/source"
19
15
 
20
- require_relative "match_metadata"
21
- require_relative "force_platform"
22
- require_relative "match_platform"
23
-
24
16
  # Cherry-pick fixes to `Gem.ruby_version` to be useful for modern Bundler
25
17
  # versions and ignore patchlevels
26
18
  # (https://github.com/rubygems/rubygems/pull/5472,
@@ -31,7 +23,19 @@ unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
31
23
  end
32
24
 
33
25
  module Gem
26
+ # Can be removed once RubyGems 3.5.11 support is dropped
27
+ unless Gem.respond_to?(:freebsd_platform?)
28
+ def self.freebsd_platform?
29
+ RbConfig::CONFIG["host_os"].to_s.include?("bsd")
30
+ end
31
+ end
32
+
33
+ require "rubygems/specification"
34
+
34
35
  class Specification
36
+ require_relative "match_metadata"
37
+ require_relative "match_platform"
38
+
35
39
  include ::Bundler::MatchMetadata
36
40
  include ::Bundler::MatchPlatform
37
41
 
@@ -48,7 +52,7 @@ module Gem
48
52
 
49
53
  def full_gem_path
50
54
  if source.respond_to?(:root)
51
- Pathname.new(loaded_from).dirname.expand_path(source.root).to_s
55
+ File.expand_path(File.dirname(loaded_from), source.root)
52
56
  else
53
57
  rg_full_gem_path
54
58
  end
@@ -146,7 +150,23 @@ module Gem
146
150
  end
147
151
  end
148
152
 
153
+ module BetterPermissionError
154
+ def data
155
+ super
156
+ rescue Errno::EACCES
157
+ raise Bundler::PermissionError.new(loaded_from, :read)
158
+ end
159
+ end
160
+
161
+ require "rubygems/stub_specification"
162
+
163
+ class StubSpecification
164
+ prepend BetterPermissionError
165
+ end
166
+
149
167
  class Dependency
168
+ require_relative "force_platform"
169
+
150
170
  include ::Bundler::ForcePlatform
151
171
 
152
172
  attr_accessor :source, :groups
@@ -113,7 +113,7 @@ module Bundler
113
113
  end
114
114
 
115
115
  def local_specs
116
- @local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true, "allow_cached" => true).specs.select {|spec| spec.name == "bundler" }
116
+ @local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true).specs.select {|spec| spec.name == "bundler" }
117
117
  end
118
118
 
119
119
  def remote_specs
@@ -7,7 +7,6 @@ module Bundler
7
7
  autoload :Validator, File.expand_path("settings/validator", __dir__)
8
8
 
9
9
  BOOL_KEYS = %w[
10
- allow_deployment_source_credential_changes
11
10
  allow_offline_install
12
11
  auto_clean_without_path
13
12
  auto_install
data/lib/bundler/setup.rb CHANGED
@@ -5,6 +5,9 @@ require_relative "shared_helpers"
5
5
  if Bundler::SharedHelpers.in_bundle?
6
6
  require_relative "../bundler"
7
7
 
8
+ # try to auto_install first before we get to the `Bundler.ui.silence`, so user knows what is happening
9
+ Bundler.auto_install
10
+
8
11
  if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
9
12
  begin
10
13
  Bundler.ui.silence { Bundler.setup }
@@ -1,15 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "pathname"
4
- require "rbconfig"
5
-
6
3
  require_relative "version"
7
- require_relative "constants"
8
4
  require_relative "rubygems_integration"
9
5
  require_relative "current_ruby"
10
6
 
11
7
  module Bundler
8
+ autoload :WINDOWS, File.expand_path("constants", __dir__)
9
+ autoload :FREEBSD, File.expand_path("constants", __dir__)
10
+ autoload :NULL, File.expand_path("constants", __dir__)
11
+
12
12
  module SharedHelpers
13
+ autoload :Pathname, "pathname"
14
+
13
15
  def root
14
16
  gemfile = find_gemfile
15
17
  raise GemfileNotFound, "Could not locate Gemfile" unless gemfile
@@ -182,6 +182,14 @@ module Bundler
182
182
  if err.include?("Could not find remote branch")
183
183
  raise MissingGitRevisionError.new(command_with_no_credentials, nil, explicit_ref, credential_filtered_uri)
184
184
  else
185
+ idx = command.index("--depth")
186
+ if idx
187
+ command.delete_at(idx)
188
+ command.delete_at(idx)
189
+ command_with_no_credentials = check_allowed(command)
190
+
191
+ err += "Retrying without --depth argument."
192
+ end
185
193
  raise GitCommandError.new(command_with_no_credentials, path, err)
186
194
  end
187
195
  end
@@ -11,6 +11,8 @@ module Bundler
11
11
  end
12
12
 
13
13
  if local_spec = Gem.loaded_specs["bundler"]
14
+ raise CorruptBundlerInstallError.new(local_spec) if local_spec.version.to_s != Bundler::VERSION
15
+
14
16
  idx << local_spec
15
17
  else
16
18
  idx << Gem::Specification.new do |s|
@@ -10,14 +10,14 @@ module Bundler
10
10
  # Ask for X gems per API request
11
11
  API_REQUEST_SIZE = 50
12
12
 
13
- attr_reader :remotes
13
+ attr_accessor :remotes
14
14
 
15
15
  def initialize(options = {})
16
16
  @options = options
17
17
  @remotes = []
18
18
  @dependency_names = []
19
19
  @allow_remote = false
20
- @allow_cached = options["allow_cached"] || false
20
+ @allow_cached = false
21
21
  @allow_local = options["allow_local"] || false
22
22
  @checksum_store = Checksum::Store.new
23
23
 
@@ -50,10 +50,11 @@ module Bundler
50
50
  end
51
51
 
52
52
  def cached!
53
+ return unless File.exist?(cache_path)
54
+
53
55
  return if @allow_cached
54
56
 
55
57
  @specs = nil
56
- @allow_local = true
57
58
  @allow_cached = true
58
59
  end
59
60
 
@@ -96,7 +97,7 @@ module Bundler
96
97
  def to_lock
97
98
  out = String.new("GEM\n")
98
99
  remotes.reverse_each do |remote|
99
- out << " remote: #{suppress_configured_credentials remote}\n"
100
+ out << " remote: #{remove_auth remote}\n"
100
101
  end
101
102
  out << " specs:\n"
102
103
  end
@@ -312,11 +313,7 @@ module Bundler
312
313
  end
313
314
 
314
315
  def credless_remotes
315
- if Bundler.settings[:allow_deployment_source_credential_changes]
316
- remotes.map(&method(:remove_auth))
317
- else
318
- remotes.map(&method(:suppress_configured_credentials))
319
- end
316
+ remotes.map(&method(:remove_auth))
320
317
  end
321
318
 
322
319
  def remotes_for_spec(spec)
@@ -355,15 +352,6 @@ module Bundler
355
352
  uri
356
353
  end
357
354
 
358
- def suppress_configured_credentials(remote)
359
- remote_nouser = remove_auth(remote)
360
- if remote.userinfo && remote.userinfo == Bundler.settings[remote_nouser]
361
- remote_nouser
362
- else
363
- remote
364
- end
365
- end
366
-
367
355
  def remove_auth(remote)
368
356
  if remote.user || remote.password
369
357
  remote.dup.tap {|uri| uri.user = uri.password = nil }.to_s
@@ -9,7 +9,7 @@ module Bundler
9
9
  :metadata_source
10
10
 
11
11
  def global_rubygems_source
12
- @global_rubygems_source ||= rubygems_aggregate_class.new("allow_local" => true, "allow_cached" => true)
12
+ @global_rubygems_source ||= rubygems_aggregate_class.new("allow_local" => true)
13
13
  end
14
14
 
15
15
  def initialize
@@ -22,6 +22,7 @@ module Bundler
22
22
  @metadata_source = Source::Metadata.new
23
23
 
24
24
  @merged_gem_lockfile_sections = false
25
+ @local_mode = true
25
26
  end
26
27
 
27
28
  def merged_gem_lockfile_sections?
@@ -73,6 +74,10 @@ module Bundler
73
74
  global_rubygems_source
74
75
  end
75
76
 
77
+ def local_mode?
78
+ @local_mode
79
+ end
80
+
76
81
  def default_source
77
82
  global_path_source || global_rubygems_source
78
83
  end
@@ -140,11 +145,17 @@ module Bundler
140
145
  all_sources.each(&:local_only!)
141
146
  end
142
147
 
148
+ def local!
149
+ all_sources.each(&:local!)
150
+ end
151
+
143
152
  def cached!
144
153
  all_sources.each(&:cached!)
145
154
  end
146
155
 
147
156
  def remote!
157
+ @local_mode = false
158
+
148
159
  all_sources.each(&:remote!)
149
160
  end
150
161
 
@@ -157,7 +168,11 @@ module Bundler
157
168
  end
158
169
 
159
170
  def map_sources(replacement_sources)
160
- rubygems, git, plugin = [@rubygems_sources, @git_sources, @plugin_sources].map do |sources|
171
+ rubygems = @rubygems_sources.map do |source|
172
+ replace_rubygems_source(replacement_sources, source) || source
173
+ end
174
+
175
+ git, plugin = [@git_sources, @plugin_sources].map do |sources|
161
176
  sources.map do |source|
162
177
  replacement_sources.find {|s| s == source } || source
163
178
  end
@@ -171,10 +186,19 @@ module Bundler
171
186
  end
172
187
 
173
188
  def global_replacement_source(replacement_sources)
174
- replacement_source = replacement_sources.find {|s| s == global_rubygems_source }
189
+ replacement_source = replace_rubygems_source(replacement_sources, global_rubygems_source)
175
190
  return global_rubygems_source unless replacement_source
176
191
 
177
- replacement_source.cached!
192
+ replacement_source.local!
193
+ replacement_source
194
+ end
195
+
196
+ def replace_rubygems_source(replacement_sources, gemfile_source)
197
+ replacement_source = replacement_sources.find {|s| s == gemfile_source }
198
+ return unless replacement_source
199
+
200
+ # locked sources never include credentials so always prefer remotes from the gemfile
201
+ replacement_source.remotes = gemfile_source.remotes
178
202
  replacement_source
179
203
  end
180
204
 
@@ -65,7 +65,7 @@ module Bundler
65
65
 
66
66
  platforms.concat(new_platforms)
67
67
 
68
- less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform }
68
+ less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
69
69
  platforms.delete(Bundler.local_platform) if less_specific_platform
70
70
 
71
71
  platforms