bundler 2.0.0 → 2.1.2

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 +778 -572
  3. data/LICENSE.md +18 -19
  4. data/README.md +9 -8
  5. data/bundler.gemspec +8 -25
  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 +182 -144
  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 +11 -12
  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 +4 -16
  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 +12 -11
  22. data/lib/bundler/cli/issue.rb +3 -3
  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 +36 -27
  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 +8 -13
  37. data/lib/bundler/environment_preserver.rb +0 -1
  38. data/lib/bundler/feature_flag.rb +2 -14
  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 +5 -2
  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 +40 -25
  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 +10 -8
  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 -8
  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 +42 -29
  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 +14 -3
  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 -67
  72. data/lib/bundler/rubygems_gem_installer.rb +1 -1
  73. data/lib/bundler/rubygems_integration.rb +148 -398
  74. data/lib/bundler/runtime.rb +2 -9
  75. data/lib/bundler/settings.rb +22 -52
  76. data/lib/bundler/setup.rb +11 -12
  77. data/lib/bundler/shared_helpers.rb +51 -77
  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 +23 -14
  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 +6 -27
  94. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +1 -1
  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 +273 -147
  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 +27 -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 +16 -7
  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 +54 -43
  130. data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
  131. data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
  132. data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
  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 +20 -5
  142. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
  143. data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
  144. data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
  145. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +62 -8
  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 +36 -36
  187. data/man/bundle-config.1.txt +66 -67
  188. data/man/bundle-config.ronn +42 -40
  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 +2 -2
  199. data/man/bundle-init.1.txt +2 -2
  200. data/man/bundle-init.ronn +1 -1
  201. data/man/bundle-inject.1 +1 -1
  202. data/man/bundle-inject.1.txt +1 -1
  203. data/man/bundle-install.1 +8 -5
  204. data/man/bundle-install.1.txt +56 -51
  205. data/man/bundle-install.ronn +9 -4
  206. data/man/bundle-list.1 +1 -1
  207. data/man/bundle-list.1.txt +1 -1
  208. data/man/bundle-lock.1 +1 -1
  209. data/man/bundle-lock.1.txt +16 -16
  210. data/man/bundle-open.1 +1 -1
  211. data/man/bundle-open.1.txt +1 -1
  212. data/man/bundle-outdated.1 +1 -1
  213. data/man/bundle-outdated.1.txt +1 -1
  214. data/man/bundle-platform.1 +1 -1
  215. data/man/bundle-platform.1.txt +1 -1
  216. data/man/bundle-pristine.1 +1 -1
  217. data/man/bundle-pristine.1.txt +1 -1
  218. data/man/bundle-remove.1 +1 -1
  219. data/man/bundle-remove.1.txt +1 -1
  220. data/man/bundle-show.1 +1 -1
  221. data/man/bundle-show.1.txt +1 -1
  222. data/man/bundle-update.1 +4 -4
  223. data/man/bundle-update.1.txt +64 -65
  224. data/man/bundle-update.ronn +3 -3
  225. data/man/bundle-viz.1 +1 -1
  226. data/man/bundle-viz.1.txt +1 -1
  227. data/man/bundle.1 +3 -3
  228. data/man/bundle.1.txt +8 -8
  229. data/man/bundle.ronn +2 -2
  230. data/man/gemfile.5 +13 -16
  231. data/man/gemfile.5.ronn +10 -14
  232. data/man/gemfile.5.txt +104 -108
  233. data/man/index.txt +1 -1
  234. metadata +33 -108
  235. data/exe/bundle_ruby +0 -60
  236. data/lib/bundler/cli/package.rb +0 -49
  237. data/lib/bundler/compatibility_guard.rb +0 -14
  238. data/lib/bundler/gem_remote_fetcher.rb +0 -43
  239. data/lib/bundler/ssl_certs/.document +0 -1
  240. data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
  241. data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
  242. data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
  243. data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
  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-01-03".freeze
8
- @git_commit_sha = "d715ae9e6".freeze
7
+ @built_at = "2019-12-20".freeze
8
+ @git_commit_sha = "4da3289ebd".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,61 +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"
280
- Update.new(options, gems).run
301
+ SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
302
+ require_relative "cli/update"
303
+ Bundler.settings.temporary(:no_install => false) do
304
+ Update.new(options, gems).run
305
+ end
281
306
  end
282
307
 
283
- desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
284
- long_desc <<-D
285
- Show lists the names and versions of all gems that are required by your Gemfile.
286
- Calling show with [GEM] will list the exact location of that gem on your machine.
287
- D
288
- method_option "paths", :type => :boolean,
289
- :banner => "List the paths of all gems that are required by your Gemfile."
290
- method_option "outdated", :type => :boolean,
291
- :banner => "Show verbose output including whether gems are outdated."
292
- def show(gem_name = nil)
293
- if ARGV[0] == "show"
294
- rest = ARGV[1..-1]
295
-
296
- new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
297
-
298
- new_arguments = rest.map do |arg|
299
- next arg if arg != "--paths"
300
- 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
301
337
  end
302
-
303
- old_argv = ARGV.join(" ")
304
- new_argv = [new_command, *new_arguments.compact].join(" ")
305
-
306
- Bundler::SharedHelpers.major_deprecation(3, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
307
- end
308
- require "bundler/cli/show"
309
- Show.new(options, gem_name).run
310
- end
311
- # TODO: 2.0 remove `bundle show`
312
-
313
- if Bundler.feature_flag.list_command?
314
- desc "list", "List all gems in the bundle"
315
- method_option "name-only", :type => :boolean, :banner => "print only the gem names"
316
- method_option "only-group", :type => :string, :banner => "print gems from a particular group"
317
- method_option "without-group", :type => :string, :banner => "print all gems expect from a group"
318
- method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
319
- def list
320
- require "bundler/cli/list"
321
- List.new(options).run
338
+ require_relative "cli/show"
339
+ Show.new(options, gem_name).run
322
340
  end
341
+ end
323
342
 
324
- map %w[ls] => "list"
325
- else
326
- 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
327
351
  end
328
352
 
353
+ map aliases_for("list")
354
+
329
355
  desc "info GEM [OPTIONS]", "Show information for the given gem"
330
356
  method_option "path", :type => :boolean, :banner => "Print full path to gem"
331
357
  def info(gem_name)
332
- require "bundler/cli/info"
358
+ require_relative "cli/info"
333
359
  Info.new(options, gem_name).run
334
360
  end
335
361
 
@@ -350,7 +376,7 @@ module Bundler
350
376
  method_option "all", :type => :boolean, :banner =>
351
377
  "Install binstubs for all gems"
352
378
  def binstubs(*gems)
353
- require "bundler/cli/binstubs"
379
+ require_relative "cli/binstubs"
354
380
  Binstubs.new(options, gems).run
355
381
  end
356
382
 
@@ -361,12 +387,14 @@ module Bundler
361
387
  method_option "version", :aliases => "-v", :type => :string
362
388
  method_option "group", :aliases => "-g", :type => :string
363
389
  method_option "source", :aliases => "-s", :type => :string
390
+ method_option "git", :type => :string
391
+ method_option "branch", :type => :string
364
392
  method_option "skip-install", :type => :boolean, :banner =>
365
393
  "Adds gem to the Gemfile but does not install it"
366
394
  method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
367
395
  method_option "strict", :type => :boolean, :banner => "Adds strict declaration of version to gem"
368
396
  def add(*gems)
369
- require "bundler/cli/add"
397
+ require_relative "cli/add"
370
398
  Add.new(options.dup, gems).run
371
399
  end
372
400
 
@@ -386,9 +414,10 @@ module Bundler
386
414
  "Do not attempt to fetch gems remotely and use the gem cache instead"
387
415
  method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
388
416
  method_option "source", :type => :array, :banner => "Check against a specific source"
389
- 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 =>
390
419
  "Only list newer versions allowed by your Gemfile requirements"
391
- method_option "update-strict", :type => :boolean, :banner =>
420
+ method_option "update-strict", :type => :boolean, :aliases => strict_is_update ? %w[--strict] : [], :banner =>
392
421
  "Strict conservative resolution, do not allow any gem to be updated past latest --patch | --minor | --major"
393
422
  method_option "minor", :type => :boolean, :banner => "Prefer updating only to next minor version"
394
423
  method_option "major", :type => :boolean, :banner => "Prefer updating to next major version (default)"
@@ -401,28 +430,12 @@ module Bundler
401
430
  method_option "only-explicit", :type => :boolean, :banner =>
402
431
  "Only list gems specified in your Gemfile, not their dependencies"
403
432
  def outdated(*gems)
404
- require "bundler/cli/outdated"
433
+ require_relative "cli/outdated"
405
434
  Outdated.new(options, gems).run
406
435
  end
407
436
 
408
- if Bundler.feature_flag.cache_command_is_package?
409
- map %w[cache] => :package
410
- else
411
- desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
412
- unless Bundler.feature_flag.cache_command_is_package?
413
- method_option "all", :type => :boolean,
414
- :banner => "Include all sources (including path and git)."
415
- end
416
- method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
417
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
418
- def cache
419
- require "bundler/cli/cache"
420
- Cache.new(options).run
421
- end
422
- end
423
-
424
- desc "#{Bundler.feature_flag.cache_command_is_package? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
425
- 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?
426
439
  method_option "all", :type => :boolean,
427
440
  :banner => "Include all sources (including path and git)."
428
441
  end
@@ -430,24 +443,25 @@ module Bundler
430
443
  method_option "cache-path", :type => :string, :banner =>
431
444
  "Specify a different cache path than the default (vendor/cache)."
432
445
  method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
433
- 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."
434
447
  method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
435
448
  method_option "path", :type => :string, :banner =>
436
- "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?}"
437
450
  method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
438
451
  method_option "frozen", :type => :boolean, :banner =>
439
- "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"
440
453
  long_desc <<-D
441
- 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
442
455
  directory ./vendor/cache. If you then check that directory into your source
443
456
  control repository, others who check out your source will be able to install the
444
457
  bundle without having to download any additional gems.
445
458
  D
446
- def package
447
- require "bundler/cli/package"
448
- Package.new(options).run
459
+ def cache
460
+ require_relative "cli/cache"
461
+ Cache.new(options).run
449
462
  end
450
- map %w[pack] => :package
463
+
464
+ map aliases_for("cache")
451
465
 
452
466
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
453
467
  method_option :keep_file_descriptors, :type => :boolean, :default => false
@@ -457,12 +471,13 @@ module Bundler
457
471
  bundle exec you can require and call the bundled gems as if they were installed
458
472
  into the system wide RubyGems repository.
459
473
  D
460
- map "e" => "exec"
461
474
  def exec(*args)
462
- require "bundler/cli/exec"
475
+ require_relative "cli/exec"
463
476
  Exec.new(options, args).run
464
477
  end
465
478
 
479
+ map aliases_for("exec")
480
+
466
481
  desc "config NAME [VALUE]", "Retrieve or set a configuration value"
467
482
  long_desc <<-D
468
483
  Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
@@ -475,22 +490,19 @@ module Bundler
475
490
  will show the current value, as well as any superceded values and
476
491
  where they were specified.
477
492
  D
478
- method_option "parseable", :type => :boolean, :banner => "Use minimal formatting for more parseable output"
479
- def config(*args)
480
- require "bundler/cli/config"
481
- Config.new(options, args, self).run
482
- end
493
+ require_relative "cli/config"
494
+ subcommand "config", Config
483
495
 
484
496
  desc "open GEM", "Opens the source directory of the given bundled gem"
485
497
  def open(name)
486
- require "bundler/cli/open"
498
+ require_relative "cli/open"
487
499
  Open.new(options, name).run
488
500
  end
489
501
 
490
- if Bundler.feature_flag.console_command?
502
+ unless Bundler.feature_flag.bundler_3_mode?
491
503
  desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
492
504
  def console(group = nil)
493
- require "bundler/cli/console"
505
+ require_relative "cli/console"
494
506
  Console.new(options, group).run
495
507
  end
496
508
  end
@@ -508,7 +520,8 @@ module Bundler
508
520
  Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
509
521
  end
510
522
  end
511
- map %w[-v --version] => :version
523
+
524
+ map aliases_for("version")
512
525
 
513
526
  desc "licenses", "Prints the license of all gems in the bundle"
514
527
  def licenses
@@ -524,7 +537,7 @@ module Bundler
524
537
  end
525
538
  end
526
539
 
527
- if Bundler.feature_flag.viz_command?
540
+ unless Bundler.feature_flag.bundler_3_mode?
528
541
  desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
529
542
  long_desc <<-D
530
543
  Viz generates a PNG file of the current Gemfile as a dependency graph.
@@ -537,8 +550,8 @@ module Bundler
537
550
  method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
538
551
  method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
539
552
  def viz
540
- SharedHelpers.major_deprecation 3, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
541
- 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"
542
555
  Viz.new(options.dup).run
543
556
  end
544
557
  end
@@ -547,14 +560,15 @@ module Bundler
547
560
 
548
561
  desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
549
562
  method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
550
- 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`."
551
564
  method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
552
565
  :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
553
566
  :desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
554
567
  method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
555
- 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`."
556
570
  method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
557
- :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`."
558
572
  def gem(name)
559
573
  end
560
574
 
@@ -562,7 +576,7 @@ module Bundler
562
576
  def gem_command.run(instance, args = [])
563
577
  arity = 1 # name
564
578
 
565
- require "bundler/cli/gem"
579
+ require_relative "cli/gem"
566
580
  cmd_args = args + [instance]
567
581
  cmd_args.unshift(instance.options)
568
582
 
@@ -590,7 +604,7 @@ module Bundler
590
604
  method_option "force", :type => :boolean, :default => false, :banner =>
591
605
  "Forces clean even if --path is not set"
592
606
  def clean
593
- require "bundler/cli/clean"
607
+ require_relative "cli/clean"
594
608
  Clean.new(options.dup).run
595
609
  end
596
610
 
@@ -598,7 +612,7 @@ module Bundler
598
612
  method_option "ruby", :type => :boolean, :default => false, :banner =>
599
613
  "only display ruby related platform information"
600
614
  def platform
601
- require "bundler/cli/platform"
615
+ require_relative "cli/platform"
602
616
  Platform.new(options).run
603
617
  end
604
618
 
@@ -608,8 +622,8 @@ module Bundler
608
622
  method_option "group", :type => :string, :banner =>
609
623
  "Install gem into a bundler group"
610
624
  def inject(name, version)
611
- SharedHelpers.major_deprecation 3, "The `inject` command has been replaced by the `add` command"
612
- require "bundler/cli/inject"
625
+ SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
626
+ require_relative "cli/inject"
613
627
  Inject.new(options.dup, name, version).run
614
628
  end
615
629
 
@@ -620,6 +634,8 @@ module Bundler
620
634
  "do not attempt to fetch remote gemspecs and use the local gem cache only"
621
635
  method_option "print", :type => :boolean, :default => false, :banner =>
622
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"
623
639
  method_option "lockfile", :type => :string, :default => nil, :banner =>
624
640
  "the path the lockfile should be written to"
625
641
  method_option "full-index", :type => :boolean, :default => false, :banner =>
@@ -639,7 +655,7 @@ module Bundler
639
655
  method_option "conservative", :type => :boolean, :banner =>
640
656
  "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated"
641
657
  def lock
642
- require "bundler/cli/lock"
658
+ require_relative "cli/lock"
643
659
  Lock.new(options).run
644
660
  end
645
661
 
@@ -659,13 +675,13 @@ module Bundler
659
675
  method_option "quiet", :type => :boolean, :banner =>
660
676
  "Only output warnings and errors."
661
677
  def doctor
662
- require "bundler/cli/doctor"
678
+ require_relative "cli/doctor"
663
679
  Doctor.new(options).run
664
680
  end
665
681
 
666
682
  desc "issue", "Learn how to report an issue in Bundler"
667
683
  def issue
668
- require "bundler/cli/issue"
684
+ require_relative "cli/issue"
669
685
  Issue.new.run
670
686
  end
671
687
 
@@ -676,12 +692,12 @@ module Bundler
676
692
  checkout --force`.
677
693
  D
678
694
  def pristine(*gems)
679
- require "bundler/cli/pristine"
695
+ require_relative "cli/pristine"
680
696
  Pristine.new(gems).run
681
697
  end
682
698
 
683
699
  if Bundler.feature_flag.plugins?
684
- require "bundler/cli/plugin"
700
+ require_relative "cli/plugin"
685
701
  desc "plugin", "Manage the bundler plugins"
686
702
  subcommand "plugin", Plugin
687
703
  end
@@ -689,12 +705,17 @@ module Bundler
689
705
  # Reformat the arguments passed to bundle that include a --help flag
690
706
  # into the corresponding `bundle help #{command}` call
691
707
  def self.reformatted_help_args(args)
692
- bundler_commands = all_commands.keys
708
+ bundler_commands = (COMMAND_ALIASES.keys + COMMAND_ALIASES.values).flatten
709
+
693
710
  help_flags = %w[--help -h]
694
- exec_commands = %w[e ex exe exec]
711
+ exec_commands = ["exec"] + COMMAND_ALIASES["exec"]
712
+
695
713
  help_used = args.index {|a| help_flags.include? a }
696
714
  exec_used = args.index {|a| exec_commands.include? a }
715
+
697
716
  command = args.find {|a| bundler_commands.include? a }
717
+ command = all_aliases[command] if all_aliases[command]
718
+
698
719
  if exec_used && help_used
699
720
  if exec_used + help_used == 1
700
721
  %w[help exec]
@@ -714,7 +735,7 @@ module Bundler
714
735
 
715
736
  # Automatically invoke `bundle install` and resume if
716
737
  # Bundler.settings[:auto_install] exists. This is set through config cmd
717
- # `bundle config auto_install 1`.
738
+ # `bundle config set auto_install 1`.
718
739
  #
719
740
  # Note that this method `nil`s out the global Definition object, so it
720
741
  # should be called first, before you instantiate anything like an
@@ -762,7 +783,7 @@ module Bundler
762
783
  return unless SharedHelpers.md5_available?
763
784
 
764
785
  latest = Fetcher::CompactIndex.
765
- new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
786
+ new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
766
787
  send(:compact_index_client).
767
788
  instance_variable_get(:@cache).
768
789
  dependencies("bundler").
@@ -786,5 +807,22 @@ module Bundler
786
807
  rescue RuntimeError
787
808
  nil
788
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
789
827
  end
790
828
  end