bundler 2.2.0.rc.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +786 -690
  3. data/lib/bundler.rb +17 -3
  4. data/lib/bundler/build_metadata.rb +3 -11
  5. data/lib/bundler/cli.rb +31 -15
  6. data/lib/bundler/cli/add.rb +1 -1
  7. data/lib/bundler/cli/binstubs.rb +6 -2
  8. data/lib/bundler/cli/cache.rb +1 -7
  9. data/lib/bundler/cli/clean.rb +1 -1
  10. data/lib/bundler/cli/common.rb +14 -0
  11. data/lib/bundler/cli/doctor.rb +1 -1
  12. data/lib/bundler/cli/exec.rb +4 -4
  13. data/lib/bundler/cli/fund.rb +36 -0
  14. data/lib/bundler/cli/gem.rb +1 -1
  15. data/lib/bundler/cli/info.rb +2 -1
  16. data/lib/bundler/cli/init.rb +1 -1
  17. data/lib/bundler/cli/inject.rb +1 -1
  18. data/lib/bundler/cli/install.rb +18 -7
  19. data/lib/bundler/cli/list.rb +1 -1
  20. data/lib/bundler/cli/outdated.rb +1 -3
  21. data/lib/bundler/cli/pristine.rb +1 -1
  22. data/lib/bundler/cli/show.rb +1 -1
  23. data/lib/bundler/cli/update.rb +3 -1
  24. data/lib/bundler/compact_index_client.rb +1 -1
  25. data/lib/bundler/compact_index_client/cache.rb +6 -14
  26. data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
  27. data/lib/bundler/compact_index_client/updater.rb +5 -5
  28. data/lib/bundler/definition.rb +49 -60
  29. data/lib/bundler/dep_proxy.rb +1 -1
  30. data/lib/bundler/dependency.rb +3 -1
  31. data/lib/bundler/dsl.rb +4 -4
  32. data/lib/bundler/endpoint_specification.rb +1 -1
  33. data/lib/bundler/env.rb +1 -1
  34. data/lib/bundler/feature_flag.rb +0 -1
  35. data/lib/bundler/fetcher.rb +3 -3
  36. data/lib/bundler/fetcher/base.rb +1 -1
  37. data/lib/bundler/fetcher/compact_index.rb +1 -1
  38. data/lib/bundler/fetcher/downloader.rb +1 -1
  39. data/lib/bundler/fetcher/index.rb +3 -4
  40. data/lib/bundler/friendly_errors.rb +18 -3
  41. data/lib/bundler/gem_helper.rb +17 -9
  42. data/lib/bundler/gem_helpers.rb +36 -25
  43. data/lib/bundler/gem_version_promoter.rb +1 -1
  44. data/lib/bundler/graph.rb +1 -1
  45. data/lib/bundler/index.rb +6 -2
  46. data/lib/bundler/injector.rb +10 -3
  47. data/lib/bundler/installer.rb +8 -6
  48. data/lib/bundler/installer/gem_installer.rb +1 -1
  49. data/lib/bundler/installer/parallel_installer.rb +1 -1
  50. data/lib/bundler/installer/standalone.rb +2 -2
  51. data/lib/bundler/lazy_specification.rb +22 -11
  52. data/lib/bundler/lockfile_generator.rb +1 -1
  53. data/lib/bundler/lockfile_parser.rb +1 -1
  54. data/lib/bundler/man/.document +1 -0
  55. data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
  56. data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
  57. data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
  58. data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
  59. data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
  60. data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +14 -21
  61. data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
  62. data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
  63. data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +0 -0
  64. data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
  65. data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
  66. data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
  67. data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
  68. data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +0 -0
  69. data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
  70. data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
  71. data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
  72. data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
  73. data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
  74. data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
  75. data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
  76. data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +0 -0
  77. data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
  78. data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
  79. data/{man → lib/bundler/man}/gemfile.5.ronn +4 -4
  80. data/lib/bundler/mirror.rb +2 -2
  81. data/lib/bundler/plugin.rb +5 -6
  82. data/lib/bundler/plugin/api/source.rb +1 -1
  83. data/lib/bundler/plugin/dsl.rb +1 -1
  84. data/lib/bundler/plugin/index.rb +1 -1
  85. data/lib/bundler/plugin/installer.rb +1 -1
  86. data/lib/bundler/plugin/installer/rubygems.rb +1 -1
  87. data/lib/bundler/plugin/source_list.rb +1 -1
  88. data/lib/bundler/remote_specification.rb +1 -1
  89. data/lib/bundler/resolver.rb +26 -30
  90. data/lib/bundler/resolver/spec_group.rb +21 -27
  91. data/lib/bundler/retry.rb +1 -1
  92. data/lib/bundler/ruby_version.rb +1 -1
  93. data/lib/bundler/rubygems_ext.rb +46 -1
  94. data/lib/bundler/rubygems_gem_installer.rb +2 -2
  95. data/lib/bundler/rubygems_integration.rb +22 -12
  96. data/lib/bundler/runtime.rb +2 -2
  97. data/lib/bundler/settings.rb +49 -43
  98. data/lib/bundler/shared_helpers.rb +1 -1
  99. data/lib/bundler/similarity_detector.rb +1 -1
  100. data/lib/bundler/source.rb +1 -1
  101. data/lib/bundler/source/git.rb +1 -1
  102. data/lib/bundler/source/git/git_proxy.rb +5 -3
  103. data/lib/bundler/source/path.rb +2 -2
  104. data/lib/bundler/source/path/installer.rb +1 -1
  105. data/lib/bundler/source/rubygems.rb +2 -2
  106. data/lib/bundler/source/rubygems/remote.rb +1 -1
  107. data/lib/bundler/source_list.rb +2 -2
  108. data/lib/bundler/spec_set.rb +7 -9
  109. data/lib/bundler/stub_specification.rb +1 -3
  110. data/lib/bundler/templates/newgem/README.md.tt +1 -2
  111. data/lib/bundler/templates/newgem/bin/console.tt +1 -2
  112. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -2
  113. data/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  114. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +0 -1
  115. data/lib/bundler/ui/shell.rb +5 -5
  116. data/lib/bundler/uri_credentials_filter.rb +3 -1
  117. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
  118. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +34 -1
  119. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
  120. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
  121. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  122. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +38 -40
  123. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +8 -1
  124. data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
  125. data/lib/bundler/vendored_persistent.rb +0 -7
  126. data/lib/bundler/vendored_tmpdir.rb +4 -0
  127. data/lib/bundler/version.rb +1 -1
  128. data/lib/bundler/worker.rb +1 -1
  129. data/lib/bundler/yaml_serializer.rb +1 -1
  130. data/man/bundle-add.1 +1 -1
  131. data/man/bundle-binstubs.1 +5 -3
  132. data/man/bundle-cache.1 +1 -1
  133. data/man/bundle-check.1 +1 -1
  134. data/man/bundle-clean.1 +1 -1
  135. data/man/bundle-config.1 +14 -17
  136. data/man/bundle-doctor.1 +1 -1
  137. data/man/bundle-exec.1 +1 -1
  138. data/man/bundle-gem.1 +1 -1
  139. data/man/bundle-info.1 +1 -1
  140. data/man/bundle-init.1 +1 -1
  141. data/man/bundle-inject.1 +1 -1
  142. data/man/bundle-install.1 +30 -3
  143. data/man/bundle-list.1 +1 -1
  144. data/man/bundle-lock.1 +1 -1
  145. data/man/bundle-open.1 +1 -1
  146. data/man/bundle-outdated.1 +1 -1
  147. data/man/bundle-platform.1 +1 -1
  148. data/man/bundle-pristine.1 +1 -1
  149. data/man/bundle-remove.1 +1 -1
  150. data/man/bundle-show.1 +1 -1
  151. data/man/bundle-update.1 +1 -1
  152. data/man/bundle-viz.1 +1 -1
  153. data/man/bundle.1 +1 -1
  154. data/man/gemfile.5 +4 -4
  155. metadata +33 -54
  156. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
  157. data/man/bundle-add.1.txt +0 -58
  158. data/man/bundle-binstubs.1.txt +0 -48
  159. data/man/bundle-cache.1.txt +0 -78
  160. data/man/bundle-check.1.txt +0 -33
  161. data/man/bundle-clean.1.txt +0 -26
  162. data/man/bundle-config.1.txt +0 -527
  163. data/man/bundle-doctor.1.txt +0 -44
  164. data/man/bundle-exec.1.txt +0 -181
  165. data/man/bundle-gem.1.txt +0 -117
  166. data/man/bundle-info.1.txt +0 -21
  167. data/man/bundle-init.1.txt +0 -34
  168. data/man/bundle-inject.1.txt +0 -32
  169. data/man/bundle-install.1.txt +0 -401
  170. data/man/bundle-list.1.txt +0 -44
  171. data/man/bundle-lock.1.txt +0 -93
  172. data/man/bundle-open.1.txt +0 -29
  173. data/man/bundle-outdated.1.txt +0 -131
  174. data/man/bundle-platform.1.txt +0 -57
  175. data/man/bundle-pristine.1.txt +0 -44
  176. data/man/bundle-remove.1.txt +0 -34
  177. data/man/bundle-show.1.txt +0 -27
  178. data/man/bundle-update.1.txt +0 -391
  179. data/man/bundle-viz.1.txt +0 -39
  180. data/man/bundle.1.txt +0 -116
  181. data/man/gemfile.5.txt +0 -651
@@ -27,7 +27,7 @@ module Bundler
27
27
  return false, specific_failure_message(e)
28
28
  end
29
29
 
30
- private
30
+ private
31
31
 
32
32
  def specific_failure_message(e)
33
33
  message = "#{e.class}: #{e.message}\n"
@@ -130,7 +130,7 @@ module Bundler
130
130
  Bundler.ui.warn(warning.join("\n"))
131
131
  end
132
132
 
133
- private
133
+ private
134
134
 
135
135
  def failed_specs
136
136
  @specs.select(&:failed?)
@@ -16,12 +16,12 @@ module Bundler
16
16
  file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
17
17
  file.puts "path = File.expand_path('..', __FILE__)"
18
18
  paths.each do |path|
19
- file.puts %($:.unshift "\#{path}/#{path}")
19
+ file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
20
20
  end
21
21
  end
22
22
  end
23
23
 
24
- private
24
+ private
25
25
 
26
26
  def paths
27
27
  @specs.map do |spec|
@@ -4,7 +4,7 @@ require_relative "match_platform"
4
4
 
5
5
  module Bundler
6
6
  class LazySpecification
7
- Identifier = Struct.new(:name, :version, :source, :platform, :dependencies)
7
+ Identifier = Struct.new(:name, :version, :platform)
8
8
  class Identifier
9
9
  include Comparable
10
10
  def <=>(other)
@@ -12,7 +12,7 @@ module Bundler
12
12
  [name, version, platform_string] <=> [other.name, other.version, other.platform_string]
13
13
  end
14
14
 
15
- protected
15
+ protected
16
16
 
17
17
  def platform_string
18
18
  platform_string = platform.to_s
@@ -79,19 +79,17 @@ module Bundler
79
79
  @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name
80
80
  source.gemspec.tap {|s| s.source = source }
81
81
  else
82
- search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version)
82
+ search_object = if source.is_a?(Source::Path)
83
+ Dependency.new(name, version)
84
+ else
85
+ ruby_platform_materializes_to_ruby_platform? ? self : Dependency.new(name, version)
86
+ end
83
87
  platform_object = Gem::Platform.new(platform)
84
88
  candidates = source.specs.search(search_object)
85
89
  same_platform_candidates = candidates.select do |spec|
86
90
  MatchPlatform.platforms_match?(spec.platform, platform_object)
87
91
  end
88
92
  search = same_platform_candidates.last || candidates.last
89
- if search && Gem::Platform.new(search.platform) != platform_object && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
90
- Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
91
- "because it has different dependencies from the #{platform} version. " \
92
- "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
93
- search = source.specs.search(self).last
94
- end
95
93
  search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
96
94
  search
97
95
  end
@@ -110,7 +108,7 @@ module Bundler
110
108
  end
111
109
 
112
110
  def identifier
113
- @__identifier ||= Identifier.new(name, version, source, platform, dependencies)
111
+ @__identifier ||= Identifier.new(name, version, platform)
114
112
  end
115
113
 
116
114
  def git_version
@@ -118,7 +116,7 @@ module Bundler
118
116
  " #{source.revision[0..6]}"
119
117
  end
120
118
 
121
- private
119
+ private
122
120
 
123
121
  def to_ary
124
122
  nil
@@ -131,5 +129,18 @@ module Bundler
131
129
 
132
130
  @specification.send(method, *args, &blk)
133
131
  end
132
+
133
+ #
134
+ # For backwards compatibility with existing lockfiles, if the most specific
135
+ # locked platform is RUBY, we keep the previous behaviour of resolving the
136
+ # best platform variant at materiliazation time. For previous bundler
137
+ # versions (before 2.2.0) this was always the case (except when the lockfile
138
+ # only included non-ruby platforms), but we're also keeping this behaviour
139
+ # on newer bundlers unless users generate the lockfile from scratch or
140
+ # explicitly add a more specific platform.
141
+ #
142
+ def ruby_platform_materializes_to_ruby_platform?
143
+ !Bundler.most_specific_locked_platform?(Gem::Platform::RUBY)
144
+ end
134
145
  end
135
146
  end
@@ -25,7 +25,7 @@ module Bundler
25
25
  out
26
26
  end
27
27
 
28
- private
28
+ private
29
29
 
30
30
  def add_sources
31
31
  definition.send(:sources).lock_sources.each_with_index do |source, idx|
@@ -109,7 +109,7 @@ module Bundler
109
109
  "bundler:#{bundler_version}#{prerelease_text}`.\n"
110
110
  end
111
111
 
112
- private
112
+ private
113
113
 
114
114
  TYPES = {
115
115
  GIT => Bundler::Source::Git,
@@ -0,0 +1 @@
1
+ # Ignore all files in this directory
@@ -37,7 +37,5 @@ Calling binstubs with [GEM [GEM]] will create binstubs for all given gems.
37
37
  * `--shebang`:
38
38
  Specify a different shebang executable name than the default (default 'ruby')
39
39
 
40
- ## BUNDLE INSTALL --BINSTUBS
41
-
42
- To create binstubs for all the gems in the bundle you can use the `--binstubs`
43
- flag in [bundle install(1)](bundle-install.1.html).
40
+ * `--all`:
41
+ Create binstubs for all gems in the bundle.
@@ -47,7 +47,7 @@ configuration only from the local application.
47
47
  Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
48
48
  cause it to ignore all configuration.
49
49
 
50
- Executing `bundle config set disable_multisource true` upgrades the warning about
50
+ Executing `bundle config set --local disable_multisource true` upgrades the warning about
51
51
  the Gemfile containing multiple primary sources to an error. Executing `bundle
52
52
  config unset disable_multisource` downgrades this error to a warning.
53
53
 
@@ -59,7 +59,7 @@ application's configuration (normally, `./.bundle/config`).
59
59
 
60
60
  However, this will be changed in bundler 3, so it's better not to rely on this
61
61
  behavior. If these options must be remembered, it's better to set them using
62
- `bundle config` (e.g., `bundle config set path foo`).
62
+ `bundle config` (e.g., `bundle config set --local path foo`).
63
63
 
64
64
  The options that can be configured are:
65
65
 
@@ -103,7 +103,7 @@ pass configuration flags to `gem install` to specify where to find the
103
103
  Since the specific location of that executable can change from machine
104
104
  to machine, you can specify these flags on a per-machine basis.
105
105
 
106
- bundle config set build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
106
+ bundle config set --global build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
107
107
 
108
108
  After running this command, every time bundler needs to install the
109
109
  `mysql` gem, it will pass along the flags you specified.
@@ -150,7 +150,8 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
150
150
  Install executables from gems in the bundle to the specified directory.
151
151
  Defaults to `false`.
152
152
  * `cache_all` (`BUNDLE_CACHE_ALL`):
153
- Cache all gems, including path and git gems.
153
+ Cache all gems, including path and git gems. This needs to be explicitly
154
+ configured on bundler 1 and bundler 2, but will be the default on bundler 3.
154
155
  * `cache_all_platforms` (`BUNDLE_CACHE_ALL_PLATFORMS`):
155
156
  Cache gems for all platforms.
156
157
  * `cache_path` (`BUNDLE_CACHE_PATH`):
@@ -249,14 +250,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
249
250
  be changed in the next major version.
250
251
  * `silence_root_warning` (`BUNDLE_SILENCE_ROOT_WARNING`):
251
252
  Silence the warning Bundler prints when installing gems as root.
252
- * `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
253
- Allow bundler to resolve for the specific running platform and store it in
254
- the lockfile, instead of only using a generic platform.
255
- A specific platform is the exact platform triple reported by
256
- `Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
257
- On the other hand, generic platforms are those such as `ruby`, `mswin`, or
258
- `java`. In this example, `x86_64-darwin-16` would map to `ruby` and
259
- `universal-java-1.8` to `java`.
260
253
  * `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
261
254
  Path to a designated CA certificate file or folder containing multiple
262
255
  certificates for trusted CAs in PEM format.
@@ -299,11 +292,11 @@ Bundler also allows you to work against a git repository locally
299
292
  instead of using the remote version. This can be achieved by setting
300
293
  up a local override:
301
294
 
302
- bundle config set local.GEM_NAME /path/to/local/git/repository
295
+ bundle config set --local local.GEM_NAME /path/to/local/git/repository
303
296
 
304
297
  For example, in order to use a local Rack repository, a developer could call:
305
298
 
306
- bundle config set local.rack ~/Work/git/rack
299
+ bundle config set --local local.rack ~/Work/git/rack
307
300
 
308
301
  Now instead of checking out the remote git repository, the local
309
302
  override will be used. Similar to a path source, every time the local
@@ -333,21 +326,21 @@ Bundler supports overriding gem sources with mirrors. This allows you to
333
326
  configure rubygems.org as the gem source in your Gemfile while still using your
334
327
  mirror to fetch gems.
335
328
 
336
- bundle config set mirror.SOURCE_URL MIRROR_URL
329
+ bundle config set --global mirror.SOURCE_URL MIRROR_URL
337
330
 
338
331
  For example, to use a mirror of rubygems.org hosted at rubygems-mirror.org:
339
332
 
340
- bundle config set mirror.http://rubygems.org http://rubygems-mirror.org
333
+ bundle config set --global mirror.http://rubygems.org http://rubygems-mirror.org
341
334
 
342
335
  Each mirror also provides a fallback timeout setting. If the mirror does not
343
336
  respond within the fallback timeout, Bundler will try to use the original
344
337
  server instead of the mirror.
345
338
 
346
- bundle config set mirror.SOURCE_URL.fallback_timeout TIMEOUT
339
+ bundle config set --global mirror.SOURCE_URL.fallback_timeout TIMEOUT
347
340
 
348
341
  For example, to fall back to rubygems.org after 3 seconds:
349
342
 
350
- bundle config set mirror.https://rubygems.org.fallback_timeout 3
343
+ bundle config set --global mirror.https://rubygems.org.fallback_timeout 3
351
344
 
352
345
  The default fallback timeout is 0.1 seconds, but the setting can currently
353
346
  only accept whole seconds (for example, 1, 15, or 30).
@@ -357,12 +350,12 @@ only accept whole seconds (for example, 1, 15, or 30).
357
350
  Bundler allows you to configure credentials for any gem source, which allows
358
351
  you to avoid putting secrets into your Gemfile.
359
352
 
360
- bundle config set SOURCE_HOSTNAME USERNAME:PASSWORD
353
+ bundle config set --global SOURCE_HOSTNAME USERNAME:PASSWORD
361
354
 
362
355
  For example, to save the credentials of user `claudette` for the gem source at
363
356
  `gems.longerous.com`, you would run:
364
357
 
365
- bundle config set gems.longerous.com claudette:s00pers3krit
358
+ bundle config set --global gems.longerous.com claudette:s00pers3krit
366
359
 
367
360
  Or you can set the credentials as an environment variable like this:
368
361
 
@@ -370,7 +363,7 @@ Or you can set the credentials as an environment variable like this:
370
363
 
371
364
  For gems with a git source with HTTP(S) URL you can specify credentials like so:
372
365
 
373
- bundle config set https://github.com/bundler/bundler.git username:password
366
+ bundle config set --global https://github.com/rubygems/rubygems.git username:password
374
367
 
375
368
  Or you can set the credentials as an environment variable like so:
376
369
 
@@ -43,8 +43,12 @@ update process below under [CONSERVATIVE UPDATING][].
43
43
 
44
44
  ## OPTIONS
45
45
 
46
- To apply any of `--binstubs`, `--deployment`, `--path`, or `--without` every
47
- time `bundle install` is run, use `bundle config` (see bundle-config(1)).
46
+ The `--clean`, `--deployment`, `--frozen`, `--no-prune`, `--path`, `--shebang`,
47
+ `--system`, `--without` and `--with` options are deprecated because they only
48
+ make sense if they are applied to every subsequent `bundle install` run
49
+ automatically and that requires `bundler` to silently remember them. Since
50
+ `bundler` will no longer remember CLI flags in future versions, `bundle config`
51
+ (see bundle-config(1)) should be used to apply them permanently.
48
52
 
49
53
  * `--binstubs[=<directory>]`:
50
54
  Binstubs are scripts that wrap around executables. Bundler creates a small Ruby
@@ -64,11 +68,15 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
64
68
  in the current Gemfile(5). Don't worry, gems currently in use will not be
65
69
  removed.
66
70
 
71
+ This option is deprecated in favor of the `clean` setting.
72
+
67
73
  * `--deployment`:
68
74
  In [deployment mode][DEPLOYMENT MODE], Bundler will 'roll-out' the bundle for
69
75
  production or CI use. Please check carefully if you want to have this option
70
76
  enabled in your development environment.
71
77
 
78
+ This option is deprecated in favor of the `deployment` setting.
79
+
72
80
  * `--redownload`:
73
81
  Force download every gem, even if the required versions are already available
74
82
  locally.
@@ -77,6 +85,8 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
77
85
  Do not allow the Gemfile.lock to be updated after this install. Exits
78
86
  non-zero if there are going to be changes to the Gemfile.lock.
79
87
 
88
+ This option is deprecated in favor of the `frozen` setting.
89
+
80
90
  * `--full-index`:
81
91
  Bundler will not call Rubygems' API endpoint (default) but download and cache
82
92
  a (currently big) index file of all gems. Performance can be improved for
@@ -95,7 +105,7 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
95
105
 
96
106
  * `--local`:
97
107
  Do not attempt to connect to `rubygems.org`. Instead, Bundler will use the
98
- gems already present in Rubygems' cache or in `vendor/cache`. Note that if a
108
+ gems already present in Rubygems' cache or in `vendor/cache`. Note that if an
99
109
  appropriate platform-specific gem exists on `rubygems.org` it will not be
100
110
  found.
101
111
 
@@ -107,6 +117,8 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
107
117
  * `--no-prune`:
108
118
  Don't remove stale gems from the cache when the installation finishes.
109
119
 
120
+ This option is deprecated in favor of the `no_prune` setting.
121
+
110
122
  * `--path=<path>`:
111
123
  The location to install the specified gems to. This defaults to Rubygems'
112
124
  setting. Bundler shares this location with Rubygems, `gem install ...` will
@@ -114,6 +126,8 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
114
126
  `--path ...` setting will show up by calling `gem list`. Accordingly, gems
115
127
  installed to other locations will not get listed.
116
128
 
129
+ This option is deprecated in favor of the `path` setting.
130
+
117
131
  * `--quiet`:
118
132
  Do not print progress information to the standard output. Instead, Bundler
119
133
  will exit using a status code (`$?`).
@@ -127,6 +141,8 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
127
141
  `--shebang jruby` these executables will be changed to execute `jruby`
128
142
  instead.
129
143
 
144
+ This option is deprecated in favor of the `shebang` setting.
145
+
130
146
  * `--standalone[=<list>]`:
131
147
  Makes a bundle that can work without depending on Rubygems or Bundler at
132
148
  runtime. A space separated list of groups to install has to be specified.
@@ -139,6 +155,8 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
139
155
  Installs the gems specified in the bundle to the system's Rubygems location.
140
156
  This overrides any previous configuration of `--path`.
141
157
 
158
+ This option is deprecated in favor of the `system` setting.
159
+
142
160
  * `--trust-policy=[<policy>]`:
143
161
  Apply the Rubygems security policy <policy>, where policy is one of
144
162
  `HighSecurity`, `MediumSecurity`, `LowSecurity`, `AlmostNoSecurity`, or
@@ -151,11 +169,15 @@ time `bundle install` is run, use `bundle config` (see bundle-config(1)).
151
169
  in the remembered list of groups given to --without, it is removed
152
170
  from that list.
153
171
 
172
+ This option is deprecated in favor of the `with` setting.
173
+
154
174
  * `--without=<list>`:
155
175
  A space-separated list of groups referencing gems to skip during installation.
156
176
  If a group is given that is in the remembered list of groups given
157
177
  to --with, it is removed from that list.
158
178
 
179
+ This option is deprecated in favor of the `without` setting.
180
+
159
181
  ## DEPLOYMENT MODE
160
182
 
161
183
  Bundler's defaults are optimized for development. To switch to
@@ -120,8 +120,8 @@ Each _gem_ `MAY` have one or more version specifiers.
120
120
  ### REQUIRE AS
121
121
 
122
122
  Each _gem_ `MAY` specify files that should be used when autorequiring via
123
- `Bundler.require`. You may pass an array with multiple files or `true` if file
124
- you want `required` has same name as _gem_ or `false` to
123
+ `Bundler.require`. You may pass an array with multiple files or `true` if the file
124
+ you want `required` has the same name as _gem_ or `false` to
125
125
  prevent any file from being autorequired.
126
126
 
127
127
  gem "redis", :require => ["redis/connection/hiredis", "redis"]
@@ -163,8 +163,8 @@ not install with the `without` configuration.
163
163
 
164
164
  To specify multiple groups to ignore, specify a list of groups separated by spaces.
165
165
 
166
- bundle config set without test
167
- bundle config set without development test
166
+ bundle config set --local without test
167
+ bundle config set --local without development test
168
168
 
169
169
  Also, calling `Bundler.setup` with no parameters, or calling `require "bundler/setup"`
170
170
  will setup all groups except for the ones you excluded via `--without` (since they
@@ -43,7 +43,7 @@ module Bundler
43
43
  config.update_mirror(mirror)
44
44
  end
45
45
 
46
- private
46
+ private
47
47
 
48
48
  def fetch_valid_mirror_for(uri)
49
49
  downcased = uri.to_s.downcase
@@ -158,7 +158,7 @@ module Bundler
158
158
  end
159
159
  end
160
160
 
161
- private
161
+ private
162
162
 
163
163
  def wait_for_writtable_socket(socket, address, timeout)
164
164
  if IO.select(nil, [socket], nil, timeout)
@@ -16,7 +16,7 @@ module Bundler
16
16
 
17
17
  PLUGIN_FILE_NAME = "plugins.rb".freeze
18
18
 
19
- module_function
19
+ module_function
20
20
 
21
21
  def reset!
22
22
  instance_variables.each {|i| remove_instance_variable(i) }
@@ -39,12 +39,11 @@ module Bundler
39
39
 
40
40
  save_plugins names, specs
41
41
  rescue PluginError => e
42
- if specs
43
- specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }]
44
- specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) }
45
- end
42
+ specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
43
+ specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
46
44
 
47
- Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
45
+ names_list = names.map {|name| "`#{name}`" }.join(", ")
46
+ Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}"
48
47
  end
49
48
 
50
49
  # Uninstalls plugins by the given names