bundler 2.0.2 → 2.1.0

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 (249) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +735 -574
  3. data/LICENSE.md +18 -19
  4. data/README.md +8 -7
  5. data/bundler.gemspec +5 -23
  6. data/exe/bundle +19 -3
  7. data/lib/bundler.rb +202 -87
  8. data/lib/bundler/build_metadata.rb +3 -3
  9. data/lib/bundler/capistrano.rb +5 -5
  10. data/lib/bundler/cli.rb +179 -143
  11. data/lib/bundler/cli/add.rb +28 -16
  12. data/lib/bundler/cli/cache.rb +25 -13
  13. data/lib/bundler/cli/common.rb +10 -11
  14. data/lib/bundler/cli/config.rb +161 -86
  15. data/lib/bundler/cli/console.rb +2 -2
  16. data/lib/bundler/cli/doctor.rb +4 -4
  17. data/lib/bundler/cli/exec.rb +15 -18
  18. data/lib/bundler/cli/gem.rb +5 -5
  19. data/lib/bundler/cli/info.rb +17 -5
  20. data/lib/bundler/cli/init.rb +1 -1
  21. data/lib/bundler/cli/install.rb +3 -3
  22. data/lib/bundler/cli/issue.rb +1 -1
  23. data/lib/bundler/cli/open.rb +10 -6
  24. data/lib/bundler/cli/outdated.rb +85 -81
  25. data/lib/bundler/cli/plugin.rb +9 -2
  26. data/lib/bundler/cli/pristine.rb +1 -1
  27. data/lib/bundler/cli/show.rb +1 -1
  28. data/lib/bundler/cli/update.rb +31 -11
  29. data/lib/bundler/compact_index_client.rb +25 -9
  30. data/lib/bundler/compact_index_client/updater.rb +2 -6
  31. data/lib/bundler/current_ruby.rb +8 -7
  32. data/lib/bundler/definition.rb +33 -26
  33. data/lib/bundler/dependency.rb +16 -4
  34. data/lib/bundler/deployment.rb +2 -2
  35. data/lib/bundler/dsl.rb +19 -43
  36. data/lib/bundler/env.rb +6 -5
  37. data/lib/bundler/environment_preserver.rb +0 -1
  38. data/lib/bundler/feature_flag.rb +1 -13
  39. data/lib/bundler/fetcher.rb +16 -13
  40. data/lib/bundler/fetcher/compact_index.rb +26 -12
  41. data/lib/bundler/fetcher/dependency.rb +1 -1
  42. data/lib/bundler/fetcher/downloader.rb +4 -1
  43. data/lib/bundler/fetcher/index.rb +5 -3
  44. data/lib/bundler/friendly_errors.rb +6 -7
  45. data/lib/bundler/gem_helper.rb +14 -14
  46. data/lib/bundler/gem_helpers.rb +2 -4
  47. data/lib/bundler/gem_tasks.rb +1 -1
  48. data/lib/bundler/gem_version_promoter.rb +3 -3
  49. data/lib/bundler/graph.rb +2 -2
  50. data/lib/bundler/injector.rb +3 -1
  51. data/lib/bundler/inline.rb +40 -30
  52. data/lib/bundler/installer.rb +7 -14
  53. data/lib/bundler/installer/gem_installer.rb +5 -1
  54. data/lib/bundler/installer/parallel_installer.rb +4 -4
  55. data/lib/bundler/installer/standalone.rb +1 -2
  56. data/lib/bundler/lazy_specification.rb +2 -3
  57. data/lib/bundler/lockfile_parser.rb +14 -21
  58. data/lib/bundler/match_platform.rb +1 -1
  59. data/lib/bundler/mirror.rb +3 -3
  60. data/lib/bundler/plugin.rb +29 -18
  61. data/lib/bundler/plugin/api.rb +1 -1
  62. data/lib/bundler/plugin/api/source.rb +4 -6
  63. data/lib/bundler/plugin/index.rb +10 -2
  64. data/lib/bundler/plugin/installer.rb +28 -15
  65. data/lib/bundler/psyched_yaml.rb +1 -1
  66. data/lib/bundler/remote_specification.rb +0 -2
  67. data/lib/bundler/resolver.rb +72 -24
  68. data/lib/bundler/resolver/spec_group.rb +3 -2
  69. data/lib/bundler/retry.rb +2 -2
  70. data/lib/bundler/ruby_version.rb +4 -19
  71. data/lib/bundler/rubygems_ext.rb +11 -66
  72. data/lib/bundler/rubygems_gem_installer.rb +1 -1
  73. data/lib/bundler/rubygems_integration.rb +133 -410
  74. data/lib/bundler/runtime.rb +2 -9
  75. data/lib/bundler/settings.rb +22 -52
  76. data/lib/bundler/setup.rb +7 -13
  77. data/lib/bundler/shared_helpers.rb +46 -74
  78. data/lib/bundler/similarity_detector.rb +2 -2
  79. data/lib/bundler/source.rb +5 -5
  80. data/lib/bundler/source/git.rb +24 -17
  81. data/lib/bundler/source/git/git_proxy.rb +38 -41
  82. data/lib/bundler/source/metadata.rb +7 -2
  83. data/lib/bundler/source/path.rb +13 -8
  84. data/lib/bundler/source/rubygems.rb +14 -8
  85. data/lib/bundler/source/rubygems/remote.rb +2 -3
  86. data/lib/bundler/source_list.rb +9 -12
  87. data/lib/bundler/spec_set.rb +1 -6
  88. data/lib/bundler/stub_specification.rb +18 -30
  89. data/lib/bundler/templates/Executable.bundler +22 -13
  90. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
  91. data/lib/bundler/templates/newgem/Gemfile.tt +8 -0
  92. data/lib/bundler/templates/newgem/README.md.tt +4 -3
  93. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -18
  94. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
  95. data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
  96. data/lib/bundler/ui.rb +3 -3
  97. data/lib/bundler/ui/rg_proxy.rb +1 -1
  98. data/lib/bundler/ui/shell.rb +4 -8
  99. data/lib/bundler/uri_credentials_filter.rb +7 -3
  100. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
  101. data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
  102. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
  103. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  104. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +134 -111
  105. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +6 -6
  106. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  107. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
  108. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
  109. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
  110. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
  111. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
  112. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
  113. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
  114. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +30 -8
  115. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
  116. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +4 -4
  117. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
  118. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +273 -304
  119. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
  120. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
  121. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  122. data/lib/bundler/vendor/thor/lib/thor.rb +19 -4
  123. data/lib/bundler/vendor/thor/lib/thor/actions.rb +17 -12
  124. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
  125. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -1
  126. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
  127. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +5 -5
  128. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
  129. data/lib/bundler/vendor/thor/lib/thor/base.rb +51 -39
  130. data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
  131. data/lib/bundler/vendor/thor/lib/thor/error.rb +14 -18
  132. data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
  133. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
  134. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
  135. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
  136. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
  137. data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  138. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
  139. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +2 -2
  140. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
  141. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -3
  142. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  143. data/lib/bundler/vendor/thor/lib/thor/runner.rb +13 -12
  144. data/lib/bundler/vendor/thor/lib/thor/shell.rb +3 -3
  145. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
  146. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -2
  147. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
  148. data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
  149. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  150. data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  151. data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  152. data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  153. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  154. data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  155. data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  156. data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  157. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  158. data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  159. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  160. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  161. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  162. data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  163. data/lib/bundler/vendored_fileutils.rb +1 -6
  164. data/lib/bundler/vendored_molinillo.rb +1 -1
  165. data/lib/bundler/vendored_persistent.rb +7 -5
  166. data/lib/bundler/vendored_thor.rb +2 -2
  167. data/lib/bundler/vendored_uri.rb +4 -0
  168. data/lib/bundler/version.rb +1 -20
  169. data/lib/bundler/version_ranges.rb +51 -5
  170. data/lib/bundler/vlad.rb +3 -3
  171. data/lib/bundler/worker.rb +1 -3
  172. data/lib/bundler/yaml_serializer.rb +2 -3
  173. data/man/bundle-add.1 +10 -2
  174. data/man/bundle-add.1.txt +11 -5
  175. data/man/bundle-add.ronn +7 -1
  176. data/man/bundle-binstubs.1 +2 -2
  177. data/man/bundle-binstubs.1.txt +2 -2
  178. data/man/bundle-binstubs.ronn +1 -1
  179. data/man/bundle-cache.1 +55 -0
  180. data/man/bundle-cache.1.txt +78 -0
  181. data/man/{bundle-package.ronn → bundle-cache.ronn} +15 -15
  182. data/man/bundle-check.1 +1 -1
  183. data/man/bundle-check.1.txt +6 -6
  184. data/man/bundle-clean.1 +1 -1
  185. data/man/bundle-clean.1.txt +1 -1
  186. data/man/bundle-config.1 +35 -35
  187. data/man/bundle-config.1.txt +65 -66
  188. data/man/bundle-config.ronn +41 -39
  189. data/man/bundle-doctor.1 +1 -1
  190. data/man/bundle-doctor.1.txt +1 -1
  191. data/man/bundle-exec.1 +2 -2
  192. data/man/bundle-exec.1.txt +2 -2
  193. data/man/bundle-exec.ronn +1 -1
  194. data/man/bundle-gem.1 +1 -1
  195. data/man/bundle-gem.1.txt +3 -3
  196. data/man/bundle-info.1 +1 -1
  197. data/man/bundle-info.1.txt +1 -1
  198. data/man/bundle-init.1 +1 -1
  199. data/man/bundle-init.1.txt +1 -1
  200. data/man/bundle-inject.1 +1 -1
  201. data/man/bundle-inject.1.txt +1 -1
  202. data/man/bundle-install.1 +8 -5
  203. data/man/bundle-install.1.txt +56 -51
  204. data/man/bundle-install.ronn +9 -4
  205. data/man/bundle-list.1 +1 -1
  206. data/man/bundle-list.1.txt +1 -1
  207. data/man/bundle-lock.1 +1 -1
  208. data/man/bundle-lock.1.txt +16 -16
  209. data/man/bundle-open.1 +1 -1
  210. data/man/bundle-open.1.txt +1 -1
  211. data/man/bundle-outdated.1 +1 -1
  212. data/man/bundle-outdated.1.txt +1 -1
  213. data/man/bundle-platform.1 +1 -1
  214. data/man/bundle-platform.1.txt +1 -1
  215. data/man/bundle-pristine.1 +1 -1
  216. data/man/bundle-pristine.1.txt +1 -1
  217. data/man/bundle-remove.1 +1 -1
  218. data/man/bundle-remove.1.txt +1 -1
  219. data/man/bundle-show.1 +1 -1
  220. data/man/bundle-show.1.txt +1 -1
  221. data/man/bundle-update.1 +4 -4
  222. data/man/bundle-update.1.txt +64 -65
  223. data/man/bundle-update.ronn +3 -3
  224. data/man/bundle-viz.1 +1 -1
  225. data/man/bundle-viz.1.txt +1 -1
  226. data/man/bundle.1 +2 -2
  227. data/man/bundle.1.txt +7 -7
  228. data/man/bundle.ronn +1 -1
  229. data/man/gemfile.5 +12 -15
  230. data/man/gemfile.5.ronn +9 -13
  231. data/man/gemfile.5.txt +103 -107
  232. data/man/index.txt +1 -1
  233. metadata +30 -120
  234. data/exe/bundle_ruby +0 -60
  235. data/lib/bundler/cli/package.rb +0 -49
  236. data/lib/bundler/compatibility_guard.rb +0 -13
  237. data/lib/bundler/gem_remote_fetcher.rb +0 -43
  238. data/lib/bundler/ssl_certs/.document +0 -1
  239. data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
  240. data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
  241. data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
  242. data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
  243. data/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
  244. data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
  245. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
  246. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
  247. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
  248. data/man/bundle-package.1 +0 -55
  249. data/man/bundle-package.1.txt +0 -79
@@ -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-06-13".freeze
8
- @git_commit_sha = "496bca538".freeze
7
+ @built_at = "2019-12-15".freeze
8
+ @git_commit_sha = "683fe9799e".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -25,7 +25,7 @@ module Bundler
25
25
 
26
26
  # The SHA for the git commit the bundler gem was built from.
27
27
  def self.git_commit_sha
28
- return @git_commit_sha if @git_commit_sha
28
+ return @git_commit_sha if instance_variable_defined? :@git_commit_sha
29
29
 
30
30
  # If Bundler has been installed without its .git directory and without a
31
31
  # commit instance variable then we can't determine its commits SHA.
@@ -1,18 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler/shared_helpers"
4
- Bundler::SharedHelpers.major_deprecation 3,
5
- "The Bundler task for Capistrano. Please use http://github.com/capistrano/bundler"
3
+ require_relative "shared_helpers"
4
+ Bundler::SharedHelpers.major_deprecation 2,
5
+ "The Bundler task for Capistrano. Please use https://github.com/capistrano/bundler"
6
6
 
7
7
  # Capistrano task for Bundler.
8
8
  #
9
9
  # Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and
10
10
  # Bundler will be activated after each new deployment.
11
- require "bundler/deployment"
11
+ require_relative "deployment"
12
12
  require "capistrano/version"
13
13
 
14
14
  if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
15
- raise "For Capistrano 3.x integration, please use http://github.com/capistrano/bundler"
15
+ raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler"
16
16
  end
17
17
 
18
18
  Capistrano::Configuration.instance(:must_exist).load do
@@ -1,24 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "bundler"
4
- require "bundler/vendored_thor"
3
+ require_relative "vendored_thor"
5
4
 
6
5
  module Bundler
7
6
  class CLI < Thor
8
- require "bundler/cli/common"
7
+ require_relative "cli/common"
9
8
 
10
9
  package_name "Bundler"
11
10
 
12
11
  AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
13
- PARSEABLE_COMMANDS = %w[
14
- check config help exec platform show version
15
- ].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
16
22
 
17
23
  def self.start(*)
18
24
  super
19
- rescue Exception => e
20
- Bundler.ui = UI::Shell.new
21
- raise e
22
25
  ensure
23
26
  Bundler::SharedHelpers.print_major_deprecations!
24
27
  end
@@ -30,6 +33,24 @@ module Bundler
30
33
  end
31
34
  end
32
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
+
33
54
  def initialize(*args)
34
55
  super
35
56
 
@@ -61,11 +82,6 @@ module Bundler
61
82
  end
62
83
  end
63
84
 
64
- def self.deprecated_option(*args, &blk)
65
- return if Bundler.feature_flag.forget_cli_options?
66
- method_option(*args, &blk)
67
- end
68
-
69
85
  check_unknown_options!(:except => [:config, :exec])
70
86
  stop_on_unknown_option! :exec
71
87
 
@@ -74,9 +90,7 @@ module Bundler
74
90
  version
75
91
  Bundler.ui.info "\n"
76
92
 
77
- primary_commands = ["install", "update",
78
- Bundler.feature_flag.cache_command_is_package? ? "cache" : "package",
79
- "exec", "config", "help"]
93
+ primary_commands = ["install", "update", "cache", "exec", "config", "help"]
80
94
 
81
95
  list = self.class.printable_commands(true)
82
96
  by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
@@ -142,9 +156,9 @@ module Bundler
142
156
  Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
143
157
  dependency listed in the gemspec file to the newly created Gemfile.
144
158
  D
145
- deprecated_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
159
+ method_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
146
160
  def init
147
- require "bundler/cli/init"
161
+ require_relative "cli/init"
148
162
  Init.new(options.dup).run
149
163
  end
150
164
 
@@ -160,12 +174,15 @@ module Bundler
160
174
  "Use the specified gemfile instead of Gemfile"
161
175
  method_option "path", :type => :string, :banner =>
162
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?}"
163
- map "c" => "check"
164
177
  def check
165
- require "bundler/cli/check"
178
+ remembered_flag_deprecation("path")
179
+
180
+ require_relative "cli/check"
166
181
  Check.new(options).run
167
182
  end
168
183
 
184
+ map aliases_for("check")
185
+
169
186
  desc "remove [GEM [GEM ...]]", "Removes gems from the Gemfile"
170
187
  long_desc <<-D
171
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.
@@ -173,7 +190,7 @@ module Bundler
173
190
  method_option "install", :type => :boolean, :banner =>
174
191
  "Runs 'bundle install' after removing the gems from the Gemfile"
175
192
  def remove(*gems)
176
- require "bundler/cli/remove"
193
+ require_relative "cli/remove"
177
194
  Remove.new(gems, options).run
178
195
  end
179
196
 
@@ -188,13 +205,13 @@ module Bundler
188
205
 
189
206
  If the bundle has already been installed, bundler will tell you so and then exit.
190
207
  D
191
- deprecated_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
208
+ method_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
192
209
  "Generate bin stubs for bundled gems to ./bin"
193
- deprecated_option "clean", :type => :boolean, :banner =>
210
+ method_option "clean", :type => :boolean, :banner =>
194
211
  "Run bundle clean automatically after install"
195
- deprecated_option "deployment", :type => :boolean, :banner =>
212
+ method_option "deployment", :type => :boolean, :banner =>
196
213
  "Install using defaults tuned for deployment environments"
197
- deprecated_option "frozen", :type => :boolean, :banner =>
214
+ method_option "frozen", :type => :boolean, :banner =>
198
215
  "Do not allow the Gemfile.lock to be updated after this install"
199
216
  method_option "full-index", :type => :boolean, :banner =>
200
217
  "Fall back to using the single-file index of all gems"
@@ -204,38 +221,44 @@ module Bundler
204
221
  "Specify the number of jobs to run in parallel"
205
222
  method_option "local", :type => :boolean, :banner =>
206
223
  "Do not attempt to fetch gems remotely and use the gem cache instead"
207
- deprecated_option "no-cache", :type => :boolean, :banner =>
224
+ method_option "no-cache", :type => :boolean, :banner =>
208
225
  "Don't update the existing gem cache."
209
226
  method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
210
227
  "Force downloading every gem."
211
- deprecated_option "no-prune", :type => :boolean, :banner =>
228
+ method_option "no-prune", :type => :boolean, :banner =>
212
229
  "Don't remove stale gems from the cache."
213
- deprecated_option "path", :type => :string, :banner =>
214
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
230
+ method_option "path", :type => :string, :banner =>
231
+ "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?}"
215
232
  method_option "quiet", :type => :boolean, :banner =>
216
233
  "Only output warnings and errors."
217
- deprecated_option "shebang", :type => :string, :banner =>
234
+ method_option "shebang", :type => :string, :banner =>
218
235
  "Specify a different shebang executable name than the default (usually 'ruby')"
219
236
  method_option "standalone", :type => :array, :lazy_default => [], :banner =>
220
237
  "Make a bundle that can work without the Bundler runtime"
221
- deprecated_option "system", :type => :boolean, :banner =>
238
+ method_option "system", :type => :boolean, :banner =>
222
239
  "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
223
240
  method_option "trust-policy", :alias => "P", :type => :string, :banner =>
224
241
  "Gem trust policy (like gem install -P). Must be one of " +
225
242
  Bundler.rubygems.security_policy_keys.join("|")
226
- deprecated_option "without", :type => :array, :banner =>
243
+ method_option "without", :type => :array, :banner =>
227
244
  "Exclude gems that are part of the specified named group."
228
- deprecated_option "with", :type => :array, :banner =>
245
+ method_option "with", :type => :array, :banner =>
229
246
  "Include gems that are part of the specified named group."
230
- map "i" => "install"
231
247
  def install
232
- SharedHelpers.major_deprecation(3, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
233
- require "bundler/cli/install"
248
+ SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
249
+
250
+ %w[clean deployment frozen no-cache no-prune path shebang system without with].each do |option|
251
+ remembered_flag_deprecation(option)
252
+ end
253
+
254
+ require_relative "cli/install"
234
255
  Bundler.settings.temporary(:no_install => false) do
235
256
  Install.new(options.dup).run
236
257
  end
237
258
  end
238
259
 
260
+ map aliases_for("install")
261
+
239
262
  desc "update [OPTIONS]", "Update the current environment"
240
263
  long_desc <<-D
241
264
  Update will install the newest versions of the gems listed in the Gemfile. Use
@@ -275,63 +298,64 @@ module Bundler
275
298
  method_option "all", :type => :boolean, :banner =>
276
299
  "Update everything."
277
300
  def update(*gems)
278
- SharedHelpers.major_deprecation(3, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
279
- require "bundler/cli/update"
301
+ SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
302
+ require_relative "cli/update"
280
303
  Bundler.settings.temporary(:no_install => false) do
281
304
  Update.new(options, gems).run
282
305
  end
283
306
  end
284
307
 
285
- desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
286
- long_desc <<-D
287
- Show lists the names and versions of all gems that are required by your Gemfile.
288
- Calling show with [GEM] will list the exact location of that gem on your machine.
289
- D
290
- method_option "paths", :type => :boolean,
291
- :banner => "List the paths of all gems that are required by your Gemfile."
292
- method_option "outdated", :type => :boolean,
293
- :banner => "Show verbose output including whether gems are outdated."
294
- def show(gem_name = nil)
295
- if ARGV[0] == "show"
296
- rest = ARGV[1..-1]
297
-
298
- new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
299
-
300
- new_arguments = rest.map do |arg|
301
- next arg if arg != "--paths"
302
- next "--path" if new_command == "info"
308
+ unless Bundler.feature_flag.bundler_3_mode?
309
+ desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
310
+ long_desc <<-D
311
+ Show lists the names and versions of all gems that are required by your Gemfile.
312
+ Calling show with [GEM] will list the exact location of that gem on your machine.
313
+ D
314
+ method_option "paths", :type => :boolean,
315
+ :banner => "List the paths of all gems that are required by your Gemfile."
316
+ method_option "outdated", :type => :boolean,
317
+ :banner => "Show verbose output including whether gems are outdated."
318
+ def show(gem_name = nil)
319
+ if ARGV[0] == "show"
320
+ rest = ARGV[1..-1]
321
+
322
+ if flag = rest.find{|arg| ["--verbose", "--outdated"].include?(arg) }
323
+ Bundler::SharedHelpers.major_deprecation(2, "the `#{flag}` flag to `bundle show` was undocumented and will be removed without replacement")
324
+ else
325
+ new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
326
+
327
+ new_arguments = rest.map do |arg|
328
+ next arg if arg != "--paths"
329
+ next "--path" if new_command == "info"
330
+ end
331
+
332
+ old_argv = ARGV.join(" ")
333
+ new_argv = [new_command, *new_arguments.compact].join(" ")
334
+
335
+ Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
336
+ end
303
337
  end
304
-
305
- old_argv = ARGV.join(" ")
306
- new_argv = [new_command, *new_arguments.compact].join(" ")
307
-
308
- Bundler::SharedHelpers.major_deprecation(3, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
309
- end
310
- require "bundler/cli/show"
311
- Show.new(options, gem_name).run
312
- end
313
- # TODO: 2.0 remove `bundle show`
314
-
315
- if Bundler.feature_flag.list_command?
316
- desc "list", "List all gems in the bundle"
317
- method_option "name-only", :type => :boolean, :banner => "print only the gem names"
318
- method_option "only-group", :type => :string, :banner => "print gems from a particular group"
319
- method_option "without-group", :type => :string, :banner => "print all gems expect from a group"
320
- method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
321
- def list
322
- require "bundler/cli/list"
323
- List.new(options).run
338
+ require_relative "cli/show"
339
+ Show.new(options, gem_name).run
324
340
  end
341
+ end
325
342
 
326
- map %w[ls] => "list"
327
- else
328
- map %w[list] => "show"
343
+ desc "list", "List all gems in the bundle"
344
+ method_option "name-only", :type => :boolean, :banner => "print only the gem names"
345
+ method_option "only-group", :type => :string, :banner => "print gems from a particular group"
346
+ method_option "without-group", :type => :string, :banner => "print all gems except from a group"
347
+ method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
348
+ def list
349
+ require_relative "cli/list"
350
+ List.new(options).run
329
351
  end
330
352
 
353
+ map aliases_for("list")
354
+
331
355
  desc "info GEM [OPTIONS]", "Show information for the given gem"
332
356
  method_option "path", :type => :boolean, :banner => "Print full path to gem"
333
357
  def info(gem_name)
334
- require "bundler/cli/info"
358
+ require_relative "cli/info"
335
359
  Info.new(options, gem_name).run
336
360
  end
337
361
 
@@ -352,7 +376,7 @@ module Bundler
352
376
  method_option "all", :type => :boolean, :banner =>
353
377
  "Install binstubs for all gems"
354
378
  def binstubs(*gems)
355
- require "bundler/cli/binstubs"
379
+ require_relative "cli/binstubs"
356
380
  Binstubs.new(options, gems).run
357
381
  end
358
382
 
@@ -363,12 +387,14 @@ module Bundler
363
387
  method_option "version", :aliases => "-v", :type => :string
364
388
  method_option "group", :aliases => "-g", :type => :string
365
389
  method_option "source", :aliases => "-s", :type => :string
390
+ method_option "git", :type => :string
391
+ method_option "branch", :type => :string
366
392
  method_option "skip-install", :type => :boolean, :banner =>
367
393
  "Adds gem to the Gemfile but does not install it"
368
394
  method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
369
395
  method_option "strict", :type => :boolean, :banner => "Adds strict declaration of version to gem"
370
396
  def add(*gems)
371
- require "bundler/cli/add"
397
+ require_relative "cli/add"
372
398
  Add.new(options.dup, gems).run
373
399
  end
374
400
 
@@ -388,9 +414,10 @@ module Bundler
388
414
  "Do not attempt to fetch gems remotely and use the gem cache instead"
389
415
  method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
390
416
  method_option "source", :type => :array, :banner => "Check against a specific source"
391
- method_option "strict", :type => :boolean, :banner =>
417
+ strict_is_update = Bundler.feature_flag.forget_cli_options?
418
+ method_option "filter-strict", :type => :boolean, :aliases => strict_is_update ? [] : %w[--strict], :banner =>
392
419
  "Only list newer versions allowed by your Gemfile requirements"
393
- method_option "update-strict", :type => :boolean, :banner =>
420
+ method_option "update-strict", :type => :boolean, :aliases => strict_is_update ? %w[--strict] : [], :banner =>
394
421
  "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
395
422
  method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
396
423
  method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
@@ -403,28 +430,12 @@ module Bundler
403
430
  method_option "only-explicit", :type => :boolean, :banner =>
404
431
  "Only list gems specified in your Gemfile, not their dependencies"
405
432
  def outdated(*gems)
406
- require "bundler/cli/outdated"
433
+ require_relative "cli/outdated"
407
434
  Outdated.new(options, gems).run
408
435
  end
409
436
 
410
- if Bundler.feature_flag.cache_command_is_package?
411
- map %w[cache] => :package
412
- else
413
- desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
414
- unless Bundler.feature_flag.cache_command_is_package?
415
- method_option "all", :type => :boolean,
416
- :banner => "Include all sources (including path and git)."
417
- end
418
- method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
419
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
420
- def cache
421
- require "bundler/cli/cache"
422
- Cache.new(options).run
423
- end
424
- end
425
-
426
- desc "#{Bundler.feature_flag.cache_command_is_package? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
427
- unless Bundler.feature_flag.cache_command_is_package?
437
+ desc "cache [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
438
+ unless Bundler.feature_flag.cache_all?
428
439
  method_option "all", :type => :boolean,
429
440
  :banner => "Include all sources (including path and git)."
430
441
  end
@@ -432,24 +443,25 @@ module Bundler
432
443
  method_option "cache-path", :type => :string, :banner =>
433
444
  "Specify a different cache path than the default (vendor/cache)."
434
445
  method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
435
- 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."
436
447
  method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
437
448
  method_option "path", :type => :string, :banner =>
438
- "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
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?}"
439
450
  method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
440
451
  method_option "frozen", :type => :boolean, :banner =>
441
- "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"
442
453
  long_desc <<-D
443
- 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
444
455
  directory ./vendor/cache. If you then check that directory into your source
445
456
  control repository, others who check out your source will be able to install the
446
457
  bundle without having to download any additional gems.
447
458
  D
448
- def package
449
- require "bundler/cli/package"
450
- Package.new(options).run
459
+ def cache
460
+ require_relative "cli/cache"
461
+ Cache.new(options).run
451
462
  end
452
- map %w[pack] => :package
463
+
464
+ map aliases_for("cache")
453
465
 
454
466
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
455
467
  method_option :keep_file_descriptors, :type => :boolean, :default => false
@@ -459,12 +471,13 @@ module Bundler
459
471
  bundle exec you can require and call the bundled gems as if they were installed
460
472
  into the system wide RubyGems repository.
461
473
  D
462
- map "e" => "exec"
463
474
  def exec(*args)
464
- require "bundler/cli/exec"
475
+ require_relative "cli/exec"
465
476
  Exec.new(options, args).run
466
477
  end
467
478
 
479
+ map aliases_for("exec")
480
+
468
481
  desc "config NAME [VALUE]", "Retrieve or set a configuration value"
469
482
  long_desc <<-D
470
483
  Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
@@ -477,22 +490,19 @@ module Bundler
477
490
  will show the current value, as well as any superceded values and
478
491
  where they were specified.
479
492
  D
480
- method_option "parseable", :type => :boolean, :banner => "Use minimal formatting for more parseable output"
481
- def config(*args)
482
- require "bundler/cli/config"
483
- Config.new(options, args, self).run
484
- end
493
+ require_relative "cli/config"
494
+ subcommand "config", Config
485
495
 
486
496
  desc "open GEM", "Opens the source directory of the given bundled gem"
487
497
  def open(name)
488
- require "bundler/cli/open"
498
+ require_relative "cli/open"
489
499
  Open.new(options, name).run
490
500
  end
491
501
 
492
- if Bundler.feature_flag.console_command?
502
+ unless Bundler.feature_flag.bundler_3_mode?
493
503
  desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
494
504
  def console(group = nil)
495
- require "bundler/cli/console"
505
+ require_relative "cli/console"
496
506
  Console.new(options, group).run
497
507
  end
498
508
  end
@@ -510,7 +520,8 @@ module Bundler
510
520
  Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
511
521
  end
512
522
  end
513
- map %w[-v --version] => :version
523
+
524
+ map aliases_for("version")
514
525
 
515
526
  desc "licenses", "Prints the license of all gems in the bundle"
516
527
  def licenses
@@ -526,7 +537,7 @@ module Bundler
526
537
  end
527
538
  end
528
539
 
529
- if Bundler.feature_flag.viz_command?
540
+ unless Bundler.feature_flag.bundler_3_mode?
530
541
  desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
531
542
  long_desc <<-D
532
543
  Viz generates a PNG file of the current Gemfile as a dependency graph.
@@ -539,8 +550,8 @@ module Bundler
539
550
  method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
540
551
  method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
541
552
  def viz
542
- SharedHelpers.major_deprecation 3, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
543
- require "bundler/cli/viz"
553
+ SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
554
+ require_relative "cli/viz"
544
555
  Viz.new(options.dup).run
545
556
  end
546
557
  end
@@ -549,14 +560,15 @@ module Bundler
549
560
 
550
561
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
551
562
  method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
552
- method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
563
+ method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set gem.coc true`."
553
564
  method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
554
565
  :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
555
566
  :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
556
567
  method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
557
- method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config gem.mit true`."
568
+ method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
569
+ method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
558
570
  method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
559
- :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config gem.test rspec`."
571
+ :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config set gem.test rspec`."
560
572
  def gem(name)
561
573
  end
562
574
 
@@ -564,7 +576,7 @@ module Bundler
564
576
  def gem_command.run(instance, args = [])
565
577
  arity = 1 # name
566
578
 
567
- require "bundler/cli/gem"
579
+ require_relative "cli/gem"
568
580
  cmd_args = args + [instance]
569
581
  cmd_args.unshift(instance.options)
570
582
 
@@ -592,7 +604,7 @@ module Bundler
592
604
  method_option "force", :type => :boolean, :default => false, :banner =>
593
605
  "Forces clean even if --path is not set"
594
606
  def clean
595
- require "bundler/cli/clean"
607
+ require_relative "cli/clean"
596
608
  Clean.new(options.dup).run
597
609
  end
598
610
 
@@ -600,7 +612,7 @@ module Bundler
600
612
  method_option "ruby", :type => :boolean, :default => false, :banner =>
601
613
  "only display ruby related platform information"
602
614
  def platform
603
- require "bundler/cli/platform"
615
+ require_relative "cli/platform"
604
616
  Platform.new(options).run
605
617
  end
606
618
 
@@ -610,8 +622,8 @@ module Bundler
610
622
  method_option "group", :type => :string, :banner =>
611
623
  "Install gem into a bundler group"
612
624
  def inject(name, version)
613
- SharedHelpers.major_deprecation 3, "The `inject` command has been replaced by the `add` command"
614
- require "bundler/cli/inject"
625
+ SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
626
+ require_relative "cli/inject"
615
627
  Inject.new(options.dup, name, version).run
616
628
  end
617
629
 
@@ -622,6 +634,8 @@ module Bundler
622
634
  "do not attempt to fetch remote gemspecs and use the local gem cache only"
623
635
  method_option "print", :type => :boolean, :default => false, :banner =>
624
636
  "print the lockfile to STDOUT instead of writing to the file system"
637
+ method_option "gemfile", :type => :string, :banner =>
638
+ "Use the specified gemfile instead of Gemfile"
625
639
  method_option "lockfile", :type => :string, :default => nil, :banner =>
626
640
  "the path the lockfile should be written to"
627
641
  method_option "full-index", :type => :boolean, :default => false, :banner =>
@@ -641,7 +655,7 @@ module Bundler
641
655
  method_option "conservative", :type => :boolean, :banner =>
642
656
  "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
643
657
  def lock
644
- require "bundler/cli/lock"
658
+ require_relative "cli/lock"
645
659
  Lock.new(options).run
646
660
  end
647
661
 
@@ -661,13 +675,13 @@ module Bundler
661
675
  method_option "quiet", :type => :boolean, :banner =>
662
676
  "Only output warnings and errors."
663
677
  def doctor
664
- require "bundler/cli/doctor"
678
+ require_relative "cli/doctor"
665
679
  Doctor.new(options).run
666
680
  end
667
681
 
668
682
  desc "issue", "Learn how to report an issue in Bundler"
669
683
  def issue
670
- require "bundler/cli/issue"
684
+ require_relative "cli/issue"
671
685
  Issue.new.run
672
686
  end
673
687
 
@@ -678,12 +692,12 @@ module Bundler
678
692
  checkout --force`.
679
693
  D
680
694
  def pristine(*gems)
681
- require "bundler/cli/pristine"
695
+ require_relative "cli/pristine"
682
696
  Pristine.new(gems).run
683
697
  end
684
698
 
685
699
  if Bundler.feature_flag.plugins?
686
- require "bundler/cli/plugin"
700
+ require_relative "cli/plugin"
687
701
  desc "plugin", "Manage the bundler plugins"
688
702
  subcommand "plugin", Plugin
689
703
  end
@@ -691,12 +705,17 @@ module Bundler
691
705
  # Reformat the arguments passed to bundle that include a --help flag
692
706
  # into the corresponding `bundle help #{command}` call
693
707
  def self.reformatted_help_args(args)
694
- bundler_commands = all_commands.keys
708
+ bundler_commands = (COMMAND_ALIASES.keys + COMMAND_ALIASES.values).flatten
709
+
695
710
  help_flags = %w[--help -h]
696
- exec_commands = %w[e ex exe exec]
711
+ exec_commands = ["exec"] + COMMAND_ALIASES["exec"]
712
+
697
713
  help_used = args.index {|a| help_flags.include? a }
698
714
  exec_used = args.index {|a| exec_commands.include? a }
715
+
699
716
  command = args.find {|a| bundler_commands.include? a }
717
+ command = all_aliases[command] if all_aliases[command]
718
+
700
719
  if exec_used && help_used
701
720
  if exec_used + help_used == 1
702
721
  %w[help exec]
@@ -716,7 +735,7 @@ module Bundler
716
735
 
717
736
  # Automatically invoke `bundle install` and resume if
718
737
  # Bundler.settings[:auto_install] exists. This is set through config cmd
719
- # `bundle config auto_install 1`.
738
+ # `bundle config set auto_install 1`.
720
739
  #
721
740
  # Note that this method `nil`s out the global Definition object, so it
722
741
  # should be called first, before you instantiate anything like an
@@ -764,7 +783,7 @@ module Bundler
764
783
  return unless SharedHelpers.md5_available?
765
784
 
766
785
  latest = Fetcher::CompactIndex.
767
- new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
786
+ new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
768
787
  send(:compact_index_client).
769
788
  instance_variable_get(:@cache).
770
789
  dependencies("bundler").
@@ -788,5 +807,22 @@ module Bundler
788
807
  rescue RuntimeError
789
808
  nil
790
809
  end
810
+
811
+ def remembered_flag_deprecation(name)
812
+ option = current_command.options[name]
813
+ flag_name = option.switch_name
814
+
815
+ name_index = ARGV.find {|arg| flag_name == arg }
816
+ return unless name_index
817
+
818
+ value = options[name]
819
+ value = value.join(" ").to_s if option.type == :array
820
+
821
+ Bundler::SharedHelpers.major_deprecation 2,\
822
+ "The `#{flag_name}` flag is deprecated because it relies on being " \
823
+ "remembered across bundler invocations, which bundler will no longer " \
824
+ "do in future versions. Instead please use `bundle config set #{name} " \
825
+ "'#{value}'`, and stop using this flag"
826
+ end
791
827
  end
792
828
  end