rubygems-update 3.2.30 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +163 -4
  3. data/CONTRIBUTING.md +40 -10
  4. data/Manifest.txt +28 -5
  5. data/POLICIES.md +22 -8
  6. data/README.md +9 -7
  7. data/UPGRADING.md +5 -81
  8. data/bin/gem +1 -6
  9. data/bundler/CHANGELOG.md +86 -0
  10. data/bundler/exe/bundle +7 -8
  11. data/bundler/lib/bundler/build_metadata.rb +2 -2
  12. data/bundler/lib/bundler/cli/doctor.rb +3 -2
  13. data/bundler/lib/bundler/cli/gem.rb +70 -8
  14. data/bundler/lib/bundler/cli/info.rb +6 -1
  15. data/bundler/lib/bundler/cli/install.rb +2 -0
  16. data/bundler/lib/bundler/cli/update.rb +2 -2
  17. data/bundler/lib/bundler/cli.rb +9 -1
  18. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -5
  19. data/bundler/lib/bundler/definition.rb +66 -120
  20. data/bundler/lib/bundler/dependency.rb +5 -7
  21. data/bundler/lib/bundler/dsl.rb +18 -30
  22. data/bundler/lib/bundler/endpoint_specification.rb +0 -8
  23. data/bundler/lib/bundler/environment_preserver.rb +4 -1
  24. data/bundler/lib/bundler/fetcher/compact_index.rb +9 -4
  25. data/bundler/lib/bundler/fetcher.rb +2 -5
  26. data/bundler/lib/bundler/gem_helper.rb +2 -2
  27. data/bundler/lib/bundler/injector.rb +10 -1
  28. data/bundler/lib/bundler/installer/gem_installer.rb +1 -6
  29. data/bundler/lib/bundler/installer.rb +1 -4
  30. data/bundler/lib/bundler/lazy_specification.rb +17 -1
  31. data/bundler/lib/bundler/lockfile_parser.rb +10 -12
  32. data/bundler/lib/bundler/man/bundle-add.1 +10 -2
  33. data/bundler/lib/bundler/man/bundle-add.1.ronn +7 -1
  34. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-config.1 +5 -5
  39. data/bundler/lib/bundler/man/bundle-config.1.ronn +5 -5
  40. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-gem.1 +14 -1
  43. data/bundler/lib/bundler/man/bundle-gem.1.ronn +16 -0
  44. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-install.1 +2 -2
  48. data/bundler/lib/bundler/man/bundle-install.1.ronn +2 -2
  49. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-update.1 +2 -2
  58. data/bundler/lib/bundler/man/bundle-update.1.ronn +2 -1
  59. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  60. data/bundler/lib/bundler/man/bundle.1 +1 -1
  61. data/bundler/lib/bundler/man/gemfile.5 +28 -2
  62. data/bundler/lib/bundler/man/gemfile.5.ronn +9 -1
  63. data/bundler/lib/bundler/plugin/api/source.rb +1 -0
  64. data/bundler/lib/bundler/plugin/installer.rb +1 -1
  65. data/bundler/lib/bundler/process_lock.rb +1 -1
  66. data/bundler/lib/bundler/psyched_yaml.rb +1 -13
  67. data/bundler/lib/bundler/resolver.rb +34 -31
  68. data/bundler/lib/bundler/rubygems_ext.rb +2 -0
  69. data/bundler/lib/bundler/rubygems_integration.rb +11 -48
  70. data/bundler/lib/bundler/runtime.rb +1 -1
  71. data/bundler/lib/bundler/self_manager.rb +73 -0
  72. data/bundler/lib/bundler/shared_helpers.rb +4 -12
  73. data/bundler/lib/bundler/source/git/git_proxy.rb +7 -4
  74. data/bundler/lib/bundler/source/metadata.rb +1 -1
  75. data/bundler/lib/bundler/source/rubygems.rb +17 -13
  76. data/bundler/lib/bundler/source/rubygems_aggregate.rb +1 -1
  77. data/bundler/lib/bundler/source.rb +1 -1
  78. data/bundler/lib/bundler/source_list.rb +7 -29
  79. data/bundler/lib/bundler/spec_set.rb +1 -1
  80. data/bundler/lib/bundler/templates/Executable.bundler +1 -1
  81. data/bundler/lib/bundler/templates/Gemfile +0 -2
  82. data/bundler/lib/bundler/templates/gems.rb +0 -3
  83. data/bundler/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  84. data/bundler/lib/bundler/templates/newgem/Rakefile.tt +15 -2
  85. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -2
  86. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +13 -13
  87. data/bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  88. data/bundler/lib/bundler/templates/newgem/standard.yml.tt +2 -0
  89. data/bundler/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
  90. data/bundler/lib/bundler/ui/shell.rb +1 -1
  91. data/bundler/lib/bundler/vendor/.document +1 -0
  92. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  93. data/bundler/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  94. data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
  95. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
  96. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
  97. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
  98. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
  99. data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
  100. data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  101. data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
  102. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
  103. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
  104. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  105. data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
  106. data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
  107. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +0 -1
  108. data/bundler/lib/bundler/vendored_tsort.rb +4 -0
  109. data/bundler/lib/bundler/version.rb +1 -1
  110. data/bundler/lib/bundler.rb +9 -3
  111. data/hide_lib_for_update/note.txt +0 -4
  112. data/lib/rubygems/command.rb +4 -4
  113. data/lib/rubygems/command_manager.rb +4 -2
  114. data/lib/rubygems/commands/cert_command.rb +6 -6
  115. data/lib/rubygems/commands/fetch_command.rb +1 -1
  116. data/lib/rubygems/commands/install_command.rb +5 -2
  117. data/lib/rubygems/commands/pristine_command.rb +8 -2
  118. data/lib/rubygems/commands/server_command.rb +14 -77
  119. data/lib/rubygems/commands/setup_command.rb +84 -76
  120. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  121. data/lib/rubygems/commands/update_command.rb +10 -5
  122. data/lib/rubygems/defaults.rb +2 -20
  123. data/lib/rubygems/dependency_list.rb +2 -2
  124. data/lib/rubygems/deprecate.rb +53 -6
  125. data/lib/rubygems/exceptions.rb +27 -1
  126. data/lib/rubygems/ext/builder.rb +11 -8
  127. data/lib/rubygems/ext/cmake_builder.rb +1 -1
  128. data/lib/rubygems/install_update_options.rb +13 -4
  129. data/lib/rubygems/installer.rb +46 -27
  130. data/lib/rubygems/local_remote_options.rb +3 -3
  131. data/lib/rubygems/name_tuple.rb +2 -3
  132. data/lib/rubygems/optparse/.document +1 -0
  133. data/lib/rubygems/optparse/COPYING +56 -0
  134. data/lib/rubygems/optparse/lib/optionparser.rb +2 -0
  135. data/lib/rubygems/optparse/lib/optparse/ac.rb +54 -0
  136. data/lib/rubygems/optparse/lib/optparse/date.rb +18 -0
  137. data/lib/rubygems/optparse/lib/optparse/kwargs.rb +22 -0
  138. data/lib/rubygems/optparse/lib/optparse/shellwords.rb +7 -0
  139. data/lib/rubygems/optparse/lib/optparse/time.rb +11 -0
  140. data/lib/rubygems/optparse/lib/optparse/uri.rb +7 -0
  141. data/lib/rubygems/optparse/lib/optparse/version.rb +71 -0
  142. data/lib/rubygems/optparse/lib/optparse.rb +2230 -0
  143. data/lib/rubygems/optparse.rb +3 -0
  144. data/lib/rubygems/path_support.rb +1 -6
  145. data/lib/rubygems/platform.rb +4 -0
  146. data/lib/rubygems/remote_fetcher.rb +1 -1
  147. data/lib/rubygems/request_set.rb +2 -2
  148. data/lib/rubygems/requirement.rb +1 -1
  149. data/lib/rubygems/resolver/installer_set.rb +1 -1
  150. data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  151. data/lib/rubygems/security.rb +4 -3
  152. data/lib/rubygems/security_option.rb +3 -3
  153. data/lib/rubygems/source.rb +3 -1
  154. data/lib/rubygems/spec_fetcher.rb +1 -1
  155. data/lib/rubygems/specification.rb +46 -46
  156. data/lib/rubygems/text.rb +21 -20
  157. data/lib/rubygems/tsort/.document +1 -0
  158. data/lib/rubygems/tsort/LICENSE.txt +22 -0
  159. data/lib/rubygems/tsort/lib/tsort.rb +454 -0
  160. data/lib/rubygems/tsort.rb +3 -0
  161. data/lib/rubygems/uninstaller.rb +4 -1
  162. data/lib/rubygems/unknown_command_spell_checker.rb +21 -0
  163. data/lib/rubygems/util/licenses.rb +2 -0
  164. data/lib/rubygems/version.rb +2 -0
  165. data/lib/rubygems/version_option.rb +2 -2
  166. data/lib/rubygems.rb +13 -10
  167. data/rubygems-update.gemspec +1 -1
  168. data/setup.rb +1 -6
  169. data/test/rubygems/encrypted_private_key.pem +26 -26
  170. data/test/rubygems/helper.rb +48 -38
  171. data/test/rubygems/test_config.rb +2 -2
  172. data/test/rubygems/test_exit.rb +11 -0
  173. data/test/rubygems/test_gem.rb +46 -41
  174. data/test/rubygems/test_gem_command.rb +1 -1
  175. data/test/rubygems/test_gem_command_manager.rb +28 -2
  176. data/test/rubygems/test_gem_commands_cert_command.rb +8 -8
  177. data/test/rubygems/test_gem_commands_fetch_command.rb +36 -0
  178. data/test/rubygems/test_gem_commands_open_command.rb +1 -1
  179. data/test/rubygems/test_gem_commands_server_command.rb +4 -46
  180. data/test/rubygems/test_gem_commands_setup_command.rb +67 -19
  181. data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
  182. data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
  183. data/test/rubygems/test_gem_commands_update_command.rb +2 -2
  184. data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
  185. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +7 -3
  186. data/test/rubygems/test_gem_install_update_options.rb +2 -2
  187. data/test/rubygems/test_gem_installer.rb +37 -5
  188. data/test/rubygems/test_gem_path_support.rb +2 -6
  189. data/test/rubygems/test_gem_remote_fetcher.rb +15 -0
  190. data/test/rubygems/test_gem_request.rb +10 -4
  191. data/test/rubygems/test_gem_requirement.rb +0 -1
  192. data/test/rubygems/test_gem_resolver.rb +7 -7
  193. data/test/rubygems/test_gem_security.rb +1 -1
  194. data/test/rubygems/test_gem_specification.rb +27 -25
  195. data/test/rubygems/test_gem_text.rb +6 -0
  196. data/test/rubygems/test_project_sanity.rb +1 -1
  197. data/test/rubygems/test_require.rb +8 -35
  198. data/test/rubygems/test_rubygems.rb +23 -0
  199. metadata +31 -8
  200. data/bundler/lib/bundler/gemdeps.rb +0 -29
  201. data/lib/rubygems/server.rb +0 -882
  202. data/test/rubygems/bogussources.rb +0 -9
  203. data/test/rubygems/test_gem_server.rb +0 -608
data/UPGRADING.md CHANGED
@@ -1,91 +1,15 @@
1
1
  # How to upgrade/downgrade Rubygems:
2
2
 
3
- ## For RubyGems 1.5.0 and 1.5.1:
4
-
5
- RubyGems 1.5.0 and 1.5.1 shipped with a broken `gem update --system`. You will
6
- need to use the Manual Upgrade Recipe below.
7
-
8
- ## On Ruby 1.9.x:
9
-
10
- ### From stock ruby shipping with 1.9:
11
-
12
- Use the Normal Upgrade Method below. (finally!)
13
-
14
- ## On Ruby 1.8.x:
15
-
16
- ### From rubygems 1.3.x:
17
-
18
- Use the Normal Upgrade Recipe below.
19
-
20
- ### From rubygems 1-1.x through 1.2.x:
21
-
22
- RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update
23
- installed. You will need to use the following instructions if you see "Nothing
24
- to update".
25
-
26
- Use the Manual Upgrade Recipe below.
27
-
28
- ### From rubygems < 1.1.x:
29
-
30
- Use the Normal Upgrade Recipe below.
31
-
32
3
  ## Downgrade Recipe
33
4
 
34
- ### Normal Downgrade
35
-
36
- #### With rubygems 1.5.2 and higher:
37
-
38
- $ gem update --system 1.3.7
39
-
40
- #### With rubygems 1.5.1 and lower:
5
+ $ gem update --system 3.1.4
41
6
 
42
- Use sudo/su as appropriate:
43
-
44
- $ gem install rubygems-update -v 1.3.7
45
- $ update_rubygems _1.3.7_
46
-
47
- Replace 1.3.7 with whatever version you want to downgrade to. This recipe can
48
- also be used to upgrade to a specific version instead of the latest.
49
-
50
- Do make sure that you don't have any other versions of rubygems-update
51
- installed when you run the second command.
52
-
53
- ### 1.9.2 Downgrade from Rubygems 1.4.x+ to stock 1.9 rubygems:
54
-
55
- Use sudo/su as appropriate:
56
-
57
- $ ruby --disable-gems -S gem which rubygems
58
- ~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb
59
- $ rm ~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb
60
- $ rm -rf ~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems
61
- $ gem -v
62
- 1.3.7
63
-
64
- ## Upgrade Recipes
65
-
66
- ### Normal Upgrade
67
-
68
- Use sudo/su as appropriate:
7
+ ## Upgrade Recipe
69
8
 
70
9
  $ gem update --system
71
10
 
72
- ### Manual Upgrade
73
-
74
- If you have an older version of RubyGems installed, then you can still do it
75
- in two steps:
76
-
77
- Use sudo/su as appropriate:
78
-
79
- $ gem install rubygems-update
80
- $ update_rubygems
81
-
82
- ### Manual Install
83
-
84
- If you don't have any RubyGems install, there is still the pre-gem approach to
85
- getting software, doing it manually:
86
-
87
- Use sudo/su as appropriate:
11
+ ## Install from source
88
12
 
89
13
  * Download from: https://rubygems.org/pages/download
90
- * Unpack into a directory and cd there
91
- * Install with: ruby setup.rb
14
+ * Unpack into a directory and `cd` there
15
+ * Install with: `ruby setup.rb`
data/bin/gem CHANGED
@@ -7,12 +7,7 @@
7
7
 
8
8
  require 'rubygems'
9
9
  require 'rubygems/gem_runner'
10
- require 'rubygems/exceptions'
11
10
 
12
11
  args = ARGV.clone
13
12
 
14
- begin
15
- Gem::GemRunner.new.run args
16
- rescue Gem::SystemExitException => e
17
- exit e.exit_code
18
- end
13
+ Gem::GemRunner.new.run args
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,89 @@
1
+ # 2.3.0 (December 21, 2021)
2
+
3
+ ## Features:
4
+
5
+ - Change `bundle install` with a lockfile to respect the `BUNDLED WITH` bundler version [#4076](https://github.com/rubygems/rubygems/pull/4076)
6
+
7
+ ## Enhancements:
8
+
9
+ - Print warning when running Bundler on potentially problematic RubyGems & Ruby combinations [#5177](https://github.com/rubygems/rubygems/pull/5177)
10
+ - Error tracing should be printed to stderr [#5179](https://github.com/rubygems/rubygems/pull/5179)
11
+ - Add `github` and `ref` options to `bundle add` [#5159](https://github.com/rubygems/rubygems/pull/5159)
12
+ - Add require parameter to `bundle add` [#5021](https://github.com/rubygems/rubygems/pull/5021)
13
+ - Enable parallel installation on Windows by default [#4822](https://github.com/rubygems/rubygems/pull/4822)
14
+ - More logging when compact index is not used and we fallback to other APIs [#4546](https://github.com/rubygems/rubygems/pull/4546)
15
+ - `bundle gem` generated MiniTest file and class now start with 'test' [#3893](https://github.com/rubygems/rubygems/pull/3893)
16
+ - Add `Bundler::Definition.no_lock` accessor for skipping lock file creation/update [#3401](https://github.com/rubygems/rubygems/pull/3401)
17
+
18
+ ## Bug fixes:
19
+
20
+ - Fix crash when when no platform specific matches exist and show a proper error [#5168](https://github.com/rubygems/rubygems/pull/5168)
21
+ - Ignore dependencies not actually locked from frozen check [#5152](https://github.com/rubygems/rubygems/pull/5152)
22
+ - Fix `bundle cache --all-platforms` on Windows [#4552](https://github.com/rubygems/rubygems/pull/4552)
23
+
24
+ ## Documentation:
25
+
26
+ - Fix gemspec template typo [#4545](https://github.com/rubygems/rubygems/pull/4545)
27
+
28
+ # 2.2.33 (December 7, 2021)
29
+
30
+ ## Security fixes:
31
+
32
+ - Pass "--" to git commands to separate positional and optional args [#5142](https://github.com/rubygems/rubygems/pull/5142)
33
+
34
+ ## Enhancements:
35
+
36
+ - Accept pull request URLs as github source [#5126](https://github.com/rubygems/rubygems/pull/5126)
37
+ - Add `--version` parameter to `bundle info` command [#5137](https://github.com/rubygems/rubygems/pull/5137)
38
+ - Let original `Errno::EACCES` error be raised in compact index updater [#5110](https://github.com/rubygems/rubygems/pull/5110)
39
+ - Improve gemfile-lockfile source equivalence errors [#5120](https://github.com/rubygems/rubygems/pull/5120)
40
+ - Avoid float-to-string loss of characters in GitHub Actions configuration labels in new gem template [#5089](https://github.com/rubygems/rubygems/pull/5089)
41
+ - Add an initial rbs template to `bundle gem` skeleton [#5041](https://github.com/rubygems/rubygems/pull/5041)
42
+ - Avoid shared libraries not getting environment passed right after argv in memory when `bundle exec` is used [#4815](https://github.com/rubygems/rubygems/pull/4815)
43
+
44
+ ## Bug fixes:
45
+
46
+ - Don't cleanup paths from gems already activated from `$LOAD_PATH` [#5111](https://github.com/rubygems/rubygems/pull/5111)
47
+ - Fix handling prereleases of 0 versions, like 0.0.0.dev or 0.0.0.SNAPSHOT [#5116](https://github.com/rubygems/rubygems/pull/5116)
48
+ - Fix escape of filenames in `bundle doctor` [#5102](https://github.com/rubygems/rubygems/pull/5102)
49
+ - Don't unlock dependencies when running `bundle install` after changing global source [#5090](https://github.com/rubygems/rubygems/pull/5090)
50
+ - Fix missing locked specs when depended on another platform [#5092](https://github.com/rubygems/rubygems/pull/5092)
51
+ - Fix `bundle info` sometimes claiming that bundler has been deleted [#5097](https://github.com/rubygems/rubygems/pull/5097)
52
+
53
+ ## Documentation:
54
+
55
+ - Ignore to generate the documentation from vendored libraries [#5118](https://github.com/rubygems/rubygems/pull/5118)
56
+
57
+ # 2.2.32 (November 23, 2021)
58
+
59
+ ## Enhancements:
60
+
61
+ - Clarify `bundle viz` deprecation [#5083](https://github.com/rubygems/rubygems/pull/5083)
62
+ - Unlock dependencies that no longer match lockfile [#5068](https://github.com/rubygems/rubygems/pull/5068)
63
+ - Use `shellsplit` instead of array of strings for git push [#5062](https://github.com/rubygems/rubygems/pull/5062)
64
+ - Re-enable `default_ignores` option for standard [#5003](https://github.com/rubygems/rubygems/pull/5003)
65
+
66
+ ## Bug fixes:
67
+
68
+ - Fix downgrading dependencies by changing the `Gemfile` and running `bundle update` [#5078](https://github.com/rubygems/rubygems/pull/5078)
69
+
70
+ # 2.2.31 (November 8, 2021)
71
+
72
+ ## Enhancements:
73
+
74
+ - Link to working `bundler-graph` plugin in `bundle viz` deprecation message [#5061](https://github.com/rubygems/rubygems/pull/5061)
75
+ - Memoize materialized specs when requiring `bundler/setup` [#5033](https://github.com/rubygems/rubygems/pull/5033)
76
+ - Allow custom LicenseRef [#5013](https://github.com/rubygems/rubygems/pull/5013)
77
+ - Better error when installing a lockfile with git sources and git is not installed [#5036](https://github.com/rubygems/rubygems/pull/5036)
78
+ - Only delete cached gem when it's corrupted [#5031](https://github.com/rubygems/rubygems/pull/5031)
79
+ - Support gemified `tsort` [#5032](https://github.com/rubygems/rubygems/pull/5032)
80
+ - Add standard option alongside rubocop to `bundle gem` [#4411](https://github.com/rubygems/rubygems/pull/4411)
81
+
82
+ ## Bug fixes:
83
+
84
+ - Fix system man pages no longer working after bundler overrides `MANPATH` [#5039](https://github.com/rubygems/rubygems/pull/5039)
85
+ - Don't warn when a lockfile is locked to a dev version [#5018](https://github.com/rubygems/rubygems/pull/5018)
86
+
1
87
  # 2.2.30 (October 26, 2021)
2
88
 
3
89
  ## Enhancements:
data/bundler/exe/bundle CHANGED
@@ -18,14 +18,13 @@ end
18
18
  # Workaround for non-activated bundler spec due to missing https://github.com/rubygems/rubygems/commit/4e306d7bcdee924b8d80ca9db6125aa59ee4e5a3
19
19
  gem "bundler", Bundler::VERSION if Gem.rubygems_version < Gem::Version.new("2.6.2")
20
20
 
21
- # Check if an older version of bundler is installed
22
- $LOAD_PATH.each do |path|
23
- next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
24
- err = String.new
25
- err << "Looks like you have a version of bundler that's older than 0.9.\n"
26
- err << "Please remove your old versions.\n"
27
- err << "An easy way to do this is by running `gem cleanup bundler`."
28
- abort(err)
21
+ if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.6.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
22
+ Bundler.ui.warn \
23
+ "Your RubyGems version (#{Gem::VERSION})) has a bug that prevents " \
24
+ "`required_ruby_version` from working for Bundler. Any scripts that use " \
25
+ "`gem install bundler` will break as soon as Bundler drops support for " \
26
+ "your Ruby version. Please upgrade RubyGems to avoid future breakage " \
27
+ "and silence this warning by running `gem update --system 3.2.3`"
29
28
  end
30
29
 
31
30
  if File.exist?(base_path)
@@ -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 = "2021-10-26".freeze
8
- @git_commit_sha = "e8df9bea62".freeze
7
+ @built_at = "2021-12-21".freeze
8
+ @git_commit_sha = "e7167b9a42".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rbconfig"
4
+ require "shellwords"
4
5
 
5
6
  module Bundler
6
7
  class CLI::Doctor
@@ -22,14 +23,14 @@ module Bundler
22
23
  end
23
24
 
24
25
  def dylibs_darwin(path)
25
- output = `/usr/bin/otool -L "#{path}"`.chomp
26
+ output = `/usr/bin/otool -L #{path.shellescape}`.chomp
26
27
  dylibs = output.split("\n")[1..-1].map {|l| l.match(DARWIN_REGEX).captures[0] }.uniq
27
28
  # ignore @rpath and friends
28
29
  dylibs.reject {|dylib| dylib.start_with? "@" }
29
30
  end
30
31
 
31
32
  def dylibs_ldd(path)
32
- output = `/usr/bin/ldd "#{path}"`.chomp
33
+ output = `/usr/bin/ldd #{path.shellescape}`.chomp
33
34
  output.split("\n").map do |l|
34
35
  match = l.match(LDD_REGEX)
35
36
  next if match.nil?
@@ -76,6 +76,7 @@ module Bundler
76
76
  "#{Bundler.preferred_gemfile_name}.tt" => Bundler.preferred_gemfile_name,
77
77
  "lib/newgem.rb.tt" => "lib/#{namespaced_path}.rb",
78
78
  "lib/newgem/version.rb.tt" => "lib/#{namespaced_path}/version.rb",
79
+ "sig/newgem.rbs.tt" => "sig/#{namespaced_path}.rbs",
79
80
  "newgem.gemspec.tt" => "#{name}.gemspec",
80
81
  "Rakefile.tt" => "Rakefile",
81
82
  "README.md.tt" => "README.md",
@@ -105,7 +106,7 @@ module Bundler
105
106
  when "minitest"
106
107
  templates.merge!(
107
108
  "test/minitest/test_helper.rb.tt" => "test/test_helper.rb",
108
- "test/minitest/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
109
+ "test/minitest/test_newgem.rb.tt" => "test/test_#{namespaced_path}.rb"
109
110
  )
110
111
  config[:test_task] = :test
111
112
  when "test-unit"
@@ -163,15 +164,16 @@ module Bundler
163
164
  templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
164
165
  end
165
166
 
166
- if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
167
- "RuboCop is a static code analyzer that has out-of-the-box rules for many " \
168
- "of the guidelines in the community style guide. " \
169
- "For more information, see the RuboCop docs (https://docs.rubocop.org/en/stable/) " \
170
- "and the Ruby Style Guides (https://github.com/rubocop-hq/ruby-style-guide).")
171
- config[:rubocop] = true
172
- config[:rubocop_version] = rubocop_version
167
+ config[:linter] = ask_and_set_linter
168
+ case config[:linter]
169
+ when "rubocop"
170
+ config[:linter_version] = rubocop_version
173
171
  Bundler.ui.info "RuboCop enabled in config"
174
172
  templates.merge!("rubocop.yml.tt" => ".rubocop.yml")
173
+ when "standard"
174
+ config[:linter_version] = standard_version
175
+ Bundler.ui.info "Standard enabled in config"
176
+ templates.merge!("standard.yml.tt" => ".standard.yml")
175
177
  end
176
178
 
177
179
  templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe]
@@ -317,6 +319,58 @@ module Bundler
317
319
  ci_template
318
320
  end
319
321
 
322
+ def ask_and_set_linter
323
+ linter_template = options[:linter] || Bundler.settings["gem.linter"]
324
+ linter_template = deprecated_rubocop_option if linter_template.nil?
325
+
326
+ if linter_template.to_s.empty?
327
+ Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
328
+ "Supported Linters:\n" \
329
+ "* RuboCop: https://rubocop.org\n" \
330
+ "* Standard: https://github.com/testdouble/standard\n" \
331
+ "\n"
332
+ Bundler.ui.info hint_text("linter")
333
+
334
+ result = Bundler.ui.ask "Enter a linter. rubocop/standard/(none):"
335
+ if result =~ /rubocop|standard/
336
+ linter_template = result
337
+ else
338
+ linter_template = false
339
+ end
340
+ end
341
+
342
+ if Bundler.settings["gem.linter"].nil?
343
+ Bundler.settings.set_global("gem.linter", linter_template)
344
+ end
345
+
346
+ # Once gem.linter safely set, unset the deprecated gem.rubocop
347
+ unless Bundler.settings["gem.rubocop"].nil?
348
+ Bundler.settings.set_global("gem.rubocop", nil)
349
+ end
350
+
351
+ if options[:linter] == Bundler.settings["gem.linter"]
352
+ Bundler.ui.info "#{options[:linter]} is already configured, ignoring --linter flag."
353
+ end
354
+
355
+ linter_template
356
+ end
357
+
358
+ def deprecated_rubocop_option
359
+ if !options[:rubocop].nil?
360
+ if options[:rubocop]
361
+ Bundler::SharedHelpers.major_deprecation 2, "--rubocop is deprecated, use --linter=rubocop"
362
+ "rubocop"
363
+ else
364
+ Bundler::SharedHelpers.major_deprecation 2, "--no-rubocop is deprecated, use --linter"
365
+ false
366
+ end
367
+ elsif !Bundler.settings["gem.rubocop"].nil?
368
+ Bundler::SharedHelpers.major_deprecation 2,
369
+ "config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
370
+ Bundler.settings["gem.rubocop"] ? "rubocop" : false
371
+ end
372
+ end
373
+
320
374
  def bundler_dependency_version
321
375
  v = Gem::Version.new(Bundler::VERSION)
322
376
  req = v.segments[0..1]
@@ -367,5 +421,13 @@ module Bundler
367
421
  "1.21"
368
422
  end
369
423
  end
424
+
425
+ def standard_version
426
+ if Gem.ruby_version < Gem::Version.new("2.4.a") then "0.2.5"
427
+ elsif Gem.ruby_version < Gem::Version.new("2.5.a") then "1.0"
428
+ else
429
+ "1.3"
430
+ end
431
+ end
370
432
  end
371
433
  end
@@ -18,6 +18,7 @@ module Bundler
18
18
 
19
19
  if spec
20
20
  return print_gem_path(spec) if @options[:path]
21
+ return print_gem_version(spec) if @options[:version]
21
22
  print_gem_info(spec)
22
23
  end
23
24
  end
@@ -39,6 +40,10 @@ module Bundler
39
40
  raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
40
41
  end
41
42
 
43
+ def print_gem_version(spec)
44
+ Bundler.ui.info spec.version.to_s
45
+ end
46
+
42
47
  def print_gem_path(spec)
43
48
  name = spec.name
44
49
  if name == "bundler"
@@ -70,7 +75,7 @@ module Bundler
70
75
  gem_info << "\tPath: #{spec.full_gem_path}\n"
71
76
  gem_info << "\tDefault Gem: yes" if spec.respond_to?(:default_gem?) && spec.default_gem?
72
77
 
73
- if spec.deleted_gem?
78
+ if name != "bundler" && spec.deleted_gem?
74
79
  return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
75
80
  end
76
81
 
@@ -12,6 +12,8 @@ module Bundler
12
12
 
13
13
  warn_if_root
14
14
 
15
+ Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed
16
+
15
17
  Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
16
18
 
17
19
  # Disable color in deployment mode
@@ -66,7 +66,7 @@ module Bundler
66
66
 
67
67
  if locked_gems = Bundler.definition.locked_gems
68
68
  previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
69
- h[s.name] = { :spec => s, :version => s.version, :source => s.source.to_s }
69
+ h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
70
70
  h
71
71
  end
72
72
  end
@@ -95,7 +95,7 @@ module Bundler
95
95
  end
96
96
 
97
97
  locked_source = locked_info[:source]
98
- new_source = new_spec.source.to_s
98
+ new_source = new_spec.source.identifier
99
99
  next if locked_source != new_source
100
100
 
101
101
  new_version = new_spec.version
@@ -61,6 +61,8 @@ module Bundler
61
61
  Bundler.reset_settings_and_root!
62
62
  end
63
63
 
64
+ Bundler.self_manager.restart_with_locked_bundler_if_needed
65
+
64
66
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
65
67
 
66
68
  current_cmd = args.last[:current_command].name
@@ -331,6 +333,7 @@ module Bundler
331
333
 
332
334
  desc "info GEM [OPTIONS]", "Show information for the given gem"
333
335
  method_option "path", :type => :boolean, :banner => "Print full path to gem"
336
+ method_option "version", :type => :boolean, :banner => "Print gem version"
334
337
  def info(gem_name)
335
338
  require_relative "cli/info"
336
339
  Info.new(options, gem_name).run
@@ -366,8 +369,11 @@ module Bundler
366
369
  method_option "version", :aliases => "-v", :type => :string
367
370
  method_option "group", :aliases => "-g", :type => :string
368
371
  method_option "source", :aliases => "-s", :type => :string
372
+ method_option "require", :aliases => "-r", :type => :string, :banner => "Adds require path to gem. Provide false, or a path as a string."
369
373
  method_option "git", :type => :string
374
+ method_option "github", :type => :string
370
375
  method_option "branch", :type => :string
376
+ method_option "ref", :type => :string
371
377
  method_option "skip-install", :type => :boolean, :banner =>
372
378
  "Adds gem to the Gemfile but does not install it"
373
379
  method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
@@ -552,7 +558,7 @@ module Bundler
552
558
  method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
553
559
  method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
554
560
  def viz
555
- SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
561
+ SharedHelpers.major_deprecation 2, "The `viz` command has been renamed to `graph` and moved to a plugin. See https://github.com/rubygems/bundler-graph"
556
562
  require_relative "cli/viz"
557
563
  Viz.new(options.dup).run
558
564
  end
@@ -575,6 +581,8 @@ module Bundler
575
581
  :desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
576
582
  method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",
577
583
  :desc => "Generate CI configuration, either GitHub Actions, Travis CI, GitLab CI or CircleCI. Set a default with `bundle config set --global gem.ci (github|travis|gitlab|circle)`"
584
+ method_option :linter, :type => :string, :lazy_default => Bundler.settings["gem.linter"] || "",
585
+ :desc => "Add a linter and code formatter, either RuboCop or Standard. Set a default with `bundle config set --global gem.linter (rubocop|standard)`"
578
586
  method_option :github_username, :type => :string, :default => Bundler.settings["gem.github_username"], :banner => "Set your username on GitHub", :desc => "Fill in GitHub username on README so that you don't have to do it manually. Set a default with `bundle config set --global gem.github_username <your_username>`."
579
587
 
580
588
  def gem(name)
@@ -76,11 +76,6 @@ module Bundler
76
76
 
77
77
  update(local_path, remote_path, :retrying)
78
78
  end
79
- rescue Errno::EACCES
80
- raise Bundler::PermissionError,
81
- "Bundler does not have write access to create a temp directory " \
82
- "within #{Dir.tmpdir}. Bundler must have write access to your " \
83
- "systems temp directory to function properly. "
84
79
  rescue Zlib::GzipFile::Error
85
80
  raise Bundler::HTTPError
86
81
  end