bundler 2.1.0.pre.2 → 2.1.0.pre.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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -1
  3. data/lib/bundler.rb +87 -24
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli.rb +55 -25
  6. data/lib/bundler/cli/add.rb +1 -0
  7. data/lib/bundler/cli/{package.rb → cache.rb} +2 -2
  8. data/lib/bundler/cli/exec.rb +0 -7
  9. data/lib/bundler/dsl.rb +1 -1
  10. data/lib/bundler/friendly_errors.rb +1 -1
  11. data/lib/bundler/gem_helper.rb +0 -2
  12. data/lib/bundler/gem_helpers.rb +1 -1
  13. data/lib/bundler/inline.rb +7 -3
  14. data/lib/bundler/lockfile_parser.rb +1 -0
  15. data/lib/bundler/rubygems_ext.rb +1 -1
  16. data/lib/bundler/rubygems_integration.rb +0 -1
  17. data/lib/bundler/setup.rb +2 -9
  18. data/lib/bundler/shared_helpers.rb +12 -25
  19. data/lib/bundler/source/git.rb +1 -1
  20. data/lib/bundler/source/git/git_proxy.rb +1 -1
  21. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +132 -109
  22. data/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +1 -1
  23. data/lib/bundler/vendor/thor/lib/thor.rb +5 -2
  24. data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -0
  25. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +6 -16
  26. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
  27. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +18 -7
  28. data/lib/bundler/vendor/thor/lib/thor/base.rb +10 -8
  29. data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
  30. data/lib/bundler/vendor/thor/lib/thor/error.rb +14 -18
  31. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
  32. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
  33. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
  34. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +1 -1
  35. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +8 -6
  36. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -3
  37. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  38. data/lib/bundler/vendor/thor/lib/thor/runner.rb +2 -0
  39. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
  40. data/lib/bundler/version.rb +1 -1
  41. data/man/bundle-add.1 +1 -1
  42. data/man/bundle-add.1.txt +1 -1
  43. data/man/bundle-binstubs.1 +1 -1
  44. data/man/bundle-binstubs.1.txt +1 -1
  45. data/man/bundle-cache.1 +55 -0
  46. data/man/bundle-cache.1.txt +78 -0
  47. data/man/{bundle-package.ronn → bundle-cache.ronn} +15 -15
  48. data/man/bundle-check.1 +1 -1
  49. data/man/bundle-check.1.txt +1 -1
  50. data/man/bundle-clean.1 +1 -1
  51. data/man/bundle-clean.1.txt +1 -1
  52. data/man/bundle-config.1 +1 -1
  53. data/man/bundle-config.1.txt +1 -1
  54. data/man/bundle-doctor.1 +1 -1
  55. data/man/bundle-doctor.1.txt +1 -1
  56. data/man/bundle-exec.1 +1 -1
  57. data/man/bundle-exec.1.txt +1 -1
  58. data/man/bundle-gem.1 +1 -1
  59. data/man/bundle-gem.1.txt +1 -1
  60. data/man/bundle-info.1 +1 -1
  61. data/man/bundle-info.1.txt +1 -1
  62. data/man/bundle-init.1 +1 -1
  63. data/man/bundle-init.1.txt +1 -1
  64. data/man/bundle-inject.1 +1 -1
  65. data/man/bundle-inject.1.txt +1 -1
  66. data/man/bundle-install.1 +1 -1
  67. data/man/bundle-install.1.txt +1 -1
  68. data/man/bundle-list.1 +1 -1
  69. data/man/bundle-list.1.txt +1 -1
  70. data/man/bundle-lock.1 +1 -1
  71. data/man/bundle-lock.1.txt +1 -1
  72. data/man/bundle-open.1 +1 -1
  73. data/man/bundle-open.1.txt +1 -1
  74. data/man/bundle-outdated.1 +1 -1
  75. data/man/bundle-outdated.1.txt +1 -1
  76. data/man/bundle-platform.1 +1 -1
  77. data/man/bundle-platform.1.txt +1 -1
  78. data/man/bundle-pristine.1 +1 -1
  79. data/man/bundle-pristine.1.txt +1 -1
  80. data/man/bundle-remove.1 +1 -1
  81. data/man/bundle-remove.1.txt +1 -1
  82. data/man/bundle-show.1 +1 -1
  83. data/man/bundle-show.1.txt +1 -1
  84. data/man/bundle-update.1 +1 -1
  85. data/man/bundle-update.1.txt +1 -1
  86. data/man/bundle-viz.1 +1 -1
  87. data/man/bundle-viz.1.txt +1 -1
  88. data/man/bundle.1 +1 -1
  89. data/man/bundle.1.txt +1 -1
  90. data/man/gemfile.5 +1 -1
  91. data/man/gemfile.5.txt +1 -1
  92. data/man/index.txt +1 -1
  93. metadata +6 -7
  94. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
  95. data/man/bundle-package.1 +0 -55
  96. data/man/bundle-package.1.txt +0 -79
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ce73b58b7e39e7b459d2162c9a679e422bdda52493f7ae1ea79b0bf2f8ed5a9
4
- data.tar.gz: e9500a1cf2d42afabe6bce0550b2ce5473a3d0c20d5ff416f714f8027d24a306
3
+ metadata.gz: '016587ebd0e4e401df2504768760b0718525d11e04b85551d00b1f97d3a01200'
4
+ data.tar.gz: d39551298cdbbbc1781fc4ca9a6419be8776f48bac0a2a1c1c8e2620cf9b422b
5
5
  SHA512:
6
- metadata.gz: 8ce3e5473c3f6aaefa23180e551c5e890c749d9c3e6235529be308b0887834f263e0af2604e9a44bb6716cbd9504dada8af93f6ea54646d0c530d95784a565b2
7
- data.tar.gz: 88429dc48009f3740b40605b043acb7238d43abb1fa10209979f8bcbbba077692960e6f2320fc1a40314f6011367db0a4195baf08862cedb2a7deb2fd43f8271
6
+ metadata.gz: f112162b7ea371f4711eace2134d55702d658653b544bdc47e7085788690d36d8c0f00395c237cb71e4d56269d5e172109ee8f1a82efcf0fef1b0d1af6976db7
7
+ data.tar.gz: c9de6a0993c9c5fbfdf5423be20a02fdd33ee0ab98df9172205972274e77889a6747408ca74e22f6dc4cce65c51ea2777d7608740488827f284b8a4055124223
@@ -1,4 +1,21 @@
1
- ## 2.1.0.pre.2
1
+ ## 2.1.0.pre.3 (November 12, 2019)
2
+
3
+ Features:
4
+
5
+ - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361)
6
+ - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389)
7
+ - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394)
8
+
9
+ Bugfixes:
10
+
11
+ - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374)
12
+ - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385)
13
+ - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388)
14
+ - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393)
15
+ - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416)
16
+ - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417)
17
+
18
+ ## 2.1.0.pre.2 (September 15, 2019)
2
19
 
3
20
  Bugfixes:
4
21
 
@@ -14,6 +14,25 @@ require_relative "bundler/constants"
14
14
  require_relative "bundler/current_ruby"
15
15
  require_relative "bundler/build_metadata"
16
16
 
17
+ # Bundler provides a consistent environment for Ruby projects by
18
+ # tracking and installing the exact gems and versions that are needed.
19
+ #
20
+ # Since Ruby 2.6, Bundler is a part of Ruby's standard library.
21
+ #
22
+ # Bunder is used by creating _gemfiles_ listing all the project dependencies
23
+ # and (optionally) their versions and then using
24
+ #
25
+ # require 'bundler/setup'
26
+ #
27
+ # or Bundler.setup to setup environment where only specified gems and their
28
+ # specified versions could be used.
29
+ #
30
+ # See {Bundler website}[https://bundler.io/docs.html] for extensive documentation
31
+ # on gemfiles creation and Bundler usage.
32
+ #
33
+ # As a standard library inside project, Bundler could be used for introspection
34
+ # of loaded and required modules.
35
+ #
17
36
  module Bundler
18
37
  environment_preserver = EnvironmentPreserver.new(ENV, EnvironmentPreserver::BUNDLER_KEYS)
19
38
  ORIGINAL_ENV = environment_preserver.restore
@@ -64,11 +83,11 @@ module Bundler
64
83
  end
65
84
 
66
85
  def ui
67
- (defined?(@ui) && @ui) || (self.ui = UI::Silent.new)
86
+ (defined?(@ui) && @ui) || (self.ui = UI::Shell.new)
68
87
  end
69
88
 
70
89
  def ui=(ui)
71
- Bundler.rubygems.ui = ui ? UI::RGProxy.new(ui) : nil
90
+ Bundler.rubygems.ui = UI::RGProxy.new(ui)
72
91
  @ui = ui
73
92
  end
74
93
 
@@ -91,6 +110,33 @@ module Bundler
91
110
  end
92
111
  end
93
112
 
113
+ # Turns on the Bundler runtime. After +Bundler.setup+ call, all +load+ or
114
+ # +require+ of the gems would be allowed only if they are part of
115
+ # the Gemfile or Ruby's standard library. If the versions specified
116
+ # in Gemfile, only those versions would be loaded.
117
+ #
118
+ # Assuming Gemfile
119
+ #
120
+ # gem 'first_gem', '= 1.0'
121
+ # group :test do
122
+ # gem 'second_gem', '= 1.0'
123
+ # end
124
+ #
125
+ # The code using Bundler.setup works as follows:
126
+ #
127
+ # require 'third_gem' # allowed, required from global gems
128
+ # require 'first_gem' # allowed, loads the last installed version
129
+ # Bundler.setup
130
+ # require 'fourth_gem' # fails with LoadError
131
+ # require 'second_gem' # loads exactly version 1.0
132
+ #
133
+ # +Bundler.setup+ can be called only once, all subsequent calls are no-op.
134
+ #
135
+ # If _groups_ list is provided, only gems from specified groups would
136
+ # be allowed (gems specified outside groups belong to special +:default+ group).
137
+ #
138
+ # To require all gems from Gemfile (or only some groups), see Bundler.require.
139
+ #
94
140
  def setup(*groups)
95
141
  # Return if all groups are already loaded
96
142
  return @setup if defined?(@setup) && @setup
@@ -107,6 +153,24 @@ module Bundler
107
153
  end
108
154
  end
109
155
 
156
+ # Setups Bundler environment (see Bundler.setup) if it is not already set,
157
+ # and loads all gems from groups specified. Unlike ::setup, can be called
158
+ # multiple times with different groups (if they were allowed by setup).
159
+ #
160
+ # Assuming Gemfile
161
+ #
162
+ # gem 'first_gem', '= 1.0'
163
+ # group :test do
164
+ # gem 'second_gem', '= 1.0'
165
+ # end
166
+ #
167
+ # The code will work as follows:
168
+ #
169
+ # Bundler.setup # allow all groups
170
+ # Bundler.require(:default) # requires only first_gem
171
+ # # ...later
172
+ # Bundler.require(:test) # requires second_gem
173
+ #
110
174
  def require(*groups)
111
175
  setup(*groups).require(*groups)
112
176
  end
@@ -116,7 +180,7 @@ module Bundler
116
180
  end
117
181
 
118
182
  def environment
119
- SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load"
183
+ SharedHelpers.major_deprecation 2, "Bundler.environment has been removed in favor of Bundler.load", :print_caller_location => true
120
184
  load
121
185
  end
122
186
 
@@ -167,8 +231,7 @@ module Bundler
167
231
  end
168
232
 
169
233
  if warning
170
- Kernel.send(:require, "etc")
171
- user_home = tmp_home_path(Etc.getlogin, warning)
234
+ user_home = tmp_home_path(warning)
172
235
  Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
173
236
  user_home
174
237
  else
@@ -177,21 +240,6 @@ module Bundler
177
240
  end
178
241
  end
179
242
 
180
- def tmp_home_path(login, warning)
181
- login ||= "unknown"
182
- Kernel.send(:require, "tmpdir")
183
- path = Pathname.new(Dir.tmpdir).join("bundler", "home")
184
- SharedHelpers.filesystem_access(path) do |tmp_home_path|
185
- unless tmp_home_path.exist?
186
- tmp_home_path.mkpath
187
- tmp_home_path.chmod(0o777)
188
- end
189
- tmp_home_path.join(login).tap(&:mkpath)
190
- end
191
- rescue RuntimeError => e
192
- raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
193
- end
194
-
195
243
  def user_bundle_path(dir = "home")
196
244
  env_var, fallback = case dir
197
245
  when "home"
@@ -282,7 +330,8 @@ EOF
282
330
  Bundler::SharedHelpers.major_deprecation(
283
331
  2,
284
332
  "`Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
285
- "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
333
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`",
334
+ :print_caller_location => true
286
335
  )
287
336
 
288
337
  unbundled_env
@@ -321,7 +370,8 @@ EOF
321
370
  Bundler::SharedHelpers.major_deprecation(
322
371
  2,
323
372
  "`Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
324
- "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
373
+ "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`",
374
+ :print_caller_location => true
325
375
  )
326
376
 
327
377
  with_env(unbundled_env) { yield }
@@ -342,7 +392,8 @@ EOF
342
392
  Bundler::SharedHelpers.major_deprecation(
343
393
  2,
344
394
  "`Bundler.clean_system` has been deprecated in favor of `Bundler.unbundled_system`. " \
345
- "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`"
395
+ "If you instead want to run the command in the environment before bundler was originally loaded, use `Bundler.original_system`",
396
+ :print_caller_location => true
346
397
  )
347
398
 
348
399
  with_env(unbundled_env) { Kernel.system(*args) }
@@ -363,7 +414,8 @@ EOF
363
414
  Bundler::SharedHelpers.major_deprecation(
364
415
  2,
365
416
  "`Bundler.clean_exec` has been deprecated in favor of `Bundler.unbundled_exec`. " \
366
- "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`"
417
+ "If you instead want to exec to a command in the environment before bundler was originally loaded, use `Bundler.original_exec`",
418
+ :print_caller_location => true
367
419
  )
368
420
 
369
421
  with_env(unbundled_env) { Kernel.exec(*args) }
@@ -608,6 +660,17 @@ EOF
608
660
  Bundler.rubygems.clear_paths
609
661
  end
610
662
 
663
+ def tmp_home_path(warning)
664
+ Kernel.send(:require, "tmpdir")
665
+ SharedHelpers.filesystem_access(Dir.tmpdir) do
666
+ path = Bundler.tmp
667
+ at_exit { Bundler.rm_rf(path) }
668
+ path
669
+ end
670
+ rescue RuntimeError => e
671
+ raise e.exception("#{warning}\nBundler also failed to create a temporary home directory':\n#{e}")
672
+ end
673
+
611
674
  # @param env [Hash]
612
675
  def with_env(env)
613
676
  backup = ENV.to_hash
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2019-09-15".freeze
8
- @git_commit_sha = "b0dcf5f7b".freeze
7
+ @built_at = "2019-11-12".freeze
8
+ @git_commit_sha = "9e06edc33".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -9,15 +9,19 @@ module Bundler
9
9
  package_name "Bundler"
10
10
 
11
11
  AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
12
- PARSEABLE_COMMANDS = %w[
13
- check config help exec platform show version
14
- ].freeze
12
+ PARSEABLE_COMMANDS = %w[check config help exec platform show version].freeze
13
+
14
+ COMMAND_ALIASES = {
15
+ "check" => "c",
16
+ "install" => "i",
17
+ "list" => "ls",
18
+ "exec" => ["e", "ex", "exe"],
19
+ "cache" => ["package", "pack"],
20
+ "version" => ["-v", "--version"],
21
+ }.freeze
15
22
 
16
23
  def self.start(*)
17
24
  super
18
- rescue Exception => e # rubocop:disable Lint/RescueException
19
- Bundler.ui = UI::Shell.new
20
- raise e
21
25
  ensure
22
26
  Bundler::SharedHelpers.print_major_deprecations!
23
27
  end
@@ -29,6 +33,24 @@ module Bundler
29
33
  end
30
34
  end
31
35
 
36
+ def self.all_aliases
37
+ @all_aliases ||= begin
38
+ command_aliases = {}
39
+
40
+ COMMAND_ALIASES.each do |name, aliases|
41
+ Array(aliases).each do |one_alias|
42
+ command_aliases[one_alias] = name
43
+ end
44
+ end
45
+
46
+ command_aliases
47
+ end
48
+ end
49
+
50
+ def self.aliases_for(command_name)
51
+ COMMAND_ALIASES.select {|k, _| k == command_name }.invert
52
+ end
53
+
32
54
  def initialize(*args)
33
55
  super
34
56
 
@@ -68,9 +90,7 @@ module Bundler
68
90
  version
69
91
  Bundler.ui.info "\n"
70
92
 
71
- primary_commands = ["install", "update",
72
- Bundler.feature_flag.bundler_3_mode? ? "cache" : "package",
73
- "exec", "config", "help"]
93
+ primary_commands = ["install", "update", "cache", "exec", "config", "help"]
74
94
 
75
95
  list = self.class.printable_commands(true)
76
96
  by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
@@ -154,7 +174,6 @@ module Bundler
154
174
  "Use the specified gemfile instead of Gemfile"
155
175
  method_option "path", :type => :string, :banner =>
156
176
  "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
157
- map "c" => "check"
158
177
  def check
159
178
  remembered_flag_deprecation("path")
160
179
 
@@ -162,6 +181,8 @@ module Bundler
162
181
  Check.new(options).run
163
182
  end
164
183
 
184
+ map aliases_for("check")
185
+
165
186
  desc "remove [GEM [GEM ...]]", "Removes gems from the Gemfile"
166
187
  long_desc <<-D
167
188
  Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
@@ -223,7 +244,6 @@ module Bundler
223
244
  "Exclude gems that are part of the specified named group."
224
245
  method_option "with", :type => :array, :banner =>
225
246
  "Include gems that are part of the specified named group."
226
- map "i" => "install"
227
247
  def install
228
248
  SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
229
249
 
@@ -237,6 +257,8 @@ module Bundler
237
257
  end
238
258
  end
239
259
 
260
+ map aliases_for("install")
261
+
240
262
  desc "update [OPTIONS]", "Update the current environment"
241
263
  long_desc <<-D
242
264
  Update will install the newest versions of the gems listed in the Gemfile. Use
@@ -328,7 +350,7 @@ module Bundler
328
350
  List.new(options).run
329
351
  end
330
352
 
331
- map %w[ls] => "list"
353
+ map aliases_for("list")
332
354
 
333
355
  desc "info GEM [OPTIONS]", "Show information for the given gem"
334
356
  method_option "path", :type => :boolean, :banner => "Print full path to gem"
@@ -412,7 +434,7 @@ module Bundler
412
434
  Outdated.new(options, gems).run
413
435
  end
414
436
 
415
- desc "#{Bundler.feature_flag.bundler_3_mode? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
437
+ desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
416
438
  unless Bundler.feature_flag.cache_all?
417
439
  method_option "all", :type => :boolean,
418
440
  :banner => "Include all sources (including path and git)."
@@ -421,24 +443,25 @@ module Bundler
421
443
  method_option "cache-path", :type => :string, :banner =>
422
444
  "Specify a different cache path than the default (vendor/cache)."
423
445
  method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
424
- method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only the package."
446
+ method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only update the cache."
425
447
  method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
426
448
  method_option "path", :type => :string, :banner =>
427
449
  "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
428
450
  method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
429
451
  method_option "frozen", :type => :boolean, :banner =>
430
- "Do not allow the Gemfile.lock to be updated after this package operation's install"
452
+ "Do not allow the Gemfile.lock to be updated after this bundle cache operation's install"
431
453
  long_desc <<-D
432
- The package command will copy the .gem files for every gem in the bundle into the
454
+ The cache command will copy the .gem files for every gem in the bundle into the
433
455
  directory ./vendor/cache. If you then check that directory into your source
434
456
  control repository, others who check out your source will be able to install the
435
457
  bundle without having to download any additional gems.
436
458
  D
437
- def package
438
- require_relative "cli/package"
439
- Package.new(options).run
459
+ def cache
460
+ require_relative "cli/cache"
461
+ Cache.new(options).run
440
462
  end
441
- map %w[cache pack] => :package
463
+
464
+ map aliases_for("cache")
442
465
 
443
466
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
444
467
  method_option :keep_file_descriptors, :type => :boolean, :default => false
@@ -448,12 +471,13 @@ module Bundler
448
471
  bundle exec you can require and call the bundled gems as if they were installed
449
472
  into the system wide RubyGems repository.
450
473
  D
451
- map "e" => "exec"
452
474
  def exec(*args)
453
475
  require_relative "cli/exec"
454
476
  Exec.new(options, args).run
455
477
  end
456
478
 
479
+ map aliases_for("exec")
480
+
457
481
  desc "config NAME [VALUE]", "Retrieve or set a configuration value"
458
482
  long_desc <<-D
459
483
  Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
@@ -496,7 +520,8 @@ module Bundler
496
520
  Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
497
521
  end
498
522
  end
499
- map %w[-v --version] => :version
523
+
524
+ map aliases_for("version")
500
525
 
501
526
  desc "licenses", "Prints the license of all gems in the bundle"
502
527
  def licenses
@@ -680,12 +705,17 @@ module Bundler
680
705
  # Reformat the arguments passed to bundle that include a --help flag
681
706
  # into the corresponding `bundle help #{command}` call
682
707
  def self.reformatted_help_args(args)
683
- bundler_commands = all_commands.keys
708
+ bundler_commands = (COMMAND_ALIASES.keys + COMMAND_ALIASES.values).flatten
709
+
684
710
  help_flags = %w[--help -h]
685
- exec_commands = %w[e ex exe exec]
711
+ exec_commands = ["exec"] + COMMAND_ALIASES["exec"]
712
+
686
713
  help_used = args.index {|a| help_flags.include? a }
687
714
  exec_used = args.index {|a| exec_commands.include? a }
715
+
688
716
  command = args.find {|a| bundler_commands.include? a }
717
+ command = all_aliases[command] if all_aliases[command]
718
+
689
719
  if exec_used && help_used
690
720
  if exec_used + help_used == 1
691
721
  %w[help exec]
@@ -790,7 +820,7 @@ module Bundler
790
820
 
791
821
  Bundler::SharedHelpers.major_deprecation 2,\
792
822
  "The `#{flag_name}` flag is deprecated because it relies on being " \
793
- "remembered accross bundler invokations, which bundler will no longer " \
823
+ "remembered across bundler invocations, which bundler will no longer " \
794
824
  "do in future versions. Instead please use `bundle config set #{name} " \
795
825
  "'#{value}'`, and stop using this flag"
796
826
  end
@@ -21,6 +21,7 @@ module Bundler
21
21
 
22
22
  def perform_bundle_install
23
23
  Installer.install(Bundler.root, Bundler.definition)
24
+ Bundler.load.cache if Bundler.app_cache.exist?
24
25
  end
25
26
 
26
27
  def inject_dependencies
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bundler
4
- class CLI::Package
4
+ class CLI::Cache
5
5
  attr_reader :options
6
6
 
7
7
  def initialize(options)
@@ -40,7 +40,7 @@ module Bundler
40
40
 
41
41
  if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
42
42
  Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
43
- "to package them as well, please pass the --all flag. This will be the default " \
43
+ "to cache them as well, please pass the --all flag. This will be the default " \
44
44
  "on Bundler 3.0."
45
45
  end
46
46
  end