rubygems-update 3.1.0.pre3 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.bundle/config +2 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +43 -0
  5. data/History.txt +32 -0
  6. data/Manifest.txt +20 -3
  7. data/Rakefile +2 -6
  8. data/bundler/CHANGELOG.md +3 -3
  9. data/bundler/lib/bundler.rb +0 -1
  10. data/bundler/lib/bundler/build_metadata.rb +2 -0
  11. data/bundler/lib/bundler/cli.rb +4 -3
  12. data/bundler/lib/bundler/cli/config.rb +1 -1
  13. data/bundler/lib/bundler/cli/exec.rb +12 -3
  14. data/bundler/lib/bundler/cli/gem.rb +10 -1
  15. data/bundler/lib/bundler/cli/info.rb +7 -0
  16. data/bundler/lib/bundler/cli/list.rb +11 -9
  17. data/bundler/lib/bundler/cli/outdated.rb +86 -63
  18. data/bundler/lib/bundler/cli/pristine.rb +5 -0
  19. data/bundler/lib/bundler/cli/update.rb +1 -1
  20. data/bundler/lib/bundler/feature_flag.rb +1 -1
  21. data/bundler/lib/bundler/fetcher.rb +2 -2
  22. data/bundler/lib/bundler/fetcher/downloader.rb +1 -1
  23. data/bundler/lib/bundler/fetcher/index.rb +1 -1
  24. data/bundler/lib/bundler/friendly_errors.rb +1 -1
  25. data/bundler/lib/bundler/gem_helper.rb +12 -10
  26. data/bundler/lib/bundler/inline.rb +36 -31
  27. data/bundler/lib/bundler/lazy_specification.rb +0 -1
  28. data/bundler/lib/bundler/mirror.rb +3 -3
  29. data/bundler/lib/bundler/plugin/api/source.rb +2 -4
  30. data/bundler/lib/bundler/remote_specification.rb +0 -2
  31. data/bundler/lib/bundler/rubygems_integration.rb +5 -42
  32. data/bundler/lib/bundler/settings.rb +7 -4
  33. data/bundler/lib/bundler/source/git.rb +9 -9
  34. data/bundler/lib/bundler/source/git/git_proxy.rb +3 -2
  35. data/bundler/lib/bundler/source/rubygems.rb +3 -3
  36. data/bundler/lib/bundler/source/rubygems/remote.rb +1 -1
  37. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +3 -0
  38. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +10 -3
  39. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  40. data/bundler/lib/bundler/uri_credentials_filter.rb +7 -3
  41. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +3 -3
  42. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +26 -26
  43. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +7 -0
  44. data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +10 -6
  45. data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +29 -19
  46. data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  47. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +1 -1
  48. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +13 -2
  49. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +8 -9
  50. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
  51. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +2 -2
  52. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +17 -1
  53. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  54. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  55. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
  56. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
  57. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  58. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
  59. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
  60. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  61. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  62. data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
  63. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
  64. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  65. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
  66. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  67. data/bundler/lib/bundler/vendored_uri.rb +4 -0
  68. data/bundler/man/bundle-add.1 +1 -1
  69. data/bundler/man/bundle-add.1.txt +1 -1
  70. data/bundler/man/bundle-binstubs.1 +1 -1
  71. data/bundler/man/bundle-binstubs.1.txt +1 -1
  72. data/bundler/man/bundle-cache.1 +1 -1
  73. data/bundler/man/bundle-cache.1.txt +1 -1
  74. data/bundler/man/bundle-check.1 +1 -1
  75. data/bundler/man/bundle-check.1.txt +1 -1
  76. data/bundler/man/bundle-clean.1 +1 -1
  77. data/bundler/man/bundle-clean.1.txt +1 -1
  78. data/bundler/man/bundle-config.1 +1 -1
  79. data/bundler/man/bundle-config.1.txt +1 -1
  80. data/bundler/man/bundle-doctor.1 +1 -1
  81. data/bundler/man/bundle-doctor.1.txt +1 -1
  82. data/bundler/man/bundle-exec.1 +1 -1
  83. data/bundler/man/bundle-exec.1.txt +1 -1
  84. data/bundler/man/bundle-gem.1 +1 -1
  85. data/bundler/man/bundle-gem.1.txt +1 -1
  86. data/bundler/man/bundle-info.1 +1 -1
  87. data/bundler/man/bundle-info.1.txt +1 -1
  88. data/bundler/man/bundle-init.1 +1 -1
  89. data/bundler/man/bundle-init.1.txt +1 -1
  90. data/bundler/man/bundle-inject.1 +1 -1
  91. data/bundler/man/bundle-inject.1.txt +1 -1
  92. data/bundler/man/bundle-install.1 +1 -1
  93. data/bundler/man/bundle-install.1.txt +1 -1
  94. data/bundler/man/bundle-list.1 +7 -7
  95. data/bundler/man/bundle-list.1.txt +9 -8
  96. data/bundler/man/bundle-list.ronn +6 -6
  97. data/bundler/man/bundle-lock.1 +1 -1
  98. data/bundler/man/bundle-lock.1.txt +1 -1
  99. data/bundler/man/bundle-open.1 +1 -1
  100. data/bundler/man/bundle-open.1.txt +1 -1
  101. data/bundler/man/bundle-outdated.1 +1 -1
  102. data/bundler/man/bundle-outdated.1.txt +1 -1
  103. data/bundler/man/bundle-platform.1 +1 -1
  104. data/bundler/man/bundle-platform.1.txt +1 -1
  105. data/bundler/man/bundle-pristine.1 +1 -1
  106. data/bundler/man/bundle-pristine.1.txt +1 -1
  107. data/bundler/man/bundle-remove.1 +1 -1
  108. data/bundler/man/bundle-remove.1.txt +1 -1
  109. data/bundler/man/bundle-show.1 +1 -1
  110. data/bundler/man/bundle-show.1.txt +1 -1
  111. data/bundler/man/bundle-update.1 +1 -1
  112. data/bundler/man/bundle-update.1.txt +1 -1
  113. data/bundler/man/bundle-viz.1 +1 -1
  114. data/bundler/man/bundle-viz.1.txt +1 -1
  115. data/bundler/man/bundle.1 +1 -1
  116. data/bundler/man/bundle.1.txt +1 -1
  117. data/bundler/man/gemfile.5 +1 -1
  118. data/bundler/man/gemfile.5.txt +1 -1
  119. data/lib/rubygems.rb +5 -15
  120. data/lib/rubygems/command.rb +28 -6
  121. data/lib/rubygems/commands/generate_index_command.rb +3 -0
  122. data/lib/rubygems/commands/setup_command.rb +1 -1
  123. data/lib/rubygems/commands/sources_command.rb +14 -0
  124. data/lib/rubygems/core_ext/kernel_require.rb +1 -1
  125. data/lib/rubygems/core_ext/kernel_warn.rb +8 -4
  126. data/lib/rubygems/ext/builder.rb +1 -1
  127. data/lib/rubygems/remote_fetcher.rb +20 -31
  128. data/lib/rubygems/request.rb +2 -0
  129. data/lib/rubygems/source.rb +7 -1
  130. data/lib/rubygems/specification_policy.rb +44 -29
  131. data/lib/rubygems/uri_formatter.rb +0 -1
  132. data/lib/rubygems/uri_parser.rb +36 -0
  133. data/lib/rubygems/uri_parsing.rb +23 -0
  134. data/rubygems-update.gemspec +1 -8
  135. data/test/rubygems/test_gem.rb +3 -3
  136. data/test/rubygems/test_gem_command.rb +38 -9
  137. data/test/rubygems/test_gem_commands_generate_index_command.rb +37 -1
  138. data/test/rubygems/test_gem_commands_help_command.rb +1 -6
  139. data/test/rubygems/test_gem_commands_server_command.rb +6 -2
  140. data/test/rubygems/test_gem_commands_sources_command.rb +74 -0
  141. data/test/rubygems/test_gem_gem_runner.rb +3 -1
  142. data/test/rubygems/test_gem_indexer.rb +1 -1
  143. data/test/rubygems/test_gem_source.rb +14 -0
  144. data/test/rubygems/test_gem_specification.rb +48 -48
  145. data/test/rubygems/test_project_sanity.rb +0 -43
  146. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  147. data/test/rubygems/test_require.rb +41 -42
  148. data/util/bisect +0 -21
  149. data/util/ci.sh +1 -1
  150. metadata +23 -90
  151. data/bundler/lib/bundler/gem_remote_fetcher.rb +0 -43
  152. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
  153. data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 885ce9aa3a1ce8a73c527c618dcc435c8dce91f9d7108c192449704e9c4d5f19
4
- data.tar.gz: c2d2369619e4933747732d5895594c5c4413ca8e98db51fc1bd277a7a51f400b
3
+ metadata.gz: 0273e627afbd4a866b93b475062215fa3d664f05b4af35bb281788b0d4ef982f
4
+ data.tar.gz: d7ab9c72b868a79376e8d9c89660084fb5dfb2e81552430f3a501a159e11769e
5
5
  SHA512:
6
- metadata.gz: 68dcc17b3a24684351615370e30d772fa847126e71e7e3b27982f5a81d287fe9b3b80d2982302aa37c9956de18375791c0e397329863910d8db42b5421fcfe09
7
- data.tar.gz: 62834f1044ea634ea0cf952abb117023c01745b367a4746075e13b98d37059854849dafdf63efea93ee51a00d644d008e6e6c34b34917f907dc359ddd03838b0
6
+ metadata.gz: 77432b7859ec5ac93762d5f24f87b18548a30fac80c7f550770e5a22992003e3224dc77ecda5327e2aa78442ee7a555c628207d53f5b069c8cadcef3ac08fa54
7
+ data.tar.gz: 989de44cc58e5f1bface196fb30961b5d737d55209f7c22534029c06cd7f46e2234ab8869aa791a4026e370d5a7dae51b54120407c42d6db6fd0d3442293e2f9
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_PATH__SYSTEM: "true"
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "builder", "~> 3.0"
4
+ gem "rdoc", "~> 6.0"
5
+ gem "rake", "~> 12.0"
6
+ gem "minitest", "~> 5.0"
7
+ gem "simplecov", "~> 0"
8
+ gem "rubocop", "~> 0.74.0"
@@ -0,0 +1,43 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ ast (2.4.0)
5
+ builder (3.2.3)
6
+ docile (1.3.2)
7
+ jaro_winkler (1.5.4)
8
+ json (2.2.0)
9
+ minitest (5.13.0)
10
+ parallel (1.19.1)
11
+ parser (2.6.5.0)
12
+ ast (~> 2.4.0)
13
+ rainbow (3.0.0)
14
+ rake (12.3.3)
15
+ rdoc (6.2.0)
16
+ rubocop (0.74.0)
17
+ jaro_winkler (~> 1.5.1)
18
+ parallel (~> 1.10)
19
+ parser (>= 2.6)
20
+ rainbow (>= 2.2.2, < 4.0)
21
+ ruby-progressbar (~> 1.7)
22
+ unicode-display_width (>= 1.4.0, < 1.7)
23
+ ruby-progressbar (1.10.1)
24
+ simplecov (0.17.1)
25
+ docile (~> 1.1)
26
+ json (>= 1.8, < 3)
27
+ simplecov-html (~> 0.10.0)
28
+ simplecov-html (0.10.2)
29
+ unicode-display_width (1.6.0)
30
+
31
+ PLATFORMS
32
+ ruby
33
+
34
+ DEPENDENCIES
35
+ builder (~> 3.0)
36
+ minitest (~> 5.0)
37
+ rake (~> 12.0)
38
+ rdoc (~> 6.0)
39
+ rubocop (~> 0.74.0)
40
+ simplecov (~> 0)
41
+
42
+ BUNDLED WITH
43
+ 2.0.2
@@ -1,5 +1,37 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 3.1.0 / 2019-12-16
4
+
5
+ Major enhancements:
6
+
7
+ * Vendor bundler 2.1. Pull request #3028 by David Rodríguez.
8
+
9
+ Minor enhancements:
10
+
11
+ * Check for rubygems.org typo squatting sources. Pull request #2999 by
12
+ Luis Sagastume.
13
+ * Refactor remote fetcher. Pull request #3017 by David Rodríguez.
14
+ * Lazily load `open3`. Pull request #3001 by David Rodríguez.
15
+ * Remove `delegate` dependency. Pull request #3002 by David Rodríguez.
16
+ * Lazily load `uri`. Pull request #3005 by David Rodríguez.
17
+ * Lazily load `rubygems/gem_runner` during tests. Pull request #3009 by
18
+ David Rodríguez.
19
+ * Use bundler to manage development dependencies. Pull request #3012 by
20
+ David Rodríguez.
21
+
22
+ Bug fixes:
23
+
24
+ * Remove unnecessary executable flags. Pull request #2982 by David
25
+ Rodríguez.
26
+ * Remove configuration that contained a typo. Pull request #2989 by David
27
+ Rodríguez.
28
+
29
+ Compatibility changes:
30
+
31
+ * Remove 1.8.7 leftovers. Pull request #2972 by David Rodríguez.
32
+ * Deprecate `gem generate_index --modern` and `gem generate_index
33
+ --no-modern`. Pull request #2992 by David Rodríguez.
34
+
3
35
  === 3.1.0.pre3 / 2019-11-11
4
36
 
5
37
  Minor enhancements:
@@ -1,6 +1,9 @@
1
+ .bundle/config
1
2
  .rubocop.yml
2
3
  CODE_OF_CONDUCT.md
3
4
  CONTRIBUTING.md
5
+ Gemfile
6
+ Gemfile.lock
4
7
  History.txt
5
8
  LICENSE.txt
6
9
  MAINTAINERS.txt
@@ -76,7 +79,6 @@ bundler/lib/bundler/fetcher/index.rb
76
79
  bundler/lib/bundler/friendly_errors.rb
77
80
  bundler/lib/bundler/gem_helper.rb
78
81
  bundler/lib/bundler/gem_helpers.rb
79
- bundler/lib/bundler/gem_remote_fetcher.rb
80
82
  bundler/lib/bundler/gem_tasks.rb
81
83
  bundler/lib/bundler/gem_version_promoter.rb
82
84
  bundler/lib/bundler/gemdeps.rb
@@ -169,7 +171,6 @@ bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb
169
171
  bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
170
172
  bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb
171
173
  bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb
172
- bundler/lib/bundler/vendor/fileutils/lib/fileutils/version.rb
173
174
  bundler/lib/bundler/vendor/molinillo/lib/molinillo.rb
174
175
  bundler/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb
175
176
  bundler/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb
@@ -206,13 +207,13 @@ bundler/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
206
207
  bundler/lib/bundler/vendor/thor/lib/thor/base.rb
207
208
  bundler/lib/bundler/vendor/thor/lib/thor/command.rb
208
209
  bundler/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb
209
- bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb
210
210
  bundler/lib/bundler/vendor/thor/lib/thor/error.rb
211
211
  bundler/lib/bundler/vendor/thor/lib/thor/group.rb
212
212
  bundler/lib/bundler/vendor/thor/lib/thor/invocation.rb
213
213
  bundler/lib/bundler/vendor/thor/lib/thor/line_editor.rb
214
214
  bundler/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb
215
215
  bundler/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb
216
+ bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb
216
217
  bundler/lib/bundler/vendor/thor/lib/thor/parser.rb
217
218
  bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb
218
219
  bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb
@@ -226,10 +227,24 @@ bundler/lib/bundler/vendor/thor/lib/thor/shell/color.rb
226
227
  bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb
227
228
  bundler/lib/bundler/vendor/thor/lib/thor/util.rb
228
229
  bundler/lib/bundler/vendor/thor/lib/thor/version.rb
230
+ bundler/lib/bundler/vendor/uri/lib/uri.rb
231
+ bundler/lib/bundler/vendor/uri/lib/uri/common.rb
232
+ bundler/lib/bundler/vendor/uri/lib/uri/file.rb
233
+ bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb
234
+ bundler/lib/bundler/vendor/uri/lib/uri/generic.rb
235
+ bundler/lib/bundler/vendor/uri/lib/uri/http.rb
236
+ bundler/lib/bundler/vendor/uri/lib/uri/https.rb
237
+ bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb
238
+ bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb
239
+ bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb
240
+ bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb
241
+ bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb
242
+ bundler/lib/bundler/vendor/uri/lib/uri/version.rb
229
243
  bundler/lib/bundler/vendored_fileutils.rb
230
244
  bundler/lib/bundler/vendored_molinillo.rb
231
245
  bundler/lib/bundler/vendored_persistent.rb
232
246
  bundler/lib/bundler/vendored_thor.rb
247
+ bundler/lib/bundler/vendored_uri.rb
233
248
  bundler/lib/bundler/version.rb
234
249
  bundler/lib/bundler/version_ranges.rb
235
250
  bundler/lib/bundler/vlad.rb
@@ -492,6 +507,8 @@ lib/rubygems/test_utilities.rb
492
507
  lib/rubygems/text.rb
493
508
  lib/rubygems/uninstaller.rb
494
509
  lib/rubygems/uri_formatter.rb
510
+ lib/rubygems/uri_parser.rb
511
+ lib/rubygems/uri_parsing.rb
495
512
  lib/rubygems/user_interaction.rb
496
513
  lib/rubygems/util.rb
497
514
  lib/rubygems/util/licenses.rb
data/Rakefile CHANGED
@@ -7,11 +7,8 @@ require 'psych'
7
7
 
8
8
  desc "Setup Rubygems dev environment"
9
9
  task :setup => ["bundler:checkout"] do
10
- gemspec = Gem::Specification.load(File.expand_path("../rubygems-update.gemspec", __FILE__))
11
-
12
- gemspec.dependencies.each do |dep|
13
- sh "gem install '#{dep.name}:#{dep.requirement.to_s}' --conservative --no-document --force"
14
- end
10
+ sh "gem install bundler:2.0.2"
11
+ sh "bundle install"
15
12
  end
16
13
 
17
14
  desc "Setup git hooks"
@@ -23,7 +20,6 @@ Rake::TestTask.new do |t|
23
20
  t.ruby_opts = %w[-w]
24
21
  t.ruby_opts << '-rdevkit' if Gem.win_platform?
25
22
 
26
- t.libs << "libs"
27
23
  t.libs << "test"
28
24
  t.libs << "bundler/lib"
29
25
 
@@ -20,13 +20,13 @@ Bugfixes:
20
20
  Bugfixes:
21
21
 
22
22
  - Fix `bundle clean` trying to delete non-existent directory ([#7340](https://github.com/bundler/bundler/pull/7340))
23
- - Fix warnings about keywork argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))
23
+ - Fix warnings about keyword argument separation on ruby 2.7 ([#7337](https://github.com/bundler/bundler/pull/7337))
24
24
 
25
25
  ## 2.1.0.pre.1 (August 28, 2019)
26
26
 
27
27
  One of the biggest changes in bundler 2.1.0 is that deprecations for upcoming
28
28
  breaking changes in bundler 3 will be turned on by default. We do this to grab
29
- feedback and comunicate early to our users the kind of changes we're intending
29
+ feedback and communicate early to our users the kind of changes we're intending
30
30
  to ship with bundler 3. See
31
31
  [#6965](https://github.com/bundler/bundler/pull/6965).
32
32
 
@@ -89,7 +89,7 @@ Bugfixes:
89
89
  - Warn about situations where multiple gems provide the same executable ([#7075](https://github.com/bundler/bundler/pull/7075))
90
90
  - Ignore `frozen` setting in inline mode ([#7125](https://github.com/bundler/bundler/pull/7125))
91
91
  - Fix incorrect "bundler attempted to update GEM but version stayed the same" message when updating git sourced gems ([#6325](https://github.com/bundler/bundler/pull/6325))
92
- - Don't check for existance of a writable home directory if `BUNDLE_USER_HOME` is set ([#6885](https://github.com/bundler/bundler/pull/6885))
92
+ - Don't check for existence of a writable home directory if `BUNDLE_USER_HOME` is set ([#6885](https://github.com/bundler/bundler/pull/6885))
93
93
  - Fix error message when server would respond to a bad username/password requiest with a 401 ([#6928](https://github.com/bundler/bundler/pull/6928))
94
94
  - Fix `bundle outdated` pluralization when multiple groups are requested ([#7063](https://github.com/bundler/bundler/pull/7063))
95
95
  - Fix `bundle install` not updating conservatively when gemspec is changed ([#7143](https://github.com/bundler/bundler/pull/7143))
@@ -50,7 +50,6 @@ module Bundler
50
50
  autoload :FeatureFlag, File.expand_path("bundler/feature_flag", __dir__)
51
51
  autoload :GemHelper, File.expand_path("bundler/gem_helper", __dir__)
52
52
  autoload :GemHelpers, File.expand_path("bundler/gem_helpers", __dir__)
53
- autoload :GemRemoteFetcher, File.expand_path("bundler/gem_remote_fetcher", __dir__)
54
53
  autoload :GemVersionPromoter, File.expand_path("bundler/gem_version_promoter", __dir__)
55
54
  autoload :Graph, File.expand_path("bundler/graph", __dir__)
56
55
  autoload :Index, File.expand_path("bundler/index", __dir__)
@@ -4,6 +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-12-16".freeze
8
+ @git_commit_sha = "4045ba4bb".freeze
7
9
  @release = false
8
10
  # end ivars
9
11
 
@@ -342,8 +342,8 @@ module Bundler
342
342
 
343
343
  desc "list", "List all gems in the bundle"
344
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"
345
+ method_option "only-group", :type => :array, :default => [], :banner => "print gems from a given set of groups"
346
+ method_option "without-group", :type => :array, :default => [], :banner => "print all gems except from a given set of groups"
347
347
  method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
348
348
  def list
349
349
  require_relative "cli/list"
@@ -567,6 +567,7 @@ module Bundler
567
567
  method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
568
568
  method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
569
569
  method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
570
+ method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set gem.rubocop true`."
570
571
  method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
571
572
  :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config set gem.test rspec`."
572
573
  def gem(name)
@@ -783,7 +784,7 @@ module Bundler
783
784
  return unless SharedHelpers.md5_available?
784
785
 
785
786
  latest = Fetcher::CompactIndex.
786
- new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
787
+ new(nil, Source::Rubygems::Remote.new(Bundler::URI("https://rubygems.org")), nil).
787
788
  send(:compact_index_client).
788
789
  instance_variable_get(:@cache).
789
790
  dependencies("bundler").
@@ -25,7 +25,7 @@ module Bundler
25
25
  ["config", "get", ARGV[1]]
26
26
  end
27
27
 
28
- SharedHelpers.major_deprecation 2,
28
+ SharedHelpers.major_deprecation 3,
29
29
  "Using the `config` command without a subcommand [list, get, set, unset] is deprecated and will be removed in the future. Use `bundle #{new_args.join(" ")}` instead."
30
30
 
31
31
  Base.new(options, name, value, self).run
@@ -25,12 +25,12 @@ module Bundler
25
25
  SharedHelpers.set_bundle_environment
26
26
  if bin_path = Bundler.which(cmd)
27
27
  if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
28
- return kernel_load(bin_path, *args)
28
+ return with_verbose_rubygems { kernel_load(bin_path, *args) }
29
29
  end
30
- kernel_exec(bin_path, *args)
30
+ with_verbose_rubygems { kernel_exec(bin_path, *args) }
31
31
  else
32
32
  # exec using the given command
33
- kernel_exec(cmd, *args)
33
+ with_verbose_rubygems { kernel_exec(cmd, *args) }
34
34
  end
35
35
  end
36
36
 
@@ -89,5 +89,14 @@ module Bundler
89
89
  first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
90
90
  possibilities.any? {|shebang| first_line.start_with?(shebang) }
91
91
  end
92
+
93
+ def with_verbose_rubygems
94
+ old_ui = Gem::DefaultUserInteraction.ui
95
+ Gem::DefaultUserInteraction.ui = nil
96
+
97
+ yield
98
+ ensure
99
+ Gem::DefaultUserInteraction.ui = old_ui
100
+ end
92
101
  end
93
102
  end
@@ -100,7 +100,7 @@ module Bundler
100
100
  end
101
101
  end
102
102
 
103
- config[:test_task] = config[:test] == "minitest" ? "test" : "spec"
103
+ config[:test_task] = config[:test] == "minitest" ? :test : :spec
104
104
 
105
105
  if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
106
106
  "This means that any other developer or company will be legally allowed to use your code " \
@@ -124,6 +124,15 @@ module Bundler
124
124
  templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
125
125
  end
126
126
 
127
+ if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
128
+ "RuboCop is a static code analyzer that has out-of-the-box rules for many " \
129
+ "of the guidelines in the community style guide. " \
130
+ "For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
131
+ "and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
132
+ config[:rubocop] = true
133
+ Bundler.ui.info "RuboCop enabled in config"
134
+ end
135
+
127
136
  templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
128
137
 
129
138
  if options[:ext]
@@ -50,10 +50,17 @@ module Bundler
50
50
  end
51
51
 
52
52
  def print_gem_info(spec)
53
+ metadata = spec.metadata
53
54
  gem_info = String.new
54
55
  gem_info << " * #{spec.name} (#{spec.version}#{spec.git_version})\n"
55
56
  gem_info << "\tSummary: #{spec.summary}\n" if spec.summary
56
57
  gem_info << "\tHomepage: #{spec.homepage}\n" if spec.homepage
58
+ gem_info << "\tDocumentation: #{metadata["documentation_uri"]}\n" if metadata.key?("documentation_uri")
59
+ gem_info << "\tSource Code: #{metadata["source_code_uri"]}\n" if metadata.key?("source_code_uri")
60
+ gem_info << "\tWiki: #{metadata["wiki_uri"]}\n" if metadata.key?("wiki_uri")
61
+ gem_info << "\tChangelog: #{metadata["changelog_uri"]}\n" if metadata.key?("changelog_uri")
62
+ gem_info << "\tBug Tracker: #{metadata["bug_tracker_uri"]}\n" if metadata.key?("bug_tracker_uri")
63
+ gem_info << "\tMailing List: #{metadata["mailing_list_uri"]}\n" if metadata.key?("mailing_list_uri")
57
64
  gem_info << "\tPath: #{spec.full_gem_path}\n"
58
65
  gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
59
66
  Bundler.ui.info gem_info
@@ -4,14 +4,16 @@ module Bundler
4
4
  class CLI::List
5
5
  def initialize(options)
6
6
  @options = options
7
+ @without_group = options["without-group"].map(&:to_sym)
8
+ @only_group = options["only-group"].map(&:to_sym)
7
9
  end
8
10
 
9
11
  def run
10
- raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @options["only-group"] && @options["without-group"]
12
+ raise InvalidOption, "The `--only-group` and `--without-group` options cannot be used together" if @only_group.any? && @without_group.any?
11
13
 
12
14
  raise InvalidOption, "The `--name-only` and `--paths` options cannot be used together" if @options["name-only"] && @options[:paths]
13
15
 
14
- specs = if @options["only-group"] || @options["without-group"]
16
+ specs = if @only_group.any? || @without_group.any?
15
17
  filtered_specs_by_groups
16
18
  else
17
19
  Bundler.load.specs
@@ -32,9 +34,9 @@ module Bundler
32
34
  private
33
35
 
34
36
  def verify_group_exists(groups)
35
- raise InvalidOption, "`#{@options["without-group"]}` group could not be found." if @options["without-group"] && !groups.include?(@options["without-group"].to_sym)
36
-
37
- raise InvalidOption, "`#{@options["only-group"]}` group could not be found." if @options["only-group"] && !groups.include?(@options["only-group"].to_sym)
37
+ (@without_group + @only_group).each do |group|
38
+ raise InvalidOption, "`#{group}` group could not be found." unless groups.include?(group)
39
+ end
38
40
  end
39
41
 
40
42
  def filtered_specs_by_groups
@@ -44,10 +46,10 @@ module Bundler
44
46
  verify_group_exists(groups)
45
47
 
46
48
  show_groups =
47
- if @options["without-group"]
48
- groups.reject {|g| g == @options["without-group"].to_sym }
49
- elsif @options["only-group"]
50
- groups.select {|g| g == @options["only-group"].to_sym }
49
+ if @without_group.any?
50
+ groups.reject {|g| @without_group.include?(g) }
51
+ elsif @only_group.any?
52
+ groups.select {|g| @only_group.include?(g) }
51
53
  else
52
54
  groups
53
55
  end.map(&:to_sym)
@@ -3,18 +3,16 @@
3
3
  module Bundler
4
4
  class CLI::Outdated
5
5
  attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
6
- attr_accessor :outdated_gems_by_groups, :outdated_gems_list
6
+ attr_accessor :outdated_gems
7
7
 
8
8
  def initialize(options, gems)
9
9
  @options = options
10
10
  @gems = gems
11
11
  @sources = Array(options[:source])
12
12
 
13
- @filter_options_patch = options.keys &
14
- %w[filter-major filter-minor filter-patch]
13
+ @filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch]
15
14
 
16
- @outdated_gems_by_groups = {}
17
- @outdated_gems_list = []
15
+ @outdated_gems = []
18
16
 
19
17
  @options_include_groups = [:group, :groups].any? do |v|
20
18
  options.keys.include?(v.to_s)
@@ -22,8 +20,7 @@ module Bundler
22
20
 
23
21
  # the patch level options imply strict is also true. It wouldn't make
24
22
  # sense otherwise.
25
- @strict = options["filter-strict"] ||
26
- Bundler::CLI::Common.patch_level_options(options).any?
23
+ @strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any?
27
24
  end
28
25
 
29
26
  def run
@@ -76,58 +73,52 @@ module Bundler
76
73
  end
77
74
 
78
75
  specs.sort_by(&:name).each do |current_spec|
79
- next if !gems.empty? && !gems.include?(current_spec.name)
76
+ next unless gems.empty? || gems.include?(current_spec.name)
80
77
 
81
- dependency = current_dependencies[current_spec.name]
82
78
  active_spec = retrieve_active_spec(definition, current_spec)
83
-
84
- next if active_spec.nil?
85
- next if filter_options_patch.any? &&
86
- !update_present_via_semver_portions(current_spec, active_spec, options)
79
+ next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
87
80
 
88
81
  gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
89
82
  next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
90
- groups = nil
83
+
84
+ dependency = current_dependencies[current_spec.name]
85
+ groups = ""
91
86
  if dependency && !options[:parseable]
92
87
  groups = dependency.groups.join(", ")
93
88
  end
94
89
 
95
- outdated_gems_list << { :active_spec => active_spec,
96
- :current_spec => current_spec,
97
- :dependency => dependency,
98
- :groups => groups }
99
-
100
- outdated_gems_by_groups[groups] ||= []
101
- outdated_gems_by_groups[groups] << outdated_gems_list[-1]
90
+ outdated_gems << {
91
+ :active_spec => active_spec,
92
+ :current_spec => current_spec,
93
+ :dependency => dependency,
94
+ :groups => groups,
95
+ }
102
96
  end
103
97
 
104
- if outdated_gems_list.empty?
105
- display_nothing_outdated_message
106
- else
98
+ if outdated_gems.empty?
107
99
  unless options[:parseable]
108
- Bundler.ui.info(header_outdated_message)
100
+ Bundler.ui.info(nothing_outdated_message)
109
101
  end
110
-
102
+ else
111
103
  if options_include_groups
112
- ordered_groups = outdated_gems_by_groups.keys.compact.sort
113
- ordered_groups.insert(0, nil).each do |groups|
114
- gems = outdated_gems_by_groups[groups]
115
- contains_group = if groups
116
- groups.split(", ").include?(options[:group])
117
- else
118
- options[:group] == "group"
119
- end
104
+ relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
105
+ contains_group = groups.split(", ").include?(options[:group])
106
+ next unless options[:groups] || contains_group
120
107
 
121
- next if (!options[:groups] && !contains_group) || gems.nil?
108
+ gems
109
+ end.compact
122
110
 
123
- unless options[:parseable]
124
- Bundler.ui.info(header_group_message(groups))
111
+ if options[:parseable]
112
+ relevant_outdated_gems.each do |gems|
113
+ print_gems(gems)
125
114
  end
126
-
127
- print_gems(gems)
115
+ else
116
+ print_gems_table(relevant_outdated_gems)
128
117
  end
118
+ elsif options[:parseable]
119
+ print_gems(outdated_gems)
129
120
  else
130
- print_gems(outdated_gems_list)
121
+ print_gems_table(outdated_gems)
131
122
  end
132
123
 
133
124
  exit 1
@@ -140,22 +131,6 @@ module Bundler
140
131
  "#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
141
132
  end
142
133
 
143
- def header_outdated_message
144
- if options[:pre]
145
- "Outdated gems included in the bundle (including pre-releases):"
146
- else
147
- "Outdated gems included in the bundle:"
148
- end
149
- end
150
-
151
- def header_group_message(groups)
152
- if groups
153
- "===== #{groups_text("Group", groups)} ====="
154
- else
155
- "===== Without group ====="
156
- end
157
- end
158
-
159
134
  def nothing_outdated_message
160
135
  if filter_options_patch.any?
161
136
  display = filter_options_patch.map do |o|
@@ -182,12 +157,6 @@ module Bundler
182
157
  active_spec
183
158
  end
184
159
 
185
- def display_nothing_outdated_message
186
- unless options[:parseable]
187
- Bundler.ui.info(nothing_outdated_message)
188
- end
189
- end
190
-
191
160
  def print_gems(gems_list)
192
161
  gems_list.each do |gem|
193
162
  print_gem(
@@ -199,6 +168,19 @@ module Bundler
199
168
  end
200
169
  end
201
170
 
171
+ def print_gems_table(gems_list)
172
+ data = gems_list.map do |gem|
173
+ gem_column_for(
174
+ gem[:current_spec],
175
+ gem[:active_spec],
176
+ gem[:dependency],
177
+ gem[:groups],
178
+ )
179
+ end
180
+
181
+ print_indented([table_header] + data)
182
+ end
183
+
202
184
  def print_gem(current_spec, active_spec, dependency, groups)
203
185
  spec_version = "#{active_spec.version}#{active_spec.git_version}"
204
186
  spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
@@ -213,7 +195,7 @@ module Bundler
213
195
 
214
196
  output_message = if options[:parseable]
215
197
  spec_outdated_info.to_s
216
- elsif options_include_groups || !groups
198
+ elsif options_include_groups || groups.empty?
217
199
  " * #{spec_outdated_info}"
218
200
  else
219
201
  " * #{spec_outdated_info} in #{groups_text("group", groups)}"
@@ -222,6 +204,16 @@ module Bundler
222
204
  Bundler.ui.info output_message.rstrip
223
205
  end
224
206
 
207
+ def gem_column_for(current_spec, active_spec, dependency, groups)
208
+ current_version = "#{current_spec.version}#{current_spec.git_version}"
209
+ spec_version = "#{active_spec.version}#{active_spec.git_version}"
210
+ dependency = dependency.requirement if dependency
211
+
212
+ ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
213
+ ret_val << active_spec.loaded_from.to_s if Bundler.ui.debug?
214
+ ret_val
215
+ end
216
+
225
217
  def check_for_deployment_mode!
226
218
  return unless Bundler.frozen_bundle?
227
219
  suggested_command = if Bundler.settings.locations("frozen")[:global]
@@ -239,6 +231,8 @@ module Bundler
239
231
  end
240
232
 
241
233
  def update_present_via_semver_portions(current_spec, active_spec, options)
234
+ return false if active_spec.nil?
235
+
242
236
  current_major = current_spec.version.segments.first
243
237
  active_major = active_spec.version.segments.first
244
238
 
@@ -266,5 +260,34 @@ module Bundler
266
260
  version_section = spec.version.segments[version_portion_index, 1]
267
261
  version_section.to_a[0].to_i
268
262
  end
263
+
264
+ def print_indented(matrix)
265
+ header = matrix[0]
266
+ data = matrix[1..-1]
267
+
268
+ column_sizes = Array.new(header.size) do |index|
269
+ matrix.max_by {|row| row[index].length }[index].length
270
+ end
271
+
272
+ Bundler.ui.info justify(header, column_sizes)
273
+
274
+ data.sort_by! {|row| row[0] }
275
+
276
+ data.each do |row|
277
+ Bundler.ui.info justify(row, column_sizes)
278
+ end
279
+ end
280
+
281
+ def table_header
282
+ header = ["Gem", "Current", "Latest", "Requested", "Groups"]
283
+ header << "Path" if Bundler.ui.debug?
284
+ header
285
+ end
286
+
287
+ def justify(row, sizes)
288
+ row.each_with_index.map do |element, index|
289
+ element.ljust(sizes[index])
290
+ end.join(" ").strip + "\n"
291
+ end
269
292
  end
270
293
  end