bundler 1.13.6 → 1.17.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 (323) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +554 -9
  3. data/README.md +28 -5
  4. data/bundler.gemspec +40 -11
  5. data/exe/bundle +4 -8
  6. data/exe/bundle_ruby +4 -3
  7. data/lib/bundler.rb +162 -68
  8. data/lib/bundler/build_metadata.rb +53 -0
  9. data/lib/bundler/capistrano.rb +5 -0
  10. data/lib/bundler/cli.rb +360 -118
  11. data/lib/bundler/cli/add.rb +35 -0
  12. data/lib/bundler/cli/binstubs.rb +18 -10
  13. data/lib/bundler/cli/cache.rb +6 -5
  14. data/lib/bundler/cli/check.rb +4 -6
  15. data/lib/bundler/cli/clean.rb +6 -7
  16. data/lib/bundler/cli/common.rb +47 -1
  17. data/lib/bundler/cli/config.rb +26 -7
  18. data/lib/bundler/cli/console.rb +2 -1
  19. data/lib/bundler/cli/doctor.rb +63 -18
  20. data/lib/bundler/cli/exec.rb +12 -5
  21. data/lib/bundler/cli/gem.rb +59 -21
  22. data/lib/bundler/cli/info.rb +50 -0
  23. data/lib/bundler/cli/init.rb +21 -7
  24. data/lib/bundler/cli/inject.rb +13 -4
  25. data/lib/bundler/cli/install.rb +72 -101
  26. data/lib/bundler/cli/issue.rb +40 -0
  27. data/lib/bundler/cli/list.rb +58 -0
  28. data/lib/bundler/cli/lock.rb +9 -6
  29. data/lib/bundler/cli/open.rb +4 -3
  30. data/lib/bundler/cli/outdated.rb +175 -60
  31. data/lib/bundler/cli/package.rb +9 -6
  32. data/lib/bundler/cli/platform.rb +2 -1
  33. data/lib/bundler/cli/plugin.rb +1 -0
  34. data/lib/bundler/cli/pristine.rb +47 -0
  35. data/lib/bundler/cli/remove.rb +18 -0
  36. data/lib/bundler/cli/show.rb +2 -2
  37. data/lib/bundler/cli/update.rb +44 -34
  38. data/lib/bundler/cli/viz.rb +5 -1
  39. data/lib/bundler/compact_index_client.rb +109 -0
  40. data/lib/bundler/compact_index_client/cache.rb +118 -0
  41. data/lib/bundler/compact_index_client/updater.rb +116 -0
  42. data/lib/bundler/compatibility_guard.rb +14 -0
  43. data/lib/bundler/constants.rb +1 -0
  44. data/lib/bundler/current_ruby.rb +17 -8
  45. data/lib/bundler/definition.rb +353 -182
  46. data/lib/bundler/dep_proxy.rb +3 -1
  47. data/lib/bundler/dependency.rb +22 -10
  48. data/lib/bundler/deployment.rb +1 -1
  49. data/lib/bundler/deprecate.rb +15 -3
  50. data/lib/bundler/dsl.rb +122 -64
  51. data/lib/bundler/endpoint_specification.rb +13 -3
  52. data/lib/bundler/env.rb +110 -38
  53. data/lib/bundler/environment_preserver.rb +27 -6
  54. data/lib/bundler/errors.rb +24 -0
  55. data/lib/bundler/feature_flag.rb +74 -0
  56. data/lib/bundler/fetcher.rb +18 -11
  57. data/lib/bundler/fetcher/base.rb +1 -0
  58. data/lib/bundler/fetcher/compact_index.rb +7 -5
  59. data/lib/bundler/fetcher/dependency.rb +3 -2
  60. data/lib/bundler/fetcher/downloader.rb +25 -7
  61. data/lib/bundler/fetcher/index.rb +3 -2
  62. data/lib/bundler/friendly_errors.rb +33 -7
  63. data/lib/bundler/gem_helper.rb +25 -11
  64. data/lib/bundler/gem_helpers.rb +70 -1
  65. data/lib/bundler/gem_remote_fetcher.rb +1 -0
  66. data/lib/bundler/gem_tasks.rb +1 -0
  67. data/lib/bundler/gem_version_promoter.rb +17 -2
  68. data/lib/bundler/gemdeps.rb +29 -0
  69. data/lib/bundler/graph.rb +1 -0
  70. data/lib/bundler/index.rb +28 -15
  71. data/lib/bundler/injector.rb +216 -33
  72. data/lib/bundler/inline.rb +12 -12
  73. data/lib/bundler/installer.rb +139 -53
  74. data/lib/bundler/installer/gem_installer.rb +15 -5
  75. data/lib/bundler/installer/parallel_installer.rb +113 -28
  76. data/lib/bundler/installer/standalone.rb +1 -0
  77. data/lib/bundler/lazy_specification.rb +31 -3
  78. data/lib/bundler/lockfile_generator.rb +95 -0
  79. data/lib/bundler/lockfile_parser.rb +50 -37
  80. data/lib/bundler/match_platform.rb +13 -3
  81. data/lib/bundler/mirror.rb +10 -5
  82. data/lib/bundler/plugin.rb +22 -8
  83. data/lib/bundler/plugin/api.rb +2 -1
  84. data/lib/bundler/plugin/api/source.rb +17 -4
  85. data/lib/bundler/plugin/events.rb +61 -0
  86. data/lib/bundler/plugin/index.rb +9 -2
  87. data/lib/bundler/plugin/installer.rb +7 -6
  88. data/lib/bundler/plugin/source_list.rb +7 -8
  89. data/lib/bundler/process_lock.rb +24 -0
  90. data/lib/bundler/psyched_yaml.rb +10 -0
  91. data/lib/bundler/remote_specification.rb +30 -1
  92. data/lib/bundler/resolver.rb +187 -194
  93. data/lib/bundler/resolver/spec_group.rb +106 -0
  94. data/lib/bundler/retry.rb +5 -1
  95. data/lib/bundler/ruby_dsl.rb +1 -0
  96. data/lib/bundler/ruby_version.rb +12 -2
  97. data/lib/bundler/rubygems_ext.rb +23 -8
  98. data/lib/bundler/rubygems_gem_installer.rb +90 -0
  99. data/lib/bundler/rubygems_integration.rb +193 -70
  100. data/lib/bundler/runtime.rb +39 -22
  101. data/lib/bundler/settings.rb +245 -85
  102. data/lib/bundler/settings/validator.rb +102 -0
  103. data/lib/bundler/setup.rb +4 -7
  104. data/lib/bundler/shared_helpers.rb +183 -40
  105. data/lib/bundler/similarity_detector.rb +1 -0
  106. data/lib/bundler/source.rb +58 -1
  107. data/lib/bundler/source/gemspec.rb +1 -0
  108. data/lib/bundler/source/git.rb +52 -23
  109. data/lib/bundler/source/git/git_proxy.rb +30 -14
  110. data/lib/bundler/source/metadata.rb +62 -0
  111. data/lib/bundler/source/path.rb +42 -16
  112. data/lib/bundler/source/path/installer.rb +4 -2
  113. data/lib/bundler/source/rubygems.rb +171 -82
  114. data/lib/bundler/source/rubygems/remote.rb +12 -2
  115. data/lib/bundler/source_list.rb +75 -15
  116. data/lib/bundler/spec_set.rb +67 -32
  117. data/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
  118. data/lib/bundler/stub_specification.rb +86 -2
  119. data/lib/bundler/templates/.document +1 -0
  120. data/lib/bundler/templates/Executable +13 -1
  121. data/lib/bundler/templates/Executable.bundler +105 -0
  122. data/lib/bundler/templates/Executable.standalone +5 -5
  123. data/lib/bundler/templates/Gemfile +3 -0
  124. data/lib/bundler/templates/gems.rb +8 -0
  125. data/lib/bundler/templates/newgem/Gemfile.tt +4 -2
  126. data/lib/bundler/templates/newgem/LICENSE.txt.tt +1 -1
  127. data/lib/bundler/templates/newgem/README.md.tt +14 -8
  128. data/lib/bundler/templates/newgem/Rakefile.tt +5 -5
  129. data/lib/bundler/templates/newgem/bin/console.tt +1 -1
  130. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +4 -4
  131. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +3 -3
  132. data/lib/bundler/templates/newgem/gitignore.tt +5 -1
  133. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -6
  134. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +4 -4
  135. data/lib/bundler/templates/newgem/newgem.gemspec.tt +21 -12
  136. data/lib/bundler/templates/newgem/rspec.tt +1 -0
  137. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +1 -3
  138. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +13 -1
  139. data/lib/bundler/templates/newgem/test/newgem_test.rb.tt +1 -1
  140. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +3 -3
  141. data/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
  142. data/lib/bundler/ui.rb +1 -0
  143. data/lib/bundler/ui/rg_proxy.rb +1 -0
  144. data/lib/bundler/ui/shell.rb +30 -10
  145. data/lib/bundler/ui/silent.rb +21 -1
  146. data/lib/bundler/uri_credentials_filter.rb +1 -0
  147. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
  148. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
  149. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
  150. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
  151. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
  152. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +26 -6
  153. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +2 -1
  154. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +12 -4
  155. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +3 -2
  156. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
  157. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +11 -3
  158. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +13 -1
  159. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +3 -2
  160. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +3 -2
  161. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +18 -5
  162. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +75 -7
  163. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
  164. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
  165. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
  166. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +499 -128
  167. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
  168. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
  169. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/faster.rb +1 -0
  170. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent.rb +27 -24
  171. data/lib/bundler/vendor/{net → net-http-persistent/lib/net}/http/persistent/ssl_reuse.rb +2 -1
  172. data/lib/bundler/vendor/thor/lib/thor.rb +46 -21
  173. data/lib/bundler/vendor/thor/lib/thor/actions.rb +24 -22
  174. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +2 -1
  175. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
  176. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +2 -2
  177. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +16 -8
  178. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +66 -18
  179. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +17 -15
  180. data/lib/bundler/vendor/thor/lib/thor/base.rb +55 -32
  181. data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -11
  182. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +21 -1
  183. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +7 -5
  184. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +94 -63
  185. data/lib/bundler/vendor/thor/lib/thor/error.rb +3 -3
  186. data/lib/bundler/vendor/thor/lib/thor/group.rb +13 -13
  187. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +4 -5
  188. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
  189. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +4 -7
  190. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +16 -16
  191. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +42 -21
  192. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +13 -10
  193. data/lib/bundler/vendor/thor/lib/thor/runner.rb +31 -29
  194. data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  195. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +49 -33
  196. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
  197. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +4 -4
  198. data/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
  199. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  200. data/lib/bundler/vendored_fileutils.rb +9 -0
  201. data/lib/bundler/vendored_molinillo.rb +1 -0
  202. data/lib/bundler/vendored_persistent.rb +43 -3
  203. data/lib/bundler/vendored_thor.rb +6 -2
  204. data/lib/bundler/version.rb +19 -2
  205. data/lib/bundler/version_ranges.rb +76 -0
  206. data/lib/bundler/vlad.rb +5 -0
  207. data/lib/bundler/worker.rb +30 -6
  208. data/lib/bundler/yaml_serializer.rb +4 -4
  209. data/man/bundle-add.1 +58 -0
  210. data/man/bundle-add.1.txt +52 -0
  211. data/man/bundle-add.ronn +40 -0
  212. data/{lib/bundler/man/bundle-binstubs → man/bundle-binstubs.1} +11 -1
  213. data/man/bundle-binstubs.1.txt +48 -0
  214. data/man/bundle-binstubs.ronn +15 -1
  215. data/man/bundle-check.1 +31 -0
  216. data/man/bundle-check.1.txt +33 -0
  217. data/man/bundle-check.ronn +26 -0
  218. data/man/bundle-clean.1 +24 -0
  219. data/man/bundle-clean.1.txt +26 -0
  220. data/man/bundle-clean.ronn +18 -0
  221. data/man/bundle-config.1 +497 -0
  222. data/man/bundle-config.1.txt +529 -0
  223. data/man/bundle-config.ronn +233 -61
  224. data/man/bundle-doctor.1 +44 -0
  225. data/man/bundle-doctor.1.txt +44 -0
  226. data/man/bundle-doctor.ronn +33 -0
  227. data/{lib/bundler/man/bundle-exec → man/bundle-exec.1} +6 -3
  228. data/man/bundle-exec.1.txt +178 -0
  229. data/man/bundle-exec.ronn +10 -3
  230. data/{lib/bundler/man/bundle-gem → man/bundle-gem.1} +4 -4
  231. data/man/bundle-gem.1.txt +91 -0
  232. data/man/bundle-gem.ronn +3 -2
  233. data/man/bundle-info.1 +20 -0
  234. data/man/bundle-info.1.txt +21 -0
  235. data/man/bundle-info.ronn +17 -0
  236. data/man/bundle-init.1 +25 -0
  237. data/man/bundle-init.1.txt +34 -0
  238. data/man/bundle-init.ronn +29 -0
  239. data/man/bundle-inject.1 +33 -0
  240. data/man/bundle-inject.1.txt +32 -0
  241. data/man/bundle-inject.ronn +22 -0
  242. data/{lib/bundler/man/bundle-install → man/bundle-install.1} +32 -29
  243. data/man/bundle-install.1.txt +396 -0
  244. data/man/bundle-install.ronn +45 -36
  245. data/man/bundle-list.1 +50 -0
  246. data/man/bundle-list.1.txt +43 -0
  247. data/man/bundle-list.ronn +33 -0
  248. data/{lib/bundler/man/bundle-lock → man/bundle-lock.1} +43 -2
  249. data/man/bundle-lock.1.txt +93 -0
  250. data/man/bundle-lock.ronn +47 -0
  251. data/man/bundle-open.1 +32 -0
  252. data/man/bundle-open.1.txt +29 -0
  253. data/man/bundle-open.ronn +19 -0
  254. data/man/bundle-outdated.1 +155 -0
  255. data/man/bundle-outdated.1.txt +131 -0
  256. data/man/bundle-outdated.ronn +111 -0
  257. data/{lib/bundler/man/bundle-package → man/bundle-package.1} +6 -3
  258. data/man/bundle-package.1.txt +79 -0
  259. data/man/bundle-package.ronn +7 -2
  260. data/{lib/bundler/man/bundle-platform → man/bundle-platform.1} +1 -1
  261. data/man/bundle-platform.1.txt +57 -0
  262. data/man/bundle-pristine.1 +34 -0
  263. data/man/bundle-pristine.1.txt +44 -0
  264. data/man/bundle-pristine.ronn +34 -0
  265. data/man/bundle-remove.1 +31 -0
  266. data/man/bundle-remove.1.txt +34 -0
  267. data/man/bundle-remove.ronn +23 -0
  268. data/man/bundle-show.1 +23 -0
  269. data/man/bundle-show.1.txt +27 -0
  270. data/man/bundle-show.ronn +21 -0
  271. data/man/bundle-update.1 +394 -0
  272. data/man/bundle-update.1.txt +391 -0
  273. data/man/bundle-update.ronn +172 -16
  274. data/man/bundle-viz.1 +39 -0
  275. data/man/bundle-viz.1.txt +39 -0
  276. data/man/bundle-viz.ronn +30 -0
  277. data/{lib/bundler/man/bundle → man/bundle.1} +44 -28
  278. data/man/bundle.1.txt +116 -0
  279. data/man/bundle.ronn +39 -27
  280. data/{lib/bundler/man → man}/gemfile.5 +67 -84
  281. data/man/gemfile.5.ronn +77 -55
  282. data/man/gemfile.5.txt +653 -0
  283. data/man/index.txt +25 -8
  284. metadata +118 -58
  285. data/.codeclimate.yml +0 -25
  286. data/.gitignore +0 -16
  287. data/.rspec +0 -3
  288. data/.rubocop.yml +0 -128
  289. data/.rubocop_todo.yml +0 -248
  290. data/.travis.yml +0 -108
  291. data/CODE_OF_CONDUCT.md +0 -42
  292. data/CONTRIBUTING.md +0 -36
  293. data/DEVELOPMENT.md +0 -148
  294. data/ISSUES.md +0 -100
  295. data/Rakefile +0 -333
  296. data/bin/rake +0 -19
  297. data/bin/rspec +0 -15
  298. data/bin/rubocop +0 -17
  299. data/bin/with_rubygems +0 -39
  300. data/lib/bundler/man/bundle-binstubs.txt +0 -33
  301. data/lib/bundler/man/bundle-config +0 -254
  302. data/lib/bundler/man/bundle-config.txt +0 -282
  303. data/lib/bundler/man/bundle-exec.txt +0 -171
  304. data/lib/bundler/man/bundle-gem.txt +0 -90
  305. data/lib/bundler/man/bundle-install.txt +0 -385
  306. data/lib/bundler/man/bundle-lock.txt +0 -52
  307. data/lib/bundler/man/bundle-package.txt +0 -74
  308. data/lib/bundler/man/bundle-platform.txt +0 -57
  309. data/lib/bundler/man/bundle-update +0 -221
  310. data/lib/bundler/man/bundle-update.txt +0 -227
  311. data/lib/bundler/man/bundle.txt +0 -104
  312. data/lib/bundler/man/gemfile.5.txt +0 -636
  313. data/lib/bundler/postit_trampoline.rb +0 -68
  314. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +0 -79
  315. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/cache.rb +0 -112
  316. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +0 -80
  317. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/version.rb +0 -4
  318. data/lib/bundler/vendor/postit/lib/postit.rb +0 -15
  319. data/lib/bundler/vendor/postit/lib/postit/environment.rb +0 -44
  320. data/lib/bundler/vendor/postit/lib/postit/installer.rb +0 -28
  321. data/lib/bundler/vendor/postit/lib/postit/parser.rb +0 -21
  322. data/lib/bundler/vendor/postit/lib/postit/setup.rb +0 -12
  323. data/lib/bundler/vendor/postit/lib/postit/version.rb +0 -3
@@ -1,7 +1,13 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "pathname"
3
4
 
4
5
  module Bundler
6
+ class CLI
7
+ Bundler.require_thor_actions
8
+ include Thor::Actions
9
+ end
10
+
5
11
  class CLI::Gem
6
12
  TEST_FRAMEWORK_VERSIONS = {
7
13
  "rspec" => "3.0",
@@ -13,7 +19,10 @@ module Bundler
13
19
  def initialize(options, gem_name, thor)
14
20
  @options = options
15
21
  @gem_name = resolve_name(gem_name)
22
+
16
23
  @thor = thor
24
+ thor.behavior = :invoke
25
+ thor.destination_root = nil
17
26
 
18
27
  @name = @gem_name
19
28
  @target = SharedHelpers.pwd.join(gem_name)
@@ -29,8 +38,11 @@ module Bundler
29
38
  constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
30
39
  constant_array = constant_name.split("::")
31
40
 
32
- git_user_name = `git config user.name`.chomp
33
- git_user_email = `git config user.email`.chomp
41
+ git_installed = Bundler.git_present?
42
+
43
+ git_author_name = git_installed ? `git config user.name`.chomp : ""
44
+ github_username = git_installed ? `git config github.user`.chomp : ""
45
+ git_user_email = git_installed ? `git config user.email`.chomp : ""
34
46
 
35
47
  config = {
36
48
  :name => name,
@@ -39,18 +51,18 @@ module Bundler
39
51
  :makefile_path => "#{underscored_name}/#{underscored_name}",
40
52
  :constant_name => constant_name,
41
53
  :constant_array => constant_array,
42
- :author => git_user_name.empty? ? "TODO: Write your name" : git_user_name,
54
+ :author => git_author_name.empty? ? "TODO: Write your name" : git_author_name,
43
55
  :email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
44
56
  :test => options[:test],
45
57
  :ext => options[:ext],
46
58
  :exe => options[:exe],
47
- :bundler_version => bundler_dependency_version
59
+ :bundler_version => bundler_dependency_version,
60
+ :github_username => github_username.empty? ? "[USERNAME]" : github_username
48
61
  }
49
62
  ensure_safe_gem_name(name, constant_array)
50
63
 
51
64
  templates = {
52
65
  "Gemfile.tt" => "Gemfile",
53
- "gitignore.tt" => ".gitignore",
54
66
  "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
55
67
  "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
56
68
  "newgem.gemspec.tt" => "#{name}.gemspec",
@@ -60,16 +72,18 @@ module Bundler
60
72
  "bin/setup.tt" => "bin/setup"
61
73
  }
62
74
 
63
- executables = %w(
75
+ executables = %w[
64
76
  bin/console
65
77
  bin/setup
66
- )
78
+ ]
79
+
80
+ templates.merge!("gitignore.tt" => ".gitignore") if Bundler.git_present?
67
81
 
68
82
  if test_framework = ask_and_set_test_framework
69
83
  config[:test] = test_framework
70
84
  config[:test_framework_version] = TEST_FRAMEWORK_VERSIONS[test_framework]
71
85
 
72
- templates.merge!(".travis.yml.tt" => ".travis.yml")
86
+ templates.merge!("travis.yml.tt" => ".travis.yml")
73
87
 
74
88
  case test_framework
75
89
  when "rspec"
@@ -91,7 +105,7 @@ module Bundler
91
105
  if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
92
106
  "This means that any other developer or company will be legally allowed to use your code " \
93
107
  "for free as long as they admit you created it. You can read more about the MIT license " \
94
- "at http://choosealicense.com/licenses/mit.")
108
+ "at https://choosealicense.com/licenses/mit.")
95
109
  config[:mit] = true
96
110
  Bundler.ui.info "MIT License enabled in config"
97
111
  templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
@@ -104,7 +118,7 @@ module Bundler
104
118
  "of enforcing it, so be sure that you are prepared to do that. Be sure that your email " \
105
119
  "address is specified as a contact in the generated code of conduct so that people know " \
106
120
  "who to contact in case of a violation. For suggestions about " \
107
- "how to enforce codes of conduct, see http://bit.ly/coc-enforcement.")
121
+ "how to enforce codes of conduct, see https://bit.ly/coc-enforcement.")
108
122
  config[:coc] = true
109
123
  Bundler.ui.info "Code of conduct enabled in config"
110
124
  templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
@@ -121,23 +135,34 @@ module Bundler
121
135
  end
122
136
 
123
137
  templates.each do |src, dst|
124
- thor.template("newgem/#{src}", target.join(dst), config)
138
+ destination = target.join(dst)
139
+ SharedHelpers.filesystem_access(destination) do
140
+ thor.template("newgem/#{src}", destination, config)
141
+ end
125
142
  end
126
143
 
127
144
  executables.each do |file|
128
- path = target.join(file)
129
- executable = (path.stat.mode | 0o111)
130
- path.chmod(executable)
145
+ SharedHelpers.filesystem_access(target.join(file)) do |path|
146
+ executable = (path.stat.mode | 0o111)
147
+ path.chmod(executable)
148
+ end
131
149
  end
132
150
 
133
- Bundler.ui.info "Initializing git repo in #{target}"
134
- Dir.chdir(target) do
135
- `git init`
136
- `git add .`
151
+ if Bundler.git_present?
152
+ Bundler.ui.info "Initializing git repo in #{target}"
153
+ Dir.chdir(target) do
154
+ `git init`
155
+ `git add .`
156
+ end
137
157
  end
138
158
 
139
159
  # Open gemspec in editor
140
160
  open_editor(options["edit"], target.join("#{name}.gemspec")) if options[:edit]
161
+
162
+ Bundler.ui.info "Gem '#{name}' was successfully created. " \
163
+ "For more information on making a RubyGem visit https://bundler.io/guides/creating_gem.html"
164
+ rescue Errno::EEXIST => e
165
+ raise GenericSystemCallError.new(e, "There was a conflict while creating the new gem.")
141
166
  end
142
167
 
143
168
  private
@@ -201,10 +226,23 @@ module Bundler
201
226
  if name =~ /^\d/
202
227
  Bundler.ui.error "Invalid gem name #{name} Please give a name which does not start with numbers."
203
228
  exit 1
204
- elsif constant_array.inject(Object) {|c, s| (c.const_defined?(s) && c.const_get(s)) || break }
205
- Bundler.ui.error "Invalid gem name #{name} constant #{constant_array.join("::")} is already in use. Please choose another gem name."
206
- exit 1
207
229
  end
230
+
231
+ constant_name = constant_array.join("::")
232
+
233
+ existing_constant = constant_array.inject(Object) do |c, s|
234
+ defined = begin
235
+ c.const_defined?(s)
236
+ rescue NameError
237
+ Bundler.ui.error "Invalid gem name #{name} -- `#{constant_name}` is an invalid constant name"
238
+ exit 1
239
+ end
240
+ (defined && c.const_get(s)) || break
241
+ end
242
+
243
+ return unless existing_constant
244
+ Bundler.ui.error "Invalid gem name #{name} constant #{constant_name} is already in use. Please choose another gem name."
245
+ exit 1
208
246
  end
209
247
 
210
248
  def open_editor(editor, file)
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CLI::Info
5
+ attr_reader :gem_name, :options
6
+ def initialize(options, gem_name)
7
+ @options = options
8
+ @gem_name = gem_name
9
+ end
10
+
11
+ def run
12
+ spec = spec_for_gem(gem_name)
13
+
14
+ spec_not_found(gem_name) unless spec
15
+ return print_gem_path(spec) if @options[:path]
16
+ print_gem_info(spec)
17
+ end
18
+
19
+ private
20
+
21
+ def spec_for_gem(gem_name)
22
+ spec = Bundler.definition.specs.find {|s| s.name == gem_name }
23
+ spec || default_gem_spec(gem_name)
24
+ end
25
+
26
+ def default_gem_spec(gem_name)
27
+ return unless Gem::Specification.respond_to?(:find_all_by_name)
28
+ gem_spec = Gem::Specification.find_all_by_name(gem_name).last
29
+ return gem_spec if gem_spec && gem_spec.respond_to?(:default_gem?) && gem_spec.default_gem?
30
+ end
31
+
32
+ def spec_not_found(gem_name)
33
+ raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
34
+ end
35
+
36
+ def print_gem_path(spec)
37
+ Bundler.ui.info spec.full_gem_path
38
+ end
39
+
40
+ def print_gem_info(spec)
41
+ gem_info = String.new
42
+ gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
43
+ gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
44
+ gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
45
+ gem_info << "\tPath: #{spec.full_gem_path}\n"
46
+ gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
47
+ Bundler.ui.info gem_info
48
+ end
49
+ end
50
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  class CLI::Init
4
5
  attr_reader :options
@@ -7,8 +8,13 @@ module Bundler
7
8
  end
8
9
 
9
10
  def run
10
- if File.exist?("Gemfile")
11
- Bundler.ui.error "Gemfile already exists at #{SharedHelpers.pwd}/Gemfile"
11
+ if File.exist?(gemfile)
12
+ Bundler.ui.error "#{gemfile} already exists at #{File.expand_path(gemfile)}"
13
+ exit 1
14
+ end
15
+
16
+ unless File.writable?(Dir.pwd)
17
+ Bundler.ui.error "Can not create #{gemfile} as the current directory is not writable."
12
18
  exit 1
13
19
  end
14
20
 
@@ -18,16 +24,24 @@ module Bundler
18
24
  Bundler.ui.error "Gem specification #{gemspec} doesn't exist"
19
25
  exit 1
20
26
  end
21
- spec = Gem::Specification.load(gemspec)
22
- puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
23
- File.open("Gemfile", "wb") do |file|
27
+
28
+ spec = Bundler.load_gemspec_uncached(gemspec)
29
+
30
+ File.open(gemfile, "wb") do |file|
24
31
  file << "# Generated from #{gemspec}\n"
25
32
  file << spec.to_gemfile
26
33
  end
27
34
  else
28
- puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
29
- FileUtils.cp(File.expand_path("../../templates/Gemfile", __FILE__), "Gemfile")
35
+ FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile)
30
36
  end
37
+
38
+ puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}"
39
+ end
40
+
41
+ private
42
+
43
+ def gemfile
44
+ @gemfile ||= Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile"
31
45
  end
32
46
  end
33
47
  end
@@ -1,14 +1,15 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  class CLI::Inject
4
5
  attr_reader :options, :name, :version, :group, :source, :gems
5
- def initialize(options, name, version, gems)
6
+ def initialize(options, name, version)
6
7
  @options = options
7
8
  @name = name
8
9
  @version = version || last_version_number
9
- @group = options[:group]
10
+ @group = options[:group].split(",") unless options[:group].nil?
10
11
  @source = options[:source]
11
- @gems = gems
12
+ @gems = []
12
13
  end
13
14
 
14
15
  def run
@@ -18,6 +19,8 @@ module Bundler
18
19
 
19
20
  # Build an array of Dependency objects out of the arguments
20
21
  deps = []
22
+ # when `inject` support addition of more than one gem, then this loop will
23
+ # help. Currently this loop is running once.
21
24
  gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
22
25
  ops = Gem::Requirement::OPS.map {|key, _val| key }
23
26
  has_op = ops.any? {|op| gem_version.start_with? op }
@@ -29,7 +32,13 @@ module Bundler
29
32
 
30
33
  if added.any?
31
34
  Bundler.ui.confirm "Added to Gemfile:"
32
- Bundler.ui.confirm added.map {|g| " #{g}" }.join("\n")
35
+ Bundler.ui.confirm(added.map do |d|
36
+ name = "'#{d.name}'"
37
+ requirement = ", '#{d.requirement}'"
38
+ group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
39
+ source = ", :source => '#{d.source}'" unless d.source.nil?
40
+ %(gem #{name}#{requirement}#{group}#{source})
41
+ end.join("\n"))
33
42
  else
34
43
  Bundler.ui.confirm "All gems were already present in the Gemfile"
35
44
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Bundler
3
4
  class CLI::Install
4
5
  attr_reader :options
@@ -11,19 +12,9 @@ module Bundler
11
12
 
12
13
  warn_if_root
13
14
 
14
- warn_if_outdated
15
-
16
- [:with, :without].each do |option|
17
- if options[option]
18
- options[option] = options[option].join(":").tr(" ", ":").split(":")
19
- end
20
- end
21
-
22
- check_for_group_conflicts
23
-
24
15
  normalize_groups
25
16
 
26
- ENV["RB_USER_INSTALL"] = "1" if Bundler::FREEBSD
17
+ Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
27
18
 
28
19
  # Disable color in deployment mode
29
20
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
@@ -32,22 +23,28 @@ module Bundler
32
23
 
33
24
  check_trust_policy
34
25
 
35
- if options[:deployment] || options[:frozen]
26
+ if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
36
27
  unless Bundler.default_lockfile.exist?
37
- flag = options[:deployment] ? "--deployment" : "--frozen"
38
- raise ProductionError, "The #{flag} flag requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
28
+ flag = "--deployment flag" if options[:deployment]
29
+ flag ||= "--frozen flag" if options[:frozen]
30
+ flag ||= "deployment setting"
31
+ raise ProductionError, "The #{flag} requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
39
32
  "sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
40
33
  "before deploying."
41
34
  end
42
35
 
43
36
  options[:local] = true if Bundler.app_cache.exist?
44
37
 
45
- Bundler.settings[:frozen] = "1"
38
+ if Bundler.feature_flag.deployment_means_frozen?
39
+ Bundler.settings.set_command_option :deployment, true
40
+ else
41
+ Bundler.settings.set_command_option :frozen, true
42
+ end
46
43
  end
47
44
 
48
45
  # When install is called with --no-deployment, disable deployment mode
49
46
  if options[:deployment] == false
50
- Bundler.settings.delete(:frozen)
47
+ Bundler.settings.set_command_option :frozen, nil
51
48
  options[:system] = true
52
49
  end
53
50
 
@@ -56,41 +53,33 @@ module Bundler
56
53
  Bundler::Fetcher.disable_endpoint = options["full-index"]
57
54
 
58
55
  if options["binstubs"]
59
- Bundler::SharedHelpers.major_deprecation \
60
- "the --binstubs option will be removed in favor of `bundle binstubs`"
56
+ Bundler::SharedHelpers.major_deprecation 2,
57
+ "The --binstubs option will be removed in favor of `bundle binstubs`"
61
58
  end
62
59
 
63
- # rubygems plugins sometimes hook into the gem install process
64
- Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
65
-
66
- Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.settings[:plugins]
60
+ Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
67
61
 
68
62
  definition = Bundler.definition
69
- definition.validate_ruby!
63
+ definition.validate_runtime!
70
64
 
71
65
  installer = Installer.install(Bundler.root, definition, options)
72
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.settings[:frozen]
66
+ Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
73
67
 
74
68
  Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
75
- confirm_without_groups
69
+ Bundler::CLI::Common.output_without_groups_message
76
70
 
77
- if Bundler.settings[:path]
78
- absolute_path = File.expand_path(Bundler.settings[:path])
79
- relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
80
- Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
71
+ if Bundler.use_system_gems?
72
+ Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
81
73
  else
82
- Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
74
+ relative_path = Bundler.configured_bundle_path.base_path_relative_to_pwd
75
+ Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
83
76
  end
84
77
 
85
- unless Bundler.settings["ignore_messages"]
86
- installer.post_install_messages.to_a.each do |name, msg|
87
- print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
88
- end
89
- end
78
+ Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
90
79
 
91
80
  warn_ambiguous_gems
92
81
 
93
- if Bundler.settings[:clean] && Bundler.settings[:path]
82
+ if CLI::Common.clean_after_install?
94
83
  require "bundler/cli/clean"
95
84
  Bundler::CLI::Clean.new(options).run
96
85
  end
@@ -121,26 +110,6 @@ module Bundler
121
110
  "application for all non-root users on this machine.", :wrap => true
122
111
  end
123
112
 
124
- def warn_if_outdated
125
- return if ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"].nil?
126
- installed_version = Gem::Version.new(ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"].dup)
127
- running_version = Gem::Version.new(Bundler::VERSION)
128
- return if Gem::Requirement.new(installed_version).satisfied_by?(running_version)
129
- if Bundler.settings[:warned_version].nil? || running_version > Gem::Version.new(Bundler.settings[:warned_version])
130
- Bundler.settings[:warned_version] = running_version
131
- Bundler.ui.warn "You're running Bundler #{installed_version} but this " \
132
- "project uses #{running_version}. To update, run `bundle update " \
133
- "--bundler`. You won't see this message again unless you upgrade " \
134
- "to a newer version of Bundler.", :wrap => true
135
- end
136
- end
137
-
138
- def confirm_without_groups
139
- return unless Bundler.settings.without.any?
140
- require "bundler/cli/common"
141
- Bundler.ui.confirm Bundler::CLI::Common.without_groups_message
142
- end
143
-
144
113
  def dependencies_count_for(definition)
145
114
  count = definition.dependencies.count
146
115
  "#{count} Gemfile #{count == 1 ? "dependency" : "dependencies"}"
@@ -151,54 +120,46 @@ module Bundler
151
120
  "#{count} #{count == 1 ? "gem" : "gems"} now installed"
152
121
  end
153
122
 
154
- def print_post_install_message(name, msg)
155
- Bundler.ui.confirm "Post-install message from #{name}:"
156
- Bundler.ui.info msg
157
- end
158
-
159
- def check_for_group_conflicts
160
- if options[:without] && options[:with]
161
- conflicting_groups = options[:without] & options[:with]
162
- unless conflicting_groups.empty?
163
- Bundler.ui.error "You can't list a group in both, --with and --without." \
164
- "The offending groups are: #{conflicting_groups.join(", ")}."
165
- exit 1
166
- end
167
- end
123
+ def check_for_group_conflicts_in_cli_options
124
+ conflicting_groups = Array(options[:without]) & Array(options[:with])
125
+ return if conflicting_groups.empty?
126
+ raise InvalidOption, "You can't list a group in both with and without." \
127
+ " The offending groups are: #{conflicting_groups.join(", ")}."
168
128
  end
169
129
 
170
130
  def check_for_options_conflicts
171
131
  if (options[:path] || options[:deployment]) && options[:system]
172
132
  error_message = String.new
173
- error_message << "You have specified both a path to install your gems to as well as --system. Please choose.\n" if options[:path]
174
- error_message << "You have specified both --deployment as well as --system. Please choose.\n" if options[:deployment]
133
+ error_message << "You have specified both --path as well as --system. Please choose only one option.\n" if options[:path]
134
+ error_message << "You have specified both --deployment as well as --system. Please choose only one option.\n" if options[:deployment]
175
135
  raise InvalidOption.new(error_message)
176
136
  end
177
137
  end
178
138
 
179
139
  def check_trust_policy
180
- if options["trust-policy"]
181
- unless Bundler.rubygems.security_policies.keys.include?(options["trust-policy"])
182
- Bundler.ui.error "Rubygems doesn't know about trust policy '#{options["trust-policy"]}'. " \
183
- "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
184
- exit 1
185
- end
186
- Bundler.settings["trust-policy"] = options["trust-policy"]
187
- else
188
- Bundler.settings["trust-policy"] = nil if Bundler.settings["trust-policy"]
140
+ trust_policy = options["trust-policy"]
141
+ unless Bundler.rubygems.security_policies.keys.unshift(nil).include?(trust_policy)
142
+ raise InvalidOption, "RubyGems doesn't know about trust policy '#{trust_policy}'. " \
143
+ "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
189
144
  end
145
+ Bundler.settings.set_command_option_if_given :"trust-policy", trust_policy
190
146
  end
191
147
 
192
148
  def normalize_groups
193
- Bundler.settings.with = [] if options[:with] && options[:with].empty?
194
- Bundler.settings.without = [] if options[:without] && options[:without].empty?
149
+ options[:with] &&= options[:with].join(":").tr(" ", ":").split(":")
150
+ options[:without] &&= options[:without].join(":").tr(" ", ":").split(":")
151
+
152
+ check_for_group_conflicts_in_cli_options
153
+
154
+ Bundler.settings.set_command_option :with, nil if options[:with] == []
155
+ Bundler.settings.set_command_option :without, nil if options[:without] == []
195
156
 
196
- with = options.fetch("with", [])
197
- with |= Bundler.settings.with.map(&:to_s)
157
+ with = options.fetch(:with, [])
158
+ with |= Bundler.settings[:with].map(&:to_s)
198
159
  with -= options[:without] if options[:without]
199
160
 
200
- without = options.fetch("without", [])
201
- without |= Bundler.settings.without.map(&:to_s)
161
+ without = options.fetch(:without, [])
162
+ without |= Bundler.settings[:without].map(&:to_s)
202
163
  without -= options[:with] if options[:with]
203
164
 
204
165
  options[:with] = with
@@ -206,28 +167,38 @@ module Bundler
206
167
  end
207
168
 
208
169
  def normalize_settings
209
- Bundler.settings[:path] = nil if options[:system]
210
- Bundler.settings[:path] = "vendor/bundle" if options[:deployment]
211
- Bundler.settings[:path] = options["path"] if options["path"]
212
- Bundler.settings[:path] ||= "bundle" if options["standalone"]
170
+ Bundler.settings.set_command_option :path, nil if options[:system]
171
+ Bundler.settings.temporary(:path_relative_to_cwd => false) do
172
+ Bundler.settings.set_command_option :path, "vendor/bundle" if options[:deployment]
173
+ end
174
+ Bundler.settings.set_command_option_if_given :path, options[:path]
175
+ Bundler.settings.temporary(:path_relative_to_cwd => false) do
176
+ Bundler.settings.set_command_option :path, "bundle" if options["standalone"] && Bundler.settings[:path].nil?
177
+ end
213
178
 
214
- Bundler.settings[:bin] = options["binstubs"] if options["binstubs"]
215
- Bundler.settings[:bin] = nil if options["binstubs"] && options["binstubs"].empty?
179
+ bin_option = options["binstubs"]
180
+ bin_option = nil if bin_option && bin_option.empty?
181
+ Bundler.settings.set_command_option :bin, bin_option if options["binstubs"]
216
182
 
217
- Bundler.settings[:shebang] = options["shebang"] if options["shebang"]
183
+ Bundler.settings.set_command_option_if_given :shebang, options["shebang"]
218
184
 
219
- Bundler.settings[:jobs] = options["jobs"] if options["jobs"]
185
+ Bundler.settings.set_command_option_if_given :jobs, options["jobs"]
220
186
 
221
- Bundler.settings[:no_prune] = true if options["no-prune"]
187
+ Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
222
188
 
223
- Bundler.settings[:no_install] = true if options["no-install"]
189
+ Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
224
190
 
225
- Bundler.settings[:clean] = options["clean"] if options["clean"]
191
+ Bundler.settings.set_command_option_if_given :clean, options["clean"]
226
192
 
227
- Bundler.settings.without = options[:without]
228
- Bundler.settings.with = options[:with]
193
+ unless Bundler.settings[:without] == options[:without] && Bundler.settings[:with] == options[:with]
194
+ # need to nil them out first to get around validation for backwards compatibility
195
+ Bundler.settings.set_command_option :without, nil
196
+ Bundler.settings.set_command_option :with, nil
197
+ Bundler.settings.set_command_option :without, options[:without] - options[:with]
198
+ Bundler.settings.set_command_option :with, options[:with]
199
+ end
229
200
 
230
- Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? true : nil
201
+ options[:force] = options[:redownload]
231
202
  end
232
203
 
233
204
  def warn_ambiguous_gems