rubygems-update 3.2.2 → 3.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/{History.txt → CHANGELOG.md} +482 -424
  3. data/Manifest.txt +30 -27
  4. data/Rakefile +11 -15
  5. data/bundler/CHANGELOG.md +67 -2
  6. data/bundler/bundler.gemspec +1 -1
  7. data/bundler/lib/bundler.rb +3 -7
  8. data/bundler/lib/bundler/build_metadata.rb +2 -2
  9. data/bundler/lib/bundler/cli.rb +2 -5
  10. data/bundler/lib/bundler/cli/cache.rb +1 -0
  11. data/bundler/lib/bundler/cli/gem.rb +2 -0
  12. data/bundler/lib/bundler/cli/update.rb +1 -1
  13. data/bundler/lib/bundler/compact_index_client/cache.rb +5 -13
  14. data/bundler/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  15. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -8
  16. data/bundler/lib/bundler/definition.rb +29 -21
  17. data/bundler/lib/bundler/dep_proxy.rb +15 -8
  18. data/bundler/lib/bundler/feature_flag.rb +0 -1
  19. data/bundler/lib/bundler/fetcher.rb +0 -1
  20. data/bundler/lib/bundler/gem_helper.rb +9 -7
  21. data/bundler/lib/bundler/gem_helpers.rb +30 -24
  22. data/bundler/lib/bundler/gem_version_promoter.rb +2 -2
  23. data/bundler/lib/bundler/installer.rb +0 -17
  24. data/bundler/lib/bundler/installer/standalone.rb +14 -0
  25. data/bundler/lib/bundler/lazy_specification.rb +10 -11
  26. data/bundler/{man → lib/bundler/man}/bundle-add.1 +1 -1
  27. data/bundler/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
  28. data/bundler/{man → lib/bundler/man}/bundle-cache.1 +1 -1
  29. data/bundler/{man → lib/bundler/man}/bundle-check.1 +1 -1
  30. data/bundler/{man → lib/bundler/man}/bundle-clean.1 +1 -1
  31. data/bundler/{man → lib/bundler/man}/bundle-config.1 +4 -4
  32. data/bundler/lib/bundler/man/bundle-config.1.ronn +3 -3
  33. data/bundler/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
  34. data/bundler/{man → lib/bundler/man}/bundle-exec.1 +1 -1
  35. data/bundler/{man → lib/bundler/man}/bundle-gem.1 +1 -1
  36. data/bundler/{man → lib/bundler/man}/bundle-info.1 +1 -1
  37. data/bundler/{man → lib/bundler/man}/bundle-init.1 +1 -1
  38. data/bundler/{man → lib/bundler/man}/bundle-inject.1 +1 -1
  39. data/bundler/{man → lib/bundler/man}/bundle-install.1 +1 -1
  40. data/bundler/{man → lib/bundler/man}/bundle-list.1 +1 -1
  41. data/bundler/{man → lib/bundler/man}/bundle-lock.1 +1 -1
  42. data/bundler/{man → lib/bundler/man}/bundle-open.1 +1 -1
  43. data/bundler/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
  44. data/bundler/{man → lib/bundler/man}/bundle-platform.1 +1 -1
  45. data/bundler/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
  46. data/bundler/{man → lib/bundler/man}/bundle-remove.1 +1 -1
  47. data/bundler/{man → lib/bundler/man}/bundle-show.1 +1 -1
  48. data/bundler/{man → lib/bundler/man}/bundle-update.1 +1 -1
  49. data/bundler/{man → lib/bundler/man}/bundle-viz.1 +1 -1
  50. data/bundler/{man → lib/bundler/man}/bundle.1 +1 -1
  51. data/bundler/{man → lib/bundler/man}/gemfile.5 +1 -1
  52. data/bundler/{man → lib/bundler/man}/index.txt +0 -0
  53. data/bundler/lib/bundler/resolver.rb +36 -16
  54. data/bundler/lib/bundler/resolver/spec_group.rb +18 -23
  55. data/bundler/lib/bundler/rubygems_ext.rb +16 -0
  56. data/bundler/lib/bundler/rubygems_integration.rb +0 -5
  57. data/bundler/lib/bundler/settings.rb +1 -1
  58. data/bundler/lib/bundler/source/git.rb +19 -17
  59. data/bundler/lib/bundler/source/git/git_proxy.rb +54 -49
  60. data/bundler/lib/bundler/source/path/installer.rb +2 -0
  61. data/bundler/lib/bundler/source/rubygems.rb +10 -2
  62. data/bundler/lib/bundler/spec_set.rb +6 -9
  63. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +1 -1
  64. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
  65. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
  66. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
  67. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
  68. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
  69. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
  70. data/bundler/lib/bundler/version.rb +1 -1
  71. data/lib/rubygems.rb +2 -2
  72. data/lib/rubygems/commands/setup_command.rb +16 -62
  73. data/lib/rubygems/dependency_installer.rb +1 -0
  74. data/lib/rubygems/ext/builder.rb +5 -4
  75. data/lib/rubygems/ext/cmake_builder.rb +1 -2
  76. data/lib/rubygems/ext/configure_builder.rb +1 -2
  77. data/lib/rubygems/gemcutter_utilities.rb +2 -2
  78. data/lib/rubygems/installer.rb +0 -23
  79. data/lib/rubygems/installer_uninstaller_utils.rb +6 -1
  80. data/lib/rubygems/platform.rb +0 -4
  81. data/lib/rubygems/remote_fetcher.rb +4 -2
  82. data/lib/rubygems/request_set.rb +2 -13
  83. data/lib/rubygems/requirement.rb +1 -1
  84. data/lib/rubygems/resolver.rb +6 -1
  85. data/lib/rubygems/resolver/api_set.rb +28 -19
  86. data/lib/rubygems/resolver/api_set/gem_parser.rb +20 -0
  87. data/lib/rubygems/resolver/api_specification.rb +4 -3
  88. data/lib/rubygems/resolver/best_set.rb +2 -2
  89. data/lib/rubygems/resolver/index_specification.rb +18 -0
  90. data/lib/rubygems/resolver/installer_set.rb +57 -7
  91. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/vertex.rb +1 -1
  92. data/lib/rubygems/resolver/molinillo/lib/molinillo/errors.rb +1 -1
  93. data/lib/rubygems/resolver/spec_specification.rb +14 -0
  94. data/lib/rubygems/resolver/specification.rb +12 -0
  95. data/lib/rubygems/source.rb +10 -6
  96. data/lib/rubygems/specification.rb +18 -14
  97. data/lib/rubygems/test_case.rb +17 -4
  98. data/rubygems-update.gemspec +2 -2
  99. data/test/rubygems/data/null-required-rubygems-version.gemspec.rz +0 -0
  100. data/test/rubygems/test_gem.rb +5 -0
  101. data/test/rubygems/test_gem_commands_install_command.rb +131 -0
  102. data/test/rubygems/test_gem_commands_setup_command.rb +21 -37
  103. data/test/rubygems/test_gem_dependency_installer.rb +27 -47
  104. data/test/rubygems/test_gem_ext_builder.rb +30 -6
  105. data/test/rubygems/test_gem_ext_cmake_builder.rb +2 -4
  106. data/test/rubygems/test_gem_ext_configure_builder.rb +2 -2
  107. data/test/rubygems/test_gem_installer.rb +8 -60
  108. data/test/rubygems/test_gem_platform.rb +8 -0
  109. data/test/rubygems/test_gem_remote_fetcher.rb +1 -1
  110. data/test/rubygems/test_gem_requirement.rb +34 -0
  111. data/test/rubygems/test_gem_resolver_api_set.rb +26 -52
  112. data/test/rubygems/test_gem_resolver_api_specification.rb +3 -3
  113. data/test/rubygems/test_gem_resolver_best_set.rb +26 -3
  114. data/test/rubygems/test_gem_source.rb +2 -2
  115. data/test/rubygems/test_gem_source_subpath_problem.rb +2 -2
  116. data/test/rubygems/test_gem_specification.rb +9 -3
  117. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  118. metadata +34 -55
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -136,9 +136,6 @@ Any periods in the configuration keys must be replaced with two underscores when
136
136
  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\.
137
137
  .
138
138
  .IP "\(bu" 4
139
- \fBallow_bundler_dependency_conflicts\fR (\fBBUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS\fR): Allow resolving to specifications that have dependencies on \fBbundler\fR that are incompatible with the running Bundler version\.
140
- .
141
- .IP "\(bu" 4
142
139
  \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
143
140
  .
144
141
  .IP "\(bu" 4
@@ -184,6 +181,9 @@ The following is a list of all configuration keys and their purpose\. You can le
184
181
  \fBdisable_local_branch_check\fR (\fBBUNDLE_DISABLE_LOCAL_BRANCH_CHECK\fR): Allow Bundler to use a local git override without a branch specified in the Gemfile\.
185
182
  .
186
183
  .IP "\(bu" 4
184
+ \fBdisable_local_revision_check\fR (\fBBUNDLE_DISABLE_LOCAL_REVISION_CHECK\fR): Allow Bundler to use a local git override without checking if the revision present in the lockfile is present in the repository\.
185
+ .
186
+ .IP "\(bu" 4
187
187
  \fBdisable_multisource\fR (\fBBUNDLE_DISABLE_MULTISOURCE\fR): When set, Gemfiles containing multiple sources will produce errors instead of warnings\. Use \fBbundle config unset disable_multisource\fR to unset\.
188
188
  .
189
189
  .IP "\(bu" 4
@@ -133,9 +133,6 @@ the environment variable `BUNDLE_LOCAL__RACK`.
133
133
  The following is a list of all configuration keys and their purpose. You can
134
134
  learn more about their operation in [bundle install(1)](bundle-install.1.html).
135
135
 
136
- * `allow_bundler_dependency_conflicts` (`BUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS`):
137
- Allow resolving to specifications that have dependencies on `bundler` that
138
- are incompatible with the running Bundler version.
139
136
  * `allow_deployment_source_credential_changes` (`BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES`):
140
137
  When in deployment mode, allow changing the credentials to a gem's source.
141
138
  Ex: `https://some.host.com/gems/path/` -> `https://user_name:password@some.host.com/gems/path`
@@ -178,6 +175,9 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
178
175
  * `disable_local_branch_check` (`BUNDLE_DISABLE_LOCAL_BRANCH_CHECK`):
179
176
  Allow Bundler to use a local git override without a branch specified in the
180
177
  Gemfile.
178
+ * `disable_local_revision_check` (`BUNDLE_DISABLE_LOCAL_REVISION_CHECK`):
179
+ Allow Bundler to use a local git override without checking if the revision
180
+ present in the lockfile is present in the repository.
181
181
  * `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
182
182
  When set, Gemfiles containing multiple sources will produce errors
183
183
  instead of warnings.
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "November 2020" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "November 2020" "" ""
4
+ .TH "BUNDLE" "1" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "November 2020" "" ""
4
+ .TH "GEMFILE" "5" "January 2021" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -32,12 +32,11 @@ module Bundler
32
32
  @base_dg = Molinillo::DependencyGraph.new
33
33
  @base.each do |ls|
34
34
  dep = Dependency.new(ls.name, ls.version)
35
- @base_dg.add_vertex(ls.name, DepProxy.new(dep, ls.platform), true)
35
+ @base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
36
36
  end
37
37
  additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
38
38
  @platforms = platforms
39
39
  @gem_version_promoter = gem_version_promoter
40
- @allow_bundler_dependency_conflicts = Bundler.feature_flag.allow_bundler_dependency_conflicts?
41
40
  @use_gvp = Bundler.feature_flag.use_gem_version_promoter_for_major_updates? || !@gem_version_promoter.major?
42
41
  @lockfile_uses_separate_rubygems_sources = Bundler.feature_flag.disable_multisource?
43
42
  end
@@ -75,7 +74,7 @@ module Bundler
75
74
  return unless debug?
76
75
  debug_info = yield
77
76
  debug_info = debug_info.inspect unless debug_info.is_a?(String)
78
- puts debug_info.split("\n").map {|s| "BUNDLER: " + " " * depth + s }
77
+ puts debug_info.split("\n").map {|s| depth == 0 ? "BUNDLER: #{s}" : "BUNDLER(#{depth}): #{s}" }
79
78
  end
80
79
 
81
80
  def debug?
@@ -138,7 +137,6 @@ module Bundler
138
137
  nested.reduce([]) do |groups, (version, specs)|
139
138
  next groups if locked_requirement && !locked_requirement.satisfied_by?(version)
140
139
  spec_group = SpecGroup.new(specs)
141
- spec_group.ignores_bundler_dependencies = @allow_bundler_dependency_conflicts
142
140
  groups << spec_group
143
141
  end
144
142
  else
@@ -163,7 +161,9 @@ module Bundler
163
161
  # Add a spec group for "non platform specific spec" as the fallback
164
162
  # spec group.
165
163
  sg_ruby = sg.copy_for([Gem::Platform::RUBY])
166
- selected_sgs.insert(-2, sg_ruby) if sg_ruby
164
+ next unless sg_ruby
165
+
166
+ selected_sgs.insert(-2, sg_ruby)
167
167
  end
168
168
  selected_sgs
169
169
  end
@@ -206,6 +206,10 @@ module Bundler
206
206
  requirement.matches_spec?(spec) || spec.source.is_a?(Source::Gemspec)
207
207
  end
208
208
 
209
+ def dependencies_equal?(dependencies, other_dependencies)
210
+ dependencies.map(&:dep) == other_dependencies.map(&:dep)
211
+ end
212
+
209
213
  def relevant_sources_for_vertex(vertex)
210
214
  if vertex.root?
211
215
  [@source_requirements[vertex.name]]
@@ -324,10 +328,16 @@ module Bundler
324
328
  def version_conflict_message(e)
325
329
  # only show essential conflicts, if possible
326
330
  conflicts = e.conflicts.dup
327
- conflicts.delete_if do |_name, conflict|
328
- deps = conflict.requirement_trees.map(&:last).flatten(1)
329
- !Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
331
+
332
+ if conflicts["bundler"]
333
+ conflicts.replace("bundler" => conflicts["bundler"])
334
+ else
335
+ conflicts.delete_if do |_name, conflict|
336
+ deps = conflict.requirement_trees.map(&:last).flatten(1)
337
+ !Bundler::VersionRanges.empty?(*Bundler::VersionRanges.for_many(deps.map(&:requirement)))
338
+ end
330
339
  end
340
+
331
341
  e = Molinillo::VersionConflict.new(conflicts, e.specification_provider) unless conflicts.empty?
332
342
 
333
343
  solver_name = "Bundler"
@@ -355,15 +365,25 @@ module Bundler
355
365
  :additional_message_for_conflict => lambda do |o, name, conflict|
356
366
  if name == "bundler"
357
367
  o << %(\n Current Bundler version:\n bundler (#{Bundler::VERSION}))
358
- other_bundler_required = !conflict.requirement.requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
359
- end
360
368
 
361
- if name == "bundler" && other_bundler_required
362
- o << "\n"
363
- o << "This Gemfile requires a different version of Bundler.\n"
364
- o << "Perhaps you need to update Bundler by running `gem install bundler`?\n"
365
- end
366
- if conflict.locked_requirement
369
+ conflict_dependency = conflict.requirement
370
+ conflict_requirement = conflict_dependency.requirement
371
+ other_bundler_required = !conflict_requirement.satisfied_by?(Gem::Version.new(Bundler::VERSION))
372
+
373
+ if other_bundler_required
374
+ o << "\n\n"
375
+
376
+ candidate_specs = @source_requirements[:default_bundler].specs.search(conflict_dependency)
377
+ if candidate_specs.any?
378
+ target_version = candidate_specs.last.version
379
+ new_command = [File.basename($PROGRAM_NAME), "_#{target_version}_", *ARGV].join(" ")
380
+ o << "Your bundle requires a different version of Bundler than the one you're running.\n"
381
+ o << "Install the necessary version with `gem install bundler:#{target_version}` and rerun bundler using `#{new_command}`\n"
382
+ else
383
+ o << "Your bundle requires a different version of Bundler than the one you're running, and that version could not be found.\n"
384
+ end
385
+ end
386
+ elsif conflict.locked_requirement
367
387
  o << "\n"
368
388
  o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n)
369
389
  o << %(the gems in your Gemfile, which may resolve the conflict.\n)
@@ -6,7 +6,7 @@ module Bundler
6
6
  include GemHelpers
7
7
 
8
8
  attr_accessor :name, :version, :source
9
- attr_accessor :ignores_bundler_dependencies, :activated_platforms
9
+ attr_accessor :activated_platforms
10
10
 
11
11
  def initialize(all_specs)
12
12
  @all_specs = all_specs
@@ -20,16 +20,19 @@ module Bundler
20
20
  @specs = Hash.new do |specs, platform|
21
21
  specs[platform] = select_best_platform_match(all_specs, platform)
22
22
  end
23
- @ignores_bundler_dependencies = true
24
23
  end
25
24
 
26
25
  def to_specs
27
26
  @activated_platforms.map do |p|
28
- next unless s = @specs[p]
29
- lazy_spec = LazySpecification.new(name, version, s.platform, source)
30
- lazy_spec.dependencies.replace s.dependencies
31
- lazy_spec
32
- end.compact.uniq
27
+ specs = @specs[p]
28
+ next unless specs.any?
29
+
30
+ specs.map do |s|
31
+ lazy_spec = LazySpecification.new(name, version, s.platform, source)
32
+ lazy_spec.dependencies.replace s.dependencies
33
+ lazy_spec
34
+ end
35
+ end.flatten.compact.uniq
33
36
  end
34
37
 
35
38
  def copy_for(platforms)
@@ -37,17 +40,12 @@ module Bundler
37
40
  return unless platforms.any?
38
41
 
39
42
  copied_sg = self.class.new(@all_specs)
40
- copied_sg.ignores_bundler_dependencies = @ignores_bundler_dependencies
41
43
  copied_sg.activated_platforms = platforms
42
44
  copied_sg
43
45
  end
44
46
 
45
- def spec_for(platform)
46
- @specs[platform]
47
- end
48
-
49
47
  def for?(platform)
50
- !spec_for(platform).nil?
48
+ @specs[platform].any?
51
49
  end
52
50
 
53
51
  def to_s
@@ -58,7 +56,7 @@ module Bundler
58
56
  def dependencies_for_activated_platforms
59
57
  dependencies = @activated_platforms.map {|p| __dependencies[p] }
60
58
  metadata_dependencies = @activated_platforms.map do |platform|
61
- metadata_dependencies(@specs[platform], platform)
59
+ metadata_dependencies(@specs[platform].first, platform)
62
60
  end
63
61
  dependencies.concat(metadata_dependencies).flatten
64
62
  end
@@ -94,11 +92,11 @@ module Bundler
94
92
  def __dependencies
95
93
  @dependencies = Hash.new do |dependencies, platform|
96
94
  dependencies[platform] = []
97
- if spec = @specs[platform]
95
+ specs = @specs[platform]
96
+ if spec = specs.first
98
97
  spec.dependencies.each do |dep|
99
98
  next if dep.type == :development
100
- next if @ignores_bundler_dependencies && dep.name == "bundler".freeze
101
- dependencies[platform] << DepProxy.new(dep, platform)
99
+ dependencies[platform] << DepProxy.get_proxy(dep, platform)
102
100
  end
103
101
  end
104
102
  dependencies[platform]
@@ -106,16 +104,13 @@ module Bundler
106
104
  end
107
105
 
108
106
  def metadata_dependencies(spec, platform)
109
- return [] unless spec
110
- # Only allow endpoint specifications since they won't hit the network to
111
- # fetch the full gemspec when calling required_ruby_version
112
- return [] if !spec.is_a?(EndpointSpecification) && !spec.is_a?(Gem::Specification)
107
+ return [] unless spec && spec.is_a?(Gem::Specification)
113
108
  dependencies = []
114
109
  if !spec.required_ruby_version.nil? && !spec.required_ruby_version.none?
115
- dependencies << DepProxy.new(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
110
+ dependencies << DepProxy.get_proxy(Gem::Dependency.new("Ruby\0", spec.required_ruby_version), platform)
116
111
  end
117
112
  if !spec.required_rubygems_version.nil? && !spec.required_rubygems_version.none?
118
- dependencies << DepProxy.new(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
113
+ dependencies << DepProxy.get_proxy(Gem::Dependency.new("RubyGems\0", spec.required_rubygems_version), platform)
119
114
  end
120
115
  dependencies
121
116
  end
@@ -158,6 +158,22 @@ module Gem
158
158
  end
159
159
  end
160
160
 
161
+ if Gem::Requirement.new("~> 2.0").hash == Gem::Requirement.new("~> 2.0.0").hash
162
+ class Requirement
163
+ module CorrectHashForLambdaOperator
164
+ def hash
165
+ if requirements.any? {|r| r.first == "~>" }
166
+ requirements.map {|r| r.first == "~>" ? [r[0], r[1].to_s] : r }.sort.hash
167
+ else
168
+ super
169
+ end
170
+ end
171
+ end
172
+
173
+ prepend CorrectHashForLambdaOperator
174
+ end
175
+ end
176
+
161
177
  class Platform
162
178
  JAVA = Gem::Platform.new("java") unless defined?(JAVA)
163
179
  MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)