bundler 2.2.11 → 2.3.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +721 -5
  3. data/README.md +1 -1
  4. data/bundler.gemspec +8 -11
  5. data/exe/bundle +7 -8
  6. data/exe/bundler +1 -1
  7. data/lib/bundler/.document +1 -0
  8. data/lib/bundler/build_metadata.rb +3 -3
  9. data/lib/bundler/cli/cache.rb +1 -1
  10. data/lib/bundler/cli/check.rb +4 -2
  11. data/lib/bundler/cli/common.rb +17 -3
  12. data/lib/bundler/cli/config.rb +10 -1
  13. data/lib/bundler/cli/doctor.rb +24 -5
  14. data/lib/bundler/cli/exec.rb +1 -6
  15. data/lib/bundler/cli/gem.rb +130 -26
  16. data/lib/bundler/cli/info.rb +27 -6
  17. data/lib/bundler/cli/init.rb +5 -1
  18. data/lib/bundler/cli/install.rb +23 -54
  19. data/lib/bundler/cli/issue.rb +4 -3
  20. data/lib/bundler/cli/list.rb +7 -1
  21. data/lib/bundler/cli/lock.rb +5 -1
  22. data/lib/bundler/cli/open.rb +1 -2
  23. data/lib/bundler/cli/outdated.rb +22 -14
  24. data/lib/bundler/cli/platform.rb +2 -2
  25. data/lib/bundler/cli/remove.rb +1 -2
  26. data/lib/bundler/cli/show.rb +1 -1
  27. data/lib/bundler/cli/update.rb +17 -8
  28. data/lib/bundler/cli.rb +51 -63
  29. data/lib/bundler/compact_index_client/cache.rb +0 -9
  30. data/lib/bundler/compact_index_client/updater.rb +26 -14
  31. data/lib/bundler/compact_index_client.rb +2 -8
  32. data/lib/bundler/current_ruby.rb +17 -6
  33. data/lib/bundler/definition.rb +260 -362
  34. data/lib/bundler/dependency.rb +23 -71
  35. data/lib/bundler/digest.rb +71 -0
  36. data/lib/bundler/dsl.rb +72 -76
  37. data/lib/bundler/endpoint_specification.rb +19 -13
  38. data/lib/bundler/env.rb +1 -1
  39. data/lib/bundler/environment_preserver.rb +4 -1
  40. data/lib/bundler/errors.rb +29 -3
  41. data/lib/bundler/feature_flag.rb +0 -5
  42. data/lib/bundler/fetcher/base.rb +6 -8
  43. data/lib/bundler/fetcher/compact_index.rb +10 -15
  44. data/lib/bundler/fetcher/downloader.rb +9 -6
  45. data/lib/bundler/fetcher/index.rb +0 -27
  46. data/lib/bundler/fetcher.rb +22 -23
  47. data/lib/bundler/friendly_errors.rb +26 -36
  48. data/lib/bundler/gem_helper.rb +21 -16
  49. data/lib/bundler/gem_helpers.rb +9 -2
  50. data/lib/bundler/gem_version_promoter.rb +14 -25
  51. data/lib/bundler/index.rb +11 -46
  52. data/lib/bundler/injector.rb +18 -4
  53. data/lib/bundler/inline.rb +4 -13
  54. data/lib/bundler/installer/gem_installer.rb +16 -21
  55. data/lib/bundler/installer/parallel_installer.rb +36 -15
  56. data/lib/bundler/installer/standalone.rb +42 -10
  57. data/lib/bundler/installer.rb +25 -41
  58. data/lib/bundler/lazy_specification.rb +52 -30
  59. data/lib/bundler/lockfile_generator.rb +2 -2
  60. data/lib/bundler/lockfile_parser.rb +18 -43
  61. data/lib/bundler/man/bundle-add.1 +21 -5
  62. data/lib/bundler/man/bundle-add.1.ronn +16 -4
  63. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  64. data/lib/bundler/man/bundle-cache.1 +7 -1
  65. data/lib/bundler/man/bundle-cache.1.ronn +7 -0
  66. data/lib/bundler/man/bundle-check.1 +1 -1
  67. data/lib/bundler/man/bundle-clean.1 +2 -2
  68. data/lib/bundler/man/bundle-clean.1.ronn +1 -1
  69. data/lib/bundler/man/bundle-config.1 +49 -22
  70. data/lib/bundler/man/bundle-config.1.ronn +49 -30
  71. data/lib/bundler/man/bundle-console.1 +53 -0
  72. data/lib/bundler/man/bundle-console.1.ronn +44 -0
  73. data/lib/bundler/man/bundle-doctor.1 +1 -1
  74. data/lib/bundler/man/bundle-exec.1 +2 -2
  75. data/lib/bundler/man/bundle-exec.1.ronn +1 -1
  76. data/lib/bundler/man/bundle-gem.1 +14 -1
  77. data/lib/bundler/man/bundle-gem.1.ronn +16 -0
  78. data/lib/bundler/man/bundle-help.1 +13 -0
  79. data/lib/bundler/man/bundle-help.1.ronn +12 -0
  80. data/lib/bundler/man/bundle-info.1 +1 -1
  81. data/lib/bundler/man/bundle-init.1 +1 -1
  82. data/lib/bundler/man/bundle-inject.1 +5 -2
  83. data/lib/bundler/man/bundle-inject.1.ronn +3 -1
  84. data/lib/bundler/man/bundle-install.1 +6 -2
  85. data/lib/bundler/man/bundle-install.1.ronn +8 -2
  86. data/lib/bundler/man/bundle-list.1 +1 -1
  87. data/lib/bundler/man/bundle-lock.1 +1 -1
  88. data/lib/bundler/man/bundle-open.1 +1 -1
  89. data/lib/bundler/man/bundle-outdated.1 +3 -10
  90. data/lib/bundler/man/bundle-outdated.1.ronn +1 -10
  91. data/lib/bundler/man/bundle-platform.1 +16 -6
  92. data/lib/bundler/man/bundle-platform.1.ronn +14 -7
  93. data/lib/bundler/man/bundle-plugin.1 +81 -0
  94. data/lib/bundler/man/bundle-plugin.1.ronn +59 -0
  95. data/lib/bundler/man/bundle-pristine.1 +1 -1
  96. data/lib/bundler/man/bundle-remove.1 +1 -1
  97. data/lib/bundler/man/bundle-show.1 +1 -1
  98. data/lib/bundler/man/bundle-update.1 +5 -5
  99. data/lib/bundler/man/bundle-update.1.ronn +5 -4
  100. data/lib/bundler/man/bundle-version.1 +35 -0
  101. data/lib/bundler/man/bundle-version.1.ronn +24 -0
  102. data/lib/bundler/man/bundle-viz.1 +4 -1
  103. data/lib/bundler/man/bundle-viz.1.ronn +2 -0
  104. data/lib/bundler/man/bundle.1 +15 -10
  105. data/lib/bundler/man/bundle.1.ronn +12 -7
  106. data/lib/bundler/man/gemfile.5 +117 -80
  107. data/lib/bundler/man/gemfile.5.ronn +105 -84
  108. data/lib/bundler/man/index.txt +4 -0
  109. data/lib/bundler/match_metadata.rb +13 -0
  110. data/lib/bundler/match_platform.rb +0 -1
  111. data/lib/bundler/match_remote_metadata.rb +29 -0
  112. data/lib/bundler/plugin/api/source.rb +24 -8
  113. data/lib/bundler/plugin/index.rb +4 -1
  114. data/lib/bundler/plugin/installer/git.rb +0 -4
  115. data/lib/bundler/plugin/installer/rubygems.rb +0 -4
  116. data/lib/bundler/plugin/installer.rb +10 -10
  117. data/lib/bundler/plugin/source_list.rb +4 -0
  118. data/lib/bundler/plugin.rb +30 -8
  119. data/lib/bundler/process_lock.rb +1 -1
  120. data/lib/bundler/remote_specification.rb +10 -4
  121. data/lib/bundler/resolver/base.rb +50 -0
  122. data/lib/bundler/resolver/spec_group.rb +31 -73
  123. data/lib/bundler/resolver.rb +193 -292
  124. data/lib/bundler/retry.rb +1 -1
  125. data/lib/bundler/ruby_dsl.rb +1 -1
  126. data/lib/bundler/ruby_version.rb +5 -18
  127. data/lib/bundler/rubygems_ext.rb +160 -26
  128. data/lib/bundler/rubygems_gem_installer.rb +86 -9
  129. data/lib/bundler/rubygems_integration.rb +46 -93
  130. data/lib/bundler/runtime.rb +18 -12
  131. data/lib/bundler/self_manager.rb +168 -0
  132. data/lib/bundler/settings.rb +98 -22
  133. data/lib/bundler/setup.rb +2 -2
  134. data/lib/bundler/shared_helpers.rb +15 -31
  135. data/lib/bundler/source/git/git_proxy.rb +8 -6
  136. data/lib/bundler/source/git.rb +29 -13
  137. data/lib/bundler/source/metadata.rb +3 -7
  138. data/lib/bundler/source/path/installer.rb +1 -1
  139. data/lib/bundler/source/path.rb +3 -1
  140. data/lib/bundler/source/rubygems.rb +199 -182
  141. data/lib/bundler/source/rubygems_aggregate.rb +68 -0
  142. data/lib/bundler/source.rb +24 -4
  143. data/lib/bundler/source_list.rb +104 -60
  144. data/lib/bundler/source_map.rb +71 -0
  145. data/lib/bundler/spec_set.rb +58 -52
  146. data/lib/bundler/stub_specification.rb +13 -3
  147. data/lib/bundler/templates/Executable +2 -4
  148. data/lib/bundler/templates/Executable.bundler +8 -8
  149. data/lib/bundler/templates/Executable.standalone +2 -4
  150. data/lib/bundler/templates/Gemfile +0 -2
  151. data/lib/bundler/templates/gems.rb +0 -3
  152. data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  153. data/lib/bundler/templates/newgem/README.md.tt +8 -12
  154. data/lib/bundler/templates/newgem/Rakefile.tt +15 -2
  155. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +16 -7
  156. data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +5 -4
  157. data/lib/bundler/templates/newgem/newgem.gemspec.tt +19 -17
  158. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  159. data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  160. data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
  161. data/lib/bundler/ui/shell.rb +1 -1
  162. data/lib/bundler/vendor/.document +1 -0
  163. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  164. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  165. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  166. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  167. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
  168. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  169. data/lib/bundler/vendor/molinillo/LICENSE +9 -0
  170. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -3
  171. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +32 -26
  172. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  173. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -1
  174. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  175. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  176. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
  177. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
  178. data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
  179. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
  180. data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
  181. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
  182. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
  183. data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  184. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  185. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  186. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +1 -1
  187. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  188. data/lib/bundler/vendor/tsort/lib/tsort.rb +452 -0
  189. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  190. data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
  191. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
  192. data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
  193. data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
  194. data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
  195. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  196. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
  197. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
  198. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
  199. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  200. data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
  201. data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
  202. data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
  203. data/lib/bundler/vendored_tsort.rb +4 -0
  204. data/lib/bundler/version.rb +1 -1
  205. data/lib/bundler/worker.rb +19 -4
  206. data/lib/bundler.rb +46 -39
  207. metadata +39 -12
  208. data/lib/bundler/dep_proxy.rb +0 -55
  209. data/lib/bundler/gemdeps.rb +0 -29
  210. data/lib/bundler/psyched_yaml.rb +0 -22
  211. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
@@ -15,23 +15,28 @@ directory as the `Rakefile`.
15
15
  A `Gemfile` is evaluated as Ruby code, in a context which makes available
16
16
  a number of methods used to describe the gem requirements.
17
17
 
18
- ## GLOBAL SOURCES
18
+ ## GLOBAL SOURCE
19
19
 
20
- At the top of the `Gemfile`, add a line for the `Rubygems` source that contains
21
- the gems listed in the `Gemfile`.
20
+ At the top of the `Gemfile`, add a single line for the `RubyGems` source that
21
+ contains the gems listed in the `Gemfile`.
22
22
 
23
23
  source "https://rubygems.org"
24
24
 
25
- It is possible, but not recommended as of Bundler 1.7, to add multiple global
26
- `source` lines. Each of these `source`s `MUST` be a valid Rubygems repository.
25
+ You can add only one global source. In Bundler 1.13, adding multiple global
26
+ sources was deprecated. The `source` `MUST` be a valid RubyGems repository.
27
27
 
28
- Sources are checked for gems following the heuristics described in
29
- [SOURCE PRIORITY][]. If a gem is found in more than one global source, Bundler
28
+ To use more than one source of RubyGems, you should use [`source` block
29
+ ](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
30
+
31
+ A source is checked for gems following the heuristics described in
32
+ [SOURCE PRIORITY][].
33
+
34
+ **Note about a behavior of the feature deprecated in Bundler 1.13**:
35
+ If a gem is found in more than one global source, Bundler
30
36
  will print a warning after installing the gem indicating which source was used,
31
37
  and listing the other sources where the gem is available. A specific source can
32
38
  be selected for gems that need to use a non-standard repository, suppressing
33
- this warning, by using the [`:source` option](#SOURCE) or a
34
- [`source` block](#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS).
39
+ this warning, by using the [`:source` option](#SOURCE) or `source` block.
35
40
 
36
41
  ### CREDENTIALS
37
42
 
@@ -59,10 +64,10 @@ All parameters are `OPTIONAL` unless otherwise specified.
59
64
  ### VERSION (required)
60
65
 
61
66
  The version of Ruby that your application requires. If your application
62
- requires an alternate Ruby engine, such as JRuby, Rubinius or TruffleRuby, this
67
+ requires an alternate Ruby engine, such as JRuby, TruffleRuby, etc., this
63
68
  should be the Ruby version that the engine is compatible with.
64
69
 
65
- ruby "1.9.3"
70
+ ruby "3.1.2"
66
71
 
67
72
  ### ENGINE
68
73
 
@@ -81,9 +86,10 @@ What exactly is an Engine?
81
86
 
82
87
  - [Other implementations](https://www.ruby-lang.org/en/about/) of Ruby exist.
83
88
  Some of the more well-known implementations include
84
- [Rubinius](https://rubinius.com/), and [JRuby](http://jruby.org/).
89
+ [JRuby](http://jruby.org/) and [TruffleRuby](https://www.graalvm.org/ruby/).
85
90
  Rubinius is an alternative implementation of Ruby written in Ruby.
86
91
  JRuby is an implementation of Ruby on the JVM, short for Java Virtual Machine.
92
+ TruffleRuby is a Ruby implementation on the GraalVM, a language toolkit built on the JVM.
87
93
 
88
94
  ### ENGINE VERSION
89
95
 
@@ -91,13 +97,17 @@ Each application _may_ specify a Ruby engine version. If an engine version is
91
97
  specified, an engine _must_ also be specified. If the engine is "ruby" the
92
98
  engine version specified _must_ match the Ruby version.
93
99
 
94
- ruby "1.8.7", :engine => "jruby", :engine_version => "1.6.7"
100
+ ruby "2.6.8", engine: "jruby", engine_version: "9.3.8.0"
95
101
 
96
102
  ### PATCHLEVEL
97
103
 
98
- Each application _may_ specify a Ruby patchlevel.
104
+ Each application _may_ specify a Ruby patchlevel. Specifying the patchlevel has
105
+ been meaningless since Ruby 2.1.0 was released as the patchlevel is now
106
+ uniquely determined by a combination of major, minor, and teeny version numbers.
107
+
108
+ This option was implemented in Bundler 1.4.0 for Ruby 2.0 or earlier.
99
109
 
100
- ruby "2.0.0", :patchlevel => "247"
110
+ ruby "3.1.2", patchlevel: "20"
101
111
 
102
112
  ## GEMS
103
113
 
@@ -124,23 +134,23 @@ Each _gem_ `MAY` specify files that should be used when autorequiring via
124
134
  you want `required` has the same name as _gem_ or `false` to
125
135
  prevent any file from being autorequired.
126
136
 
127
- gem "redis", :require => ["redis/connection/hiredis", "redis"]
128
- gem "webmock", :require => false
129
- gem "byebug", :require => true
137
+ gem "redis", require: ["redis/connection/hiredis", "redis"]
138
+ gem "webmock", require: false
139
+ gem "byebug", require: true
130
140
 
131
141
  The argument defaults to the name of the gem. For example, these are identical:
132
142
 
133
143
  gem "nokogiri"
134
- gem "nokogiri", :require => "nokogiri"
135
- gem "nokogiri", :require => true
144
+ gem "nokogiri", require: "nokogiri"
145
+ gem "nokogiri", require: true
136
146
 
137
147
  ### GROUPS
138
148
 
139
149
  Each _gem_ `MAY` specify membership in one or more groups. Any _gem_ that does
140
150
  not specify membership in any group is placed in the `default` group.
141
151
 
142
- gem "rspec", :group => :test
143
- gem "wirble", :groups => [:development, :test]
152
+ gem "rspec", group: :test
153
+ gem "wirble", groups: [:development, :test]
144
154
 
145
155
  The Bundler runtime allows its two main methods, `Bundler.setup` and
146
156
  `Bundler.require`, to limit their impact to particular groups.
@@ -185,70 +195,71 @@ platforms.
185
195
  There are a number of `Gemfile` platforms:
186
196
 
187
197
  * `ruby`:
188
- C Ruby (MRI), Rubinius or TruffleRuby, but `NOT` Windows
198
+ C Ruby (MRI), Rubinius, or TruffleRuby, but not Windows
189
199
  * `mri`:
190
- Same as _ruby_, but only C Ruby (MRI)
191
- * `mingw`:
192
- Windows 32 bit 'mingw32' platform (aka RubyInstaller)
193
- * `x64_mingw`:
194
- Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
200
+ C Ruby (MRI) only, but not Windows
201
+ * `windows`:
202
+ Windows C Ruby (MRI), including RubyInstaller 32-bit and 64-bit versions
203
+ * `mswin`:
204
+ Windows C Ruby (MRI), including RubyInstaller 32-bit versions
205
+ * `mswin64`:
206
+ Windows C Ruby (MRI), including RubyInstaller 64-bit versions
195
207
  * `rbx`:
196
208
  Rubinius
197
209
  * `jruby`:
198
210
  JRuby
199
211
  * `truffleruby`:
200
212
  TruffleRuby
201
- * `mswin`:
202
- Windows
203
213
 
204
- You can restrict further by platform and version for all platforms *except* for
205
- `rbx`, `jruby`, `truffleruby` and `mswin`.
214
+ On platforms `ruby`, `mri`, `mswin`, `mswin64`, and `windows`, you may
215
+ additionally specify a version by appending the major and minor version numbers
216
+ without a delimiter. For example, to specify that a gem should only be used on
217
+ platform `ruby` version 3.1, use:
206
218
 
207
- To specify a version in addition to a platform, append the version number without
208
- the delimiter to the platform. For example, to specify that a gem should only be
209
- used on platforms with Ruby 2.3, use:
210
-
211
- ruby_23
212
-
213
- The full list of platforms and supported versions includes:
214
-
215
- * `ruby`:
216
- 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
217
- * `mri`:
218
- 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
219
- * `mingw`:
220
- 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
221
- * `x64_mingw`:
222
- 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
219
+ ruby_31
223
220
 
224
- As with groups, you can specify one or more platforms:
221
+ As with groups (above), you may specify one or more platforms:
225
222
 
226
- gem "weakling", :platforms => :jruby
227
- gem "ruby-debug", :platforms => :mri_18
228
- gem "nokogiri", :platforms => [:mri_18, :jruby]
223
+ gem "weakling", platforms: :jruby
224
+ gem "ruby-debug", platforms: :mri_31
225
+ gem "nokogiri", platforms: [:windows_31, :jruby]
229
226
 
230
227
  All operations involving groups ([`bundle install`](bundle-install.1.html), `Bundler.setup`,
231
228
  `Bundler.require`) behave exactly the same as if any groups not
232
229
  matching the current platform were explicitly excluded.
233
230
 
231
+ ### FORCE_RUBY_PLATFORM
232
+
233
+ If you always want the pure ruby variant of a gem to be chosen over platform
234
+ specific variants, you can use the `force_ruby_platform` option:
235
+
236
+ gem "ffi", force_ruby_platform: true
237
+
238
+ This can be handy (assuming the pure ruby variant works fine) when:
239
+
240
+ * You're having issues with the platform specific variant.
241
+ * The platform specific variant does not yet support a newer ruby (and thus has
242
+ a `required_ruby_version` upper bound), but you still want your Gemfile{.lock}
243
+ files to resolve under that ruby.
244
+
234
245
  ### SOURCE
235
246
 
236
- You can select an alternate Rubygems repository for a gem using the ':source'
247
+ You can select an alternate RubyGems repository for a gem using the ':source'
237
248
  option.
238
249
 
239
- gem "some_internal_gem", :source => "https://gems.example.com"
250
+ gem "some_internal_gem", source: "https://gems.example.com"
240
251
 
241
- This forces the gem to be loaded from this source and ignores any global sources
252
+ This forces the gem to be loaded from this source and ignores the global source
242
253
  declared at the top level of the file. If the gem does not exist in this source,
243
254
  it will not be installed.
244
255
 
245
256
  Bundler will search for child dependencies of this gem by first looking in the
246
257
  source selected for the parent, but if they are not found there, it will fall
247
- back on global sources using the ordering described in [SOURCE PRIORITY][].
258
+ back on the global source.
248
259
 
260
+ **Note about a behavior of the feature deprecated in Bundler 1.13**:
249
261
  Selecting a specific source repository this way also suppresses the ambiguous
250
- gem warning described above in
251
- [GLOBAL SOURCES (#source)](#GLOBAL-SOURCES).
262
+ gem warning described above in [GLOBAL SOURCE](#GLOBAL-SOURCE).
252
263
 
253
264
  Using the `:source` option for an individual gem will also make that source
254
265
  available as a possible global source for any other gems which do not specify
@@ -263,11 +274,11 @@ git repository using the `:git` parameter. The repository can be accessed via
263
274
  several protocols:
264
275
 
265
276
  * `HTTP(S)`:
266
- gem "rails", :git => "https://github.com/rails/rails.git"
277
+ gem "rails", git: "https://github.com/rails/rails.git"
267
278
  * `SSH`:
268
- gem "rails", :git => "git@github.com:rails/rails.git"
279
+ gem "rails", git: "git@github.com:rails/rails.git"
269
280
  * `git`:
270
- gem "rails", :git => "git://github.com/rails/rails.git"
281
+ gem "rails", git: "git://github.com/rails/rails.git"
271
282
 
272
283
  If using SSH, the user that you use to run `bundle install` `MUST` have the
273
284
  appropriate keys available in their `$HOME/.ssh`.
@@ -295,7 +306,7 @@ to, a version specifier, if provided, means that the git repository is
295
306
  only valid if the `.gemspec` specifies a version matching the version
296
307
  specifier. If not, bundler will print a warning.
297
308
 
298
- gem "rails", "2.3.8", :git => "https://github.com/rails/rails.git"
309
+ gem "rails", "2.3.8", git: "https://github.com/rails/rails.git"
299
310
  # bundle install will fail, because the .gemspec in the rails
300
311
  # repository's master branch specifies version 3.0.0
301
312
 
@@ -307,18 +318,18 @@ Git repositories support a number of additional options.
307
318
 
308
319
  * `branch`, `tag`, and `ref`:
309
320
  You `MUST` only specify at most one of these options. The default
310
- is `:branch => "master"`. For example:
321
+ is `branch: "master"`. For example:
311
322
 
312
- gem "rails", :git => "https://github.com/rails/rails.git", :branch => "5-0-stable"
323
+ gem "rails", git: "https://github.com/rails/rails.git", branch: "5-0-stable"
313
324
 
314
- gem "rails", :git => "https://github.com/rails/rails.git", :tag => "v5.0.0"
325
+ gem "rails", git: "https://github.com/rails/rails.git", tag: "v5.0.0"
315
326
 
316
- gem "rails", :git => "https://github.com/rails/rails.git", :ref => "4aded"
327
+ gem "rails", git: "https://github.com/rails/rails.git", ref: "4aded"
317
328
 
318
329
  * `submodules`:
319
330
  For reference, a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
320
331
  lets you have another git repository within a subfolder of your repository.
321
- Specify `:submodules => true` to cause bundler to expand any
332
+ Specify `submodules: true` to cause bundler to expand any
322
333
  submodules included in the git repository
323
334
 
324
335
  If a git repository contains multiple `.gemspecs`, each `.gemspec`
@@ -346,11 +357,11 @@ as an argument, and a block which receives a single argument and interpolates it
346
357
  string to return the full repo address:
347
358
 
348
359
  git_source(:stash){ |repo_name| "https://stash.corp.acme.pl/#{repo_name}.git" }
349
- gem 'rails', :stash => 'forks/rails'
360
+ gem 'rails', stash: 'forks/rails'
350
361
 
351
362
  In addition, if you wish to choose a specific branch:
352
363
 
353
- gem "rails", :stash => "forks/rails", :branch => "branch_name"
364
+ gem "rails", stash: "forks/rails", branch: "branch_name"
354
365
 
355
366
  ### GITHUB
356
367
 
@@ -363,25 +374,33 @@ If the git repository you want to use is hosted on GitHub and is public, you can
363
374
  trailing ".git"), separated by a slash. If both the username and repository name are the
364
375
  same, you can omit one.
365
376
 
366
- gem "rails", :github => "rails/rails"
367
- gem "rails", :github => "rails"
377
+ gem "rails", github: "rails/rails"
378
+ gem "rails", github: "rails"
368
379
 
369
380
  Are both equivalent to
370
381
 
371
- gem "rails", :git => "git://github.com/rails/rails.git"
382
+ gem "rails", git: "https://github.com/rails/rails.git"
372
383
 
373
384
  Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument.
374
385
 
386
+ You can also directly pass a pull request URL:
387
+
388
+ gem "rails", github: "https://github.com/rails/rails/pull/43753"
389
+
390
+ Which is equivalent to:
391
+
392
+ gem "rails", github: "rails/rails", branch: "refs/pull/43753/head"
393
+
375
394
  ### GIST
376
395
 
377
- If the git repository you want to use is hosted as a Github Gist and is public, you can use
396
+ If the git repository you want to use is hosted as a GitHub Gist and is public, you can use
378
397
  the :gist shorthand to specify the gist identifier (without the trailing ".git").
379
398
 
380
- gem "the_hatch", :gist => "4815162342"
399
+ gem "the_hatch", gist: "4815162342"
381
400
 
382
401
  Is equivalent to:
383
402
 
384
- gem "the_hatch", :git => "https://gist.github.com/4815162342.git"
403
+ gem "the_hatch", git: "https://gist.github.com/4815162342.git"
385
404
 
386
405
  Since the `gist` method is a specialization of `git_source`, it accepts a `:branch` named argument.
387
406
 
@@ -392,12 +411,12 @@ If the git repository you want to use is hosted on Bitbucket and is public, you
392
411
  trailing ".git"), separated by a slash. If both the username and repository name are the
393
412
  same, you can omit one.
394
413
 
395
- gem "rails", :bitbucket => "rails/rails"
396
- gem "rails", :bitbucket => "rails"
414
+ gem "rails", bitbucket: "rails/rails"
415
+ gem "rails", bitbucket: "rails"
397
416
 
398
417
  Are both equivalent to
399
418
 
400
- gem "rails", :git => "https://rails@bitbucket.org/rails/rails.git"
419
+ gem "rails", git: "https://rails@bitbucket.org/rails/rails.git"
401
420
 
402
421
  Since the `bitbucket` method is a specialization of `git_source`, it accepts a `:branch` named argument.
403
422
 
@@ -415,7 +434,7 @@ version that bundler should use.
415
434
  Unlike `:git`, bundler does not compile C extensions for
416
435
  gems specified as paths.
417
436
 
418
- gem "rails", :path => "vendor/rails"
437
+ gem "rails", path: "vendor/rails"
419
438
 
420
439
  If you would like to use multiple local gems directly from the filesystem, you can set a global `path` option to the path containing the gem's files. This will automatically load gemspec files from subdirectories.
421
440
 
@@ -444,7 +463,7 @@ applied to a group of gems by using block form.
444
463
  gem "sqlite3"
445
464
  end
446
465
 
447
- group :development, :optional => true do
466
+ group :development, optional: true do
448
467
  gem "wirble"
449
468
  gem "faker"
450
469
  end
@@ -487,8 +506,8 @@ the `.gemspec` file.
487
506
 
488
507
  The `gemspec` method adds any runtime dependencies as gem requirements in the
489
508
  default group. It also adds development dependencies as gem requirements in the
490
- `development` group. Finally, it adds a gem requirement on your project (`:path
491
- => '.'`). In conjunction with `Bundler.setup`, this allows you to require project
509
+ `development` group. Finally, it adds a gem requirement on your project (`path:
510
+ '.'`). In conjunction with `Bundler.setup`, this allows you to require project
492
511
  files in your test code as you would if the project were installed as a gem; you
493
512
  need not manipulate the load path manually or require project files via relative
494
513
  paths.
@@ -513,5 +532,7 @@ bundler uses the following priority order:
513
532
  repository declared on the parent. This results in bundler prioritizing the
514
533
  ActiveSupport gem from the Rails git repository over ones from
515
534
  `rubygems.org`
516
- 3. The sources specified via global `source` lines, searching each source in
517
- your `Gemfile` from last added to first added.
535
+ 3. If neither of the above conditions are met, the global source will be used.
536
+ If multiple global sources are specified, they will be prioritized from
537
+ last to first, but this is deprecated since Bundler 1.13, so Bundler prints
538
+ a warning and will abort with an error in the future.
@@ -6,9 +6,11 @@ bundle-cache(1) bundle-cache.1
6
6
  bundle-check(1) bundle-check.1
7
7
  bundle-clean(1) bundle-clean.1
8
8
  bundle-config(1) bundle-config.1
9
+ bundle-console(1) bundle-console.1
9
10
  bundle-doctor(1) bundle-doctor.1
10
11
  bundle-exec(1) bundle-exec.1
11
12
  bundle-gem(1) bundle-gem.1
13
+ bundle-help(1) bundle-help.1
12
14
  bundle-info(1) bundle-info.1
13
15
  bundle-init(1) bundle-init.1
14
16
  bundle-inject(1) bundle-inject.1
@@ -18,8 +20,10 @@ bundle-lock(1) bundle-lock.1
18
20
  bundle-open(1) bundle-open.1
19
21
  bundle-outdated(1) bundle-outdated.1
20
22
  bundle-platform(1) bundle-platform.1
23
+ bundle-plugin(1) bundle-plugin.1
21
24
  bundle-pristine(1) bundle-pristine.1
22
25
  bundle-remove(1) bundle-remove.1
23
26
  bundle-show(1) bundle-show.1
24
27
  bundle-update(1) bundle-update.1
28
+ bundle-version(1) bundle-version.1
25
29
  bundle-viz(1) bundle-viz.1
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ module MatchMetadata
5
+ def matches_current_ruby?
6
+ @required_ruby_version.satisfied_by?(Gem.ruby_version)
7
+ end
8
+
9
+ def matches_current_rubygems?
10
+ @required_rubygems_version.satisfied_by?(Gem.rubygems_version)
11
+ end
12
+ end
13
+ end
@@ -15,7 +15,6 @@ module Bundler
15
15
  return true if Gem::Platform::RUBY == gemspec_platform
16
16
  return true if local_platform == gemspec_platform
17
17
  gemspec_platform = Gem::Platform.new(gemspec_platform)
18
- return true if GemHelpers.generic(gemspec_platform) === local_platform
19
18
  return true if gemspec_platform === local_platform
20
19
 
21
20
  false
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ module FetchMetadata
5
+ # A fallback is included because the original version of the specification
6
+ # API didn't include that field, so some marshalled specs in the index have it
7
+ # set to +nil+.
8
+ def matches_current_ruby?
9
+ @required_ruby_version ||= _remote_specification.required_ruby_version || Gem::Requirement.default
10
+
11
+ super
12
+ end
13
+
14
+ def matches_current_rubygems?
15
+ # A fallback is included because the original version of the specification
16
+ # API didn't include that field, so some marshalled specs in the index have it
17
+ # set to +nil+.
18
+ @required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default
19
+
20
+ super
21
+ end
22
+ end
23
+
24
+ module MatchRemoteMetadata
25
+ include MatchMetadata
26
+
27
+ prepend FetchMetadata
28
+ end
29
+ end
@@ -140,6 +140,13 @@ module Bundler
140
140
  end
141
141
  end
142
142
 
143
+ # Set internal representation to fetch the gems/specs locally.
144
+ #
145
+ # When this is called, the source should try to fetch the specs and
146
+ # install from the local system.
147
+ def local!
148
+ end
149
+
143
150
  # Set internal representation to fetch the gems/specs from remote.
144
151
  #
145
152
  # When this is called, the source should try to fetch the specs and
@@ -237,7 +244,21 @@ module Bundler
237
244
  specs.unmet_dependency_names
238
245
  end
239
246
 
247
+ # Used by definition.
248
+ #
249
+ # Note: Do not override if you don't know what you are doing.
250
+ def spec_names
251
+ specs.spec_names
252
+ end
253
+
254
+ # Used by definition.
255
+ #
240
256
  # Note: Do not override if you don't know what you are doing.
257
+ def add_dependency_names(names)
258
+ @dependencies |= Array(names)
259
+ end
260
+
261
+ # NOTE: Do not override if you don't know what you are doing.
241
262
  def can_lock?(spec)
242
263
  spec.source == self
243
264
  end
@@ -262,8 +283,9 @@ module Bundler
262
283
  def to_s
263
284
  "plugin source for #{@type} with uri #{@uri}"
264
285
  end
286
+ alias_method :identifier, :to_s
265
287
 
266
- # Note: Do not override if you don't know what you are doing.
288
+ # NOTE: Do not override if you don't know what you are doing.
267
289
  def include?(other)
268
290
  other == self
269
291
  end
@@ -272,7 +294,7 @@ module Bundler
272
294
  SharedHelpers.digest(:SHA1).hexdigest(uri)
273
295
  end
274
296
 
275
- # Note: Do not override if you don't know what you are doing.
297
+ # NOTE: Do not override if you don't know what you are doing.
276
298
  def gem_install_dir
277
299
  Bundler.install_path
278
300
  end
@@ -286,12 +308,6 @@ module Bundler
286
308
  Bundler.root
287
309
  end
288
310
 
289
- # @private
290
- # Returns true
291
- def bundler_plugin_api_source?
292
- true
293
- end
294
-
295
311
  # @private
296
312
  # This API on source might not be stable, and for now we expect plugins
297
313
  # to download all specs in `#specs`, so we implement the method for
@@ -74,7 +74,10 @@ module Bundler
74
74
  def unregister_plugin(name)
75
75
  @commands.delete_if {|_, v| v == name }
76
76
  @sources.delete_if {|_, v| v == name }
77
- @hooks.each {|_, plugin_names| plugin_names.delete(name) }
77
+ @hooks.each do |hook, names|
78
+ names.delete(name)
79
+ @hooks.delete(hook) if names.empty?
80
+ end
78
81
  @plugin_paths.delete(name)
79
82
  @load_paths.delete(name)
80
83
  save_index
@@ -20,10 +20,6 @@ module Bundler
20
20
  end
21
21
  end
22
22
 
23
- def version_message(spec)
24
- "#{spec.name} #{spec.version}"
25
- end
26
-
27
23
  def root
28
24
  Plugin.root
29
25
  end
@@ -4,10 +4,6 @@ module Bundler
4
4
  module Plugin
5
5
  class Installer
6
6
  class Rubygems < Bundler::Source::Rubygems
7
- def version_message(spec)
8
- "#{spec.name} #{spec.version}"
9
- end
10
-
11
7
  private
12
8
 
13
9
  def requires_sudo?
@@ -16,15 +16,13 @@ module Bundler
16
16
 
17
17
  version = options[:version] || [">= 0"]
18
18
 
19
- Bundler.settings.temporary(:disable_multisource => false) do
20
- if options[:git]
21
- install_git(names, version, options)
22
- elsif options[:local_git]
23
- install_local_git(names, version, options)
24
- else
25
- sources = options[:source] || Bundler.rubygems.sources
26
- install_rubygems(names, version, sources)
27
- end
19
+ if options[:git]
20
+ install_git(names, version, options)
21
+ elsif options[:local_git]
22
+ install_local_git(names, version, options)
23
+ else
24
+ sources = options[:source] || Gem.sources
25
+ install_rubygems(names, version, sources)
28
26
  end
29
27
  end
30
28
 
@@ -79,10 +77,12 @@ module Bundler
79
77
  source_list = SourceList.new
80
78
 
81
79
  source_list.add_git_source(git_source_options) if git_source_options
82
- source_list.add_rubygems_source("remotes" => rubygems_source) if rubygems_source
80
+ Array(rubygems_source).each {|remote| source_list.add_global_rubygems_remote(remote) } if rubygems_source
83
81
 
84
82
  deps = names.map {|name| Dependency.new name, version }
85
83
 
84
+ Bundler.configure_gem_home_and_path(Plugin.root)
85
+
86
86
  definition = Definition.new(nil, deps, source_list, true)
87
87
  install_definition(definition)
88
88
  end
@@ -17,6 +17,10 @@ module Bundler
17
17
  path_sources + git_sources + rubygems_sources + [metadata_source]
18
18
  end
19
19
 
20
+ def default_source
21
+ git_sources.first || global_rubygems_source
22
+ end
23
+
20
24
  private
21
25
 
22
26
  def rubygems_aggregate_class