rubygems-update 3.5.23 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +74 -0
  3. data/Manifest.txt +23 -16
  4. data/README.md +15 -10
  5. data/bundler/CHANGELOG.md +66 -0
  6. data/bundler/bundler.gemspec +2 -2
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/console.rb +0 -4
  9. data/bundler/lib/bundler/cli/doctor.rb +4 -4
  10. data/bundler/lib/bundler/cli/exec.rb +1 -0
  11. data/bundler/lib/bundler/cli/gem.rb +1 -1
  12. data/bundler/lib/bundler/cli/info.rb +2 -2
  13. data/bundler/lib/bundler/cli/inject.rb +1 -1
  14. data/bundler/lib/bundler/cli/install.rb +4 -0
  15. data/bundler/lib/bundler/cli/lock.rb +20 -1
  16. data/bundler/lib/bundler/cli/pristine.rb +1 -1
  17. data/bundler/lib/bundler/cli/show.rb +2 -2
  18. data/bundler/lib/bundler/cli.rb +22 -53
  19. data/bundler/lib/bundler/compact_index_client/cache_file.rb +0 -5
  20. data/bundler/lib/bundler/compact_index_client/updater.rb +0 -11
  21. data/bundler/lib/bundler/definition.rb +155 -74
  22. data/bundler/lib/bundler/dependency.rb +1 -1
  23. data/bundler/lib/bundler/dsl.rb +2 -13
  24. data/bundler/lib/bundler/endpoint_specification.rb +10 -1
  25. data/bundler/lib/bundler/errors.rb +10 -0
  26. data/bundler/lib/bundler/feature_flag.rb +1 -0
  27. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  28. data/bundler/lib/bundler/fetcher.rb +10 -3
  29. data/bundler/lib/bundler/gem_helpers.rb +21 -5
  30. data/bundler/lib/bundler/injector.rb +2 -2
  31. data/bundler/lib/bundler/installer/standalone.rb +2 -2
  32. data/bundler/lib/bundler/installer.rb +4 -38
  33. data/bundler/lib/bundler/lazy_specification.rb +65 -24
  34. data/bundler/lib/bundler/lockfile_parser.rb +9 -1
  35. data/bundler/lib/bundler/man/bundle-add.1 +13 -10
  36. data/bundler/lib/bundler/man/bundle-add.1.ronn +12 -9
  37. data/bundler/lib/bundler/man/bundle-binstubs.1 +7 -4
  38. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +6 -3
  39. data/bundler/lib/bundler/man/bundle-cache.1 +30 -2
  40. data/bundler/lib/bundler/man/bundle-cache.1.ronn +31 -2
  41. data/bundler/lib/bundler/man/bundle-check.1 +3 -3
  42. data/bundler/lib/bundler/man/bundle-check.1.ronn +4 -2
  43. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-config.1 +3 -1
  45. data/bundler/lib/bundler/man/bundle-config.1.ronn +2 -0
  46. data/bundler/lib/bundler/man/bundle-console.1 +2 -4
  47. data/bundler/lib/bundler/man/bundle-console.1.ronn +2 -7
  48. data/bundler/lib/bundler/man/bundle-doctor.1 +2 -2
  49. data/bundler/lib/bundler/man/bundle-doctor.1.ronn +1 -1
  50. data/bundler/lib/bundler/man/bundle-env.1 +9 -0
  51. data/bundler/lib/bundler/man/bundle-env.1.ronn +10 -0
  52. data/bundler/lib/bundler/man/bundle-exec.1 +5 -2
  53. data/bundler/lib/bundler/man/bundle-exec.1.ronn +4 -1
  54. data/bundler/lib/bundler/man/bundle-fund.1 +22 -0
  55. data/bundler/lib/bundler/man/bundle-fund.1.ronn +25 -0
  56. data/bundler/lib/bundler/man/bundle-gem.1 +17 -5
  57. data/bundler/lib/bundler/man/bundle-gem.1.ronn +27 -6
  58. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-info.1 +5 -2
  60. data/bundler/lib/bundler/man/bundle-info.1.ronn +6 -2
  61. data/bundler/lib/bundler/man/bundle-init.1 +3 -3
  62. data/bundler/lib/bundler/man/bundle-init.1.ronn +3 -2
  63. data/bundler/lib/bundler/man/bundle-inject.1 +10 -2
  64. data/bundler/lib/bundler/man/bundle-inject.1.ronn +9 -1
  65. data/bundler/lib/bundler/man/bundle-install.1 +14 -11
  66. data/bundler/lib/bundler/man/bundle-install.1.ronn +21 -16
  67. data/bundler/lib/bundler/man/bundle-issue.1 +45 -0
  68. data/bundler/lib/bundler/man/bundle-issue.1.ronn +37 -0
  69. data/bundler/lib/bundler/man/bundle-licenses.1 +9 -0
  70. data/bundler/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  71. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  72. data/bundler/lib/bundler/man/bundle-list.1.ronn +4 -1
  73. data/bundler/lib/bundler/man/bundle-lock.1 +21 -6
  74. data/bundler/lib/bundler/man/bundle-lock.1.ronn +25 -4
  75. data/bundler/lib/bundler/man/bundle-open.1 +2 -2
  76. data/bundler/lib/bundler/man/bundle-open.1.ronn +2 -1
  77. data/bundler/lib/bundler/man/bundle-outdated.1 +8 -5
  78. data/bundler/lib/bundler/man/bundle-outdated.1.ronn +8 -4
  79. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  80. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  81. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  82. data/bundler/lib/bundler/man/bundle-pristine.1.ronn +1 -1
  83. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  84. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -1
  85. data/bundler/lib/bundler/man/bundle-show.1 +5 -2
  86. data/bundler/lib/bundler/man/bundle-show.1.ronn +4 -0
  87. data/bundler/lib/bundler/man/bundle-update.1 +13 -7
  88. data/bundler/lib/bundler/man/bundle-update.1.ronn +14 -6
  89. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  90. data/bundler/lib/bundler/man/bundle-viz.1 +4 -4
  91. data/bundler/lib/bundler/man/bundle-viz.1.ronn +7 -3
  92. data/bundler/lib/bundler/man/bundle.1 +1 -1
  93. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  94. data/bundler/lib/bundler/man/index.txt +4 -0
  95. data/bundler/lib/bundler/materialization.rb +59 -0
  96. data/bundler/lib/bundler/plugin/events.rb +24 -0
  97. data/bundler/lib/bundler/plugin/installer.rb +1 -1
  98. data/bundler/lib/bundler/process_lock.rb +1 -1
  99. data/bundler/lib/bundler/remote_specification.rb +6 -1
  100. data/bundler/lib/bundler/resolver/base.rb +2 -6
  101. data/bundler/lib/bundler/resolver/candidate.rb +2 -2
  102. data/bundler/lib/bundler/resolver/spec_group.rb +4 -3
  103. data/bundler/lib/bundler/resolver.rb +5 -5
  104. data/bundler/lib/bundler/rubygems_ext.rb +28 -28
  105. data/bundler/lib/bundler/rubygems_gem_installer.rb +0 -1
  106. data/bundler/lib/bundler/rubygems_integration.rb +21 -11
  107. data/bundler/lib/bundler/runtime.rb +27 -7
  108. data/bundler/lib/bundler/self_manager.rb +2 -3
  109. data/bundler/lib/bundler/settings.rb +1 -0
  110. data/bundler/lib/bundler/shared_helpers.rb +2 -2
  111. data/bundler/lib/bundler/source/git/git_proxy.rb +0 -6
  112. data/bundler/lib/bundler/source/git.rb +56 -31
  113. data/bundler/lib/bundler/source/path.rb +2 -2
  114. data/bundler/lib/bundler/source_list.rb +1 -1
  115. data/bundler/lib/bundler/spec_set.rb +81 -56
  116. data/bundler/lib/bundler/stub_specification.rb +8 -0
  117. data/bundler/lib/bundler/templates/newgem/README.md.tt +1 -1
  118. data/bundler/lib/bundler/uri_credentials_filter.rb +1 -1
  119. data/bundler/lib/bundler/vendor/fileutils/COPYING +56 -0
  120. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +15 -13
  121. data/bundler/lib/bundler/vendor/securerandom/COPYING +56 -0
  122. data/bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb +11 -5
  123. data/bundler/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +3 -5
  124. data/bundler/lib/bundler/vendor/thor/lib/thor/group.rb +11 -0
  125. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +1 -4
  126. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +2 -2
  127. data/bundler/lib/bundler/vendor/thor/lib/thor/parser/options.rb +2 -1
  128. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +9 -9
  129. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
  130. data/bundler/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +5 -21
  131. data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  132. data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  133. data/bundler/lib/bundler/vendor/thor/lib/thor.rb +11 -0
  134. data/bundler/lib/bundler/vendor/uri/COPYING +56 -0
  135. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +37 -16
  136. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +3 -3
  137. data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +1 -1
  138. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +16 -26
  139. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +2 -2
  140. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  141. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  142. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  143. data/bundler/lib/bundler/vendor/uri/lib/uri.rb +9 -9
  144. data/bundler/lib/bundler/vendored_securerandom.rb +0 -2
  145. data/bundler/lib/bundler/version.rb +1 -1
  146. data/bundler/lib/bundler.rb +37 -13
  147. data/{CONTRIBUTING.md → doc/rubygems/CONTRIBUTING.md} +9 -9
  148. data/{POLICIES.md → doc/rubygems/POLICIES.md} +11 -11
  149. data/lib/rubygems/basic_specification.rb +5 -4
  150. data/lib/rubygems/commands/cleanup_command.rb +2 -2
  151. data/lib/rubygems/commands/contents_command.rb +4 -4
  152. data/lib/rubygems/commands/exec_command.rb +3 -0
  153. data/lib/rubygems/commands/pristine_command.rb +2 -2
  154. data/lib/rubygems/commands/push_command.rb +29 -5
  155. data/lib/rubygems/commands/rdoc_command.rb +2 -2
  156. data/lib/rubygems/commands/rebuild_command.rb +0 -2
  157. data/lib/rubygems/commands/setup_command.rb +1 -16
  158. data/lib/rubygems/commands/unpack_command.rb +0 -6
  159. data/lib/rubygems/commands/update_command.rb +2 -8
  160. data/lib/rubygems/config_file.rb +12 -0
  161. data/lib/rubygems/core_ext/kernel_warn.rb +2 -6
  162. data/lib/rubygems/defaults.rb +1 -1
  163. data/lib/rubygems/exceptions.rb +0 -6
  164. data/lib/rubygems/ext/builder.rb +6 -4
  165. data/lib/rubygems/ext/cargo_builder.rb +7 -4
  166. data/lib/rubygems/ext/cmake_builder.rb +7 -2
  167. data/lib/rubygems/ext/configure_builder.rb +7 -2
  168. data/lib/rubygems/ext/ext_conf_builder.rb +9 -5
  169. data/lib/rubygems/ext/rake_builder.rb +6 -1
  170. data/lib/rubygems/install_update_options.rb +5 -0
  171. data/lib/rubygems/installer.rb +2 -2
  172. data/lib/rubygems/platform.rb +4 -3
  173. data/lib/rubygems/psych_tree.rb +4 -0
  174. data/lib/rubygems/query_utils.rb +1 -1
  175. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  176. data/lib/rubygems/requirement.rb +0 -4
  177. data/lib/rubygems/resolver/composed_set.rb +3 -3
  178. data/lib/rubygems/resolver/git_set.rb +0 -1
  179. data/lib/rubygems/resolver/index_set.rb +2 -2
  180. data/lib/rubygems/resolver.rb +3 -3
  181. data/lib/rubygems/source/git.rb +13 -10
  182. data/lib/rubygems/spec_fetcher.rb +16 -5
  183. data/lib/rubygems/specification.rb +37 -31
  184. data/lib/rubygems/target_rbconfig.rb +50 -0
  185. data/lib/rubygems/uri.rb +1 -1
  186. data/lib/rubygems/util/licenses.rb +10 -1
  187. data/lib/rubygems/vendor/net-http/COPYING +56 -0
  188. data/lib/rubygems/vendor/net-http/lib/net/http/header.rb +1 -1
  189. data/lib/rubygems/vendor/net-http/lib/net/http/requests.rb +5 -0
  190. data/lib/rubygems/vendor/net-http/lib/net/http.rb +120 -36
  191. data/lib/rubygems/vendor/optparse/lib/optparse/ac.rb +16 -0
  192. data/lib/rubygems/vendor/optparse/lib/optparse/kwargs.rb +8 -3
  193. data/lib/rubygems/vendor/optparse/lib/optparse/version.rb +9 -0
  194. data/lib/rubygems/vendor/optparse/lib/optparse.rb +147 -51
  195. data/lib/rubygems/vendor/resolv/COPYING +56 -0
  196. data/lib/rubygems/vendor/resolv/lib/resolv.rb +50 -37
  197. data/lib/rubygems/vendor/securerandom/COPYING +56 -0
  198. data/lib/rubygems/vendor/securerandom/lib/securerandom.rb +11 -5
  199. data/lib/rubygems/vendor/timeout/COPYING +56 -0
  200. data/lib/rubygems/vendor/timeout/lib/timeout.rb +9 -10
  201. data/lib/rubygems/vendor/uri/COPYING +56 -0
  202. data/lib/rubygems/vendor/uri/lib/uri/common.rb +37 -16
  203. data/lib/rubygems/vendor/uri/lib/uri/file.rb +3 -3
  204. data/lib/rubygems/vendor/uri/lib/uri/ftp.rb +1 -1
  205. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +16 -26
  206. data/lib/rubygems/vendor/uri/lib/uri/http.rb +2 -2
  207. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +10 -3
  208. data/lib/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +26 -3
  209. data/lib/rubygems/vendor/uri/lib/uri/version.rb +1 -1
  210. data/lib/rubygems/vendor/uri/lib/uri.rb +9 -9
  211. data/lib/rubygems/vendored_securerandom.rb +0 -1
  212. data/lib/rubygems/version.rb +0 -4
  213. data/lib/rubygems.rb +30 -21
  214. data/rubygems-update.gemspec +5 -5
  215. data/setup.rb +1 -1
  216. metadata +36 -27
  217. data/bundler/lib/bundler/vendor/fileutils/LICENSE.txt +0 -22
  218. data/bundler/lib/bundler/vendor/securerandom/LICENSE.txt +0 -22
  219. data/bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb +0 -373
  220. data/bundler/lib/bundler/vendor/uri/LICENSE.txt +0 -22
  221. data/lib/rubygems/vendor/net-http/LICENSE.txt +0 -22
  222. data/lib/rubygems/vendor/net-http/lib/net/http/backward.rb +0 -40
  223. data/lib/rubygems/vendor/resolv/LICENSE.txt +0 -22
  224. data/lib/rubygems/vendor/securerandom/LICENSE.txt +0 -22
  225. data/lib/rubygems/vendor/securerandom/lib/random/formatter.rb +0 -373
  226. data/lib/rubygems/vendor/timeout/LICENSE.txt +0 -22
  227. data/lib/rubygems/vendor/uri/LICENSE.txt +0 -22
  228. /data/{MAINTAINERS.txt → doc/MAINTAINERS.txt} +0 -0
  229. /data/{bundler → doc/bundler}/UPGRADING.md +0 -0
  230. /data/{UPGRADING.md → doc/rubygems/UPGRADING.md} +0 -0
metadata CHANGED
@@ -1,8 +1,9 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.23
4
+ version: 3.6.1
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - Jim Weirich
8
9
  - Chad Fowler
@@ -13,10 +14,9 @@ authors:
13
14
  - André Arko
14
15
  - Evan Phoenix
15
16
  - Hiroshi SHIBATA
16
- autorequire:
17
17
  bindir: exe
18
18
  cert_chain: []
19
- date: 2024-11-05 00:00:00.000000000 Z
19
+ date: 2024-12-17 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -40,14 +40,14 @@ executables:
40
40
  extensions: []
41
41
  extra_rdoc_files:
42
42
  - LICENSE.txt
43
- - MAINTAINERS.txt
43
+ - doc/MAINTAINERS.txt
44
44
  - MIT.txt
45
45
  - Manifest.txt
46
46
  - README.md
47
- - UPGRADING.md
48
- - POLICIES.md
47
+ - doc/rubygems/UPGRADING.md
48
+ - doc/rubygems/POLICIES.md
49
49
  - CODE_OF_CONDUCT.md
50
- - CONTRIBUTING.md
50
+ - doc/rubygems/CONTRIBUTING.md
51
51
  - bundler/LICENSE.md
52
52
  - bundler/README.md
53
53
  - hide_lib_for_update/note.txt
@@ -59,13 +59,17 @@ extra_rdoc_files:
59
59
  - bundler/lib/bundler/man/bundle-config.1
60
60
  - bundler/lib/bundler/man/bundle-console.1
61
61
  - bundler/lib/bundler/man/bundle-doctor.1
62
+ - bundler/lib/bundler/man/bundle-env.1
62
63
  - bundler/lib/bundler/man/bundle-exec.1
64
+ - bundler/lib/bundler/man/bundle-fund.1
63
65
  - bundler/lib/bundler/man/bundle-gem.1
64
66
  - bundler/lib/bundler/man/bundle-help.1
65
67
  - bundler/lib/bundler/man/bundle-info.1
66
68
  - bundler/lib/bundler/man/bundle-init.1
67
69
  - bundler/lib/bundler/man/bundle-inject.1
68
70
  - bundler/lib/bundler/man/bundle-install.1
71
+ - bundler/lib/bundler/man/bundle-issue.1
72
+ - bundler/lib/bundler/man/bundle-licenses.1
69
73
  - bundler/lib/bundler/man/bundle-list.1
70
74
  - bundler/lib/bundler/man/bundle-lock.1
71
75
  - bundler/lib/bundler/man/bundle-open.1
@@ -82,18 +86,13 @@ extra_rdoc_files:
82
86
  files:
83
87
  - CHANGELOG.md
84
88
  - CODE_OF_CONDUCT.md
85
- - CONTRIBUTING.md
86
89
  - LICENSE.txt
87
- - MAINTAINERS.txt
88
90
  - MIT.txt
89
91
  - Manifest.txt
90
- - POLICIES.md
91
92
  - README.md
92
- - UPGRADING.md
93
93
  - bundler/CHANGELOG.md
94
94
  - bundler/LICENSE.md
95
95
  - bundler/README.md
96
- - bundler/UPGRADING.md
97
96
  - bundler/bundler.gemspec
98
97
  - bundler/exe/bundle
99
98
  - bundler/exe/bundler
@@ -192,8 +191,12 @@ files:
192
191
  - bundler/lib/bundler/man/bundle-console.1.ronn
193
192
  - bundler/lib/bundler/man/bundle-doctor.1
194
193
  - bundler/lib/bundler/man/bundle-doctor.1.ronn
194
+ - bundler/lib/bundler/man/bundle-env.1
195
+ - bundler/lib/bundler/man/bundle-env.1.ronn
195
196
  - bundler/lib/bundler/man/bundle-exec.1
196
197
  - bundler/lib/bundler/man/bundle-exec.1.ronn
198
+ - bundler/lib/bundler/man/bundle-fund.1
199
+ - bundler/lib/bundler/man/bundle-fund.1.ronn
197
200
  - bundler/lib/bundler/man/bundle-gem.1
198
201
  - bundler/lib/bundler/man/bundle-gem.1.ronn
199
202
  - bundler/lib/bundler/man/bundle-help.1
@@ -206,6 +209,10 @@ files:
206
209
  - bundler/lib/bundler/man/bundle-inject.1.ronn
207
210
  - bundler/lib/bundler/man/bundle-install.1
208
211
  - bundler/lib/bundler/man/bundle-install.1.ronn
212
+ - bundler/lib/bundler/man/bundle-issue.1
213
+ - bundler/lib/bundler/man/bundle-issue.1.ronn
214
+ - bundler/lib/bundler/man/bundle-licenses.1
215
+ - bundler/lib/bundler/man/bundle-licenses.1.ronn
209
216
  - bundler/lib/bundler/man/bundle-list.1
210
217
  - bundler/lib/bundler/man/bundle-list.1.ronn
211
218
  - bundler/lib/bundler/man/bundle-lock.1
@@ -238,6 +245,7 @@ files:
238
245
  - bundler/lib/bundler/match_metadata.rb
239
246
  - bundler/lib/bundler/match_platform.rb
240
247
  - bundler/lib/bundler/match_remote_metadata.rb
248
+ - bundler/lib/bundler/materialization.rb
241
249
  - bundler/lib/bundler/mirror.rb
242
250
  - bundler/lib/bundler/plugin.rb
243
251
  - bundler/lib/bundler/plugin/api.rb
@@ -339,7 +347,7 @@ files:
339
347
  - bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb
340
348
  - bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
341
349
  - bundler/lib/bundler/vendor/fileutils/.document
342
- - bundler/lib/bundler/vendor/fileutils/LICENSE.txt
350
+ - bundler/lib/bundler/vendor/fileutils/COPYING
343
351
  - bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb
344
352
  - bundler/lib/bundler/vendor/net-http-persistent/.document
345
353
  - bundler/lib/bundler/vendor/net-http-persistent/README.rdoc
@@ -366,8 +374,7 @@ files:
366
374
  - bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb
367
375
  - bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb
368
376
  - bundler/lib/bundler/vendor/securerandom/.document
369
- - bundler/lib/bundler/vendor/securerandom/LICENSE.txt
370
- - bundler/lib/bundler/vendor/securerandom/lib/random/formatter.rb
377
+ - bundler/lib/bundler/vendor/securerandom/COPYING
371
378
  - bundler/lib/bundler/vendor/securerandom/lib/securerandom.rb
372
379
  - bundler/lib/bundler/vendor/thor/.document
373
380
  - bundler/lib/bundler/vendor/thor/LICENSE.md
@@ -410,7 +417,7 @@ files:
410
417
  - bundler/lib/bundler/vendor/tsort/LICENSE.txt
411
418
  - bundler/lib/bundler/vendor/tsort/lib/tsort.rb
412
419
  - bundler/lib/bundler/vendor/uri/.document
413
- - bundler/lib/bundler/vendor/uri/LICENSE.txt
420
+ - bundler/lib/bundler/vendor/uri/COPYING
414
421
  - bundler/lib/bundler/vendor/uri/lib/uri.rb
415
422
  - bundler/lib/bundler/vendor/uri/lib/uri/common.rb
416
423
  - bundler/lib/bundler/vendor/uri/lib/uri/file.rb
@@ -439,6 +446,11 @@ files:
439
446
  - bundler/lib/bundler/vlad.rb
440
447
  - bundler/lib/bundler/worker.rb
441
448
  - bundler/lib/bundler/yaml_serializer.rb
449
+ - doc/MAINTAINERS.txt
450
+ - doc/bundler/UPGRADING.md
451
+ - doc/rubygems/CONTRIBUTING.md
452
+ - doc/rubygems/POLICIES.md
453
+ - doc/rubygems/UPGRADING.md
442
454
  - exe/gem
443
455
  - exe/update_rubygems
444
456
  - hide_lib_for_update/note.txt
@@ -608,6 +620,7 @@ files:
608
620
  - lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem
609
621
  - lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem
610
622
  - lib/rubygems/stub_specification.rb
623
+ - lib/rubygems/target_rbconfig.rb
611
624
  - lib/rubygems/text.rb
612
625
  - lib/rubygems/uninstaller.rb
613
626
  - lib/rubygems/unknown_command_spell_checker.rb
@@ -642,9 +655,8 @@ files:
642
655
  - lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
643
656
  - lib/rubygems/vendor/molinillo/lib/molinillo/state.rb
644
657
  - lib/rubygems/vendor/net-http/.document
645
- - lib/rubygems/vendor/net-http/LICENSE.txt
658
+ - lib/rubygems/vendor/net-http/COPYING
646
659
  - lib/rubygems/vendor/net-http/lib/net/http.rb
647
- - lib/rubygems/vendor/net-http/lib/net/http/backward.rb
648
660
  - lib/rubygems/vendor/net-http/lib/net/http/exceptions.rb
649
661
  - lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb
650
662
  - lib/rubygems/vendor/net-http/lib/net/http/header.rb
@@ -670,20 +682,19 @@ files:
670
682
  - lib/rubygems/vendor/optparse/lib/optparse/uri.rb
671
683
  - lib/rubygems/vendor/optparse/lib/optparse/version.rb
672
684
  - lib/rubygems/vendor/resolv/.document
673
- - lib/rubygems/vendor/resolv/LICENSE.txt
685
+ - lib/rubygems/vendor/resolv/COPYING
674
686
  - lib/rubygems/vendor/resolv/lib/resolv.rb
675
687
  - lib/rubygems/vendor/securerandom/.document
676
- - lib/rubygems/vendor/securerandom/LICENSE.txt
677
- - lib/rubygems/vendor/securerandom/lib/random/formatter.rb
688
+ - lib/rubygems/vendor/securerandom/COPYING
678
689
  - lib/rubygems/vendor/securerandom/lib/securerandom.rb
679
690
  - lib/rubygems/vendor/timeout/.document
680
- - lib/rubygems/vendor/timeout/LICENSE.txt
691
+ - lib/rubygems/vendor/timeout/COPYING
681
692
  - lib/rubygems/vendor/timeout/lib/timeout.rb
682
693
  - lib/rubygems/vendor/tsort/.document
683
694
  - lib/rubygems/vendor/tsort/LICENSE.txt
684
695
  - lib/rubygems/vendor/tsort/lib/tsort.rb
685
696
  - lib/rubygems/vendor/uri/.document
686
- - lib/rubygems/vendor/uri/LICENSE.txt
697
+ - lib/rubygems/vendor/uri/COPYING
687
698
  - lib/rubygems/vendor/uri/lib/uri.rb
688
699
  - lib/rubygems/vendor/uri/lib/uri/common.rb
689
700
  - lib/rubygems/vendor/uri/lib/uri/file.rb
@@ -719,7 +730,6 @@ metadata:
719
730
  bug_tracker_uri: https://github.com/rubygems/rubygems/issues
720
731
  changelog_uri: https://github.com/rubygems/rubygems/blob/master/CHANGELOG.md
721
732
  funding_uri: https://rubycentral.org/#/portal/signup
722
- post_install_message:
723
733
  rdoc_options:
724
734
  - "--main"
725
735
  - README.md
@@ -730,15 +740,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
730
740
  requirements:
731
741
  - - ">="
732
742
  - !ruby/object:Gem::Version
733
- version: 3.0.0
743
+ version: 3.1.0
734
744
  required_rubygems_version: !ruby/object:Gem::Requirement
735
745
  requirements:
736
746
  - - ">="
737
747
  - !ruby/object:Gem::Version
738
748
  version: '0'
739
749
  requirements: []
740
- rubygems_version: 3.5.23
741
- signing_key:
750
+ rubygems_version: 3.6.1
742
751
  specification_version: 4
743
752
  summary: RubyGems is a package management framework for Ruby. This gem is downloaded
744
753
  and installed by `gem update --system`, so that the `gem` CLI can update itself.
@@ -1,22 +0,0 @@
1
- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions
5
- are met:
6
- 1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- 2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
- SUCH DAMAGE.
@@ -1,22 +0,0 @@
1
- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions
5
- are met:
6
- 1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- 2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
- SUCH DAMAGE.
@@ -1,373 +0,0 @@
1
- # -*- coding: us-ascii -*-
2
- # frozen_string_literal: true
3
-
4
- # == \Random number formatter.
5
- #
6
- # Formats generated random numbers in many manners. When <tt>'random/formatter'</tt>
7
- # is required, several methods are added to empty core module <tt>Bundler::Random::Formatter</tt>,
8
- # making them available as Random's instance and module methods.
9
- #
10
- # Standard library Bundler::SecureRandom is also extended with the module, and the methods
11
- # described below are available as a module methods in it.
12
- #
13
- # === Examples
14
- #
15
- # Generate random hexadecimal strings:
16
- #
17
- # require 'bundler/vendor/securerandom/lib/random/formatter'
18
- #
19
- # prng = Random.new
20
- # prng.hex(10) #=> "52750b30ffbc7de3b362"
21
- # prng.hex(10) #=> "92b15d6c8dc4beb5f559"
22
- # prng.hex(13) #=> "39b290146bea6ce975c37cfc23"
23
- # # or just
24
- # Random.hex #=> "1aed0c631e41be7f77365415541052ee"
25
- #
26
- # Generate random base64 strings:
27
- #
28
- # prng.base64(10) #=> "EcmTPZwWRAozdA=="
29
- # prng.base64(10) #=> "KO1nIU+p9DKxGg=="
30
- # prng.base64(12) #=> "7kJSM/MzBJI+75j8"
31
- # Random.base64(4) #=> "bsQ3fQ=="
32
- #
33
- # Generate random binary strings:
34
- #
35
- # prng.random_bytes(10) #=> "\016\t{\370g\310pbr\301"
36
- # prng.random_bytes(10) #=> "\323U\030TO\234\357\020\a\337"
37
- # Random.random_bytes(6) #=> "\xA1\xE6Lr\xC43"
38
- #
39
- # Generate alphanumeric strings:
40
- #
41
- # prng.alphanumeric(10) #=> "S8baxMJnPl"
42
- # prng.alphanumeric(10) #=> "aOxAg8BAJe"
43
- # Random.alphanumeric #=> "TmP9OsJHJLtaZYhP"
44
- #
45
- # Generate UUIDs:
46
- #
47
- # prng.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
48
- # prng.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
49
- # Random.uuid #=> "f14e0271-de96-45cc-8911-8910292a42cd"
50
- #
51
- # All methods are available in the standard library Bundler::SecureRandom, too:
52
- #
53
- # Bundler::SecureRandom.hex #=> "05b45376a30c67238eb93b16499e50cf"
54
-
55
- module Bundler::Random::Formatter
56
-
57
- # Generate a random binary string.
58
- #
59
- # The argument _n_ specifies the length of the result string.
60
- #
61
- # If _n_ is not specified or is nil, 16 is assumed.
62
- # It may be larger in future.
63
- #
64
- # The result may contain any byte: "\x00" - "\xff".
65
- #
66
- # require 'bundler/vendor/securerandom/lib/random/formatter'
67
- #
68
- # Random.random_bytes #=> "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
69
- # # or
70
- # prng = Random.new
71
- # prng.random_bytes #=> "m\xDC\xFC/\a\x00Uf\xB2\xB2P\xBD\xFF6S\x97"
72
- def random_bytes(n=nil)
73
- n = n ? n.to_int : 16
74
- gen_random(n)
75
- end
76
-
77
- # Generate a random hexadecimal string.
78
- #
79
- # The argument _n_ specifies the length, in bytes, of the random number to be generated.
80
- # The length of the resulting hexadecimal string is twice of _n_.
81
- #
82
- # If _n_ is not specified or is nil, 16 is assumed.
83
- # It may be larger in the future.
84
- #
85
- # The result may contain 0-9 and a-f.
86
- #
87
- # require 'bundler/vendor/securerandom/lib/random/formatter'
88
- #
89
- # Random.hex #=> "eb693ec8252cd630102fd0d0fb7c3485"
90
- # # or
91
- # prng = Random.new
92
- # prng.hex #=> "91dc3bfb4de5b11d029d376634589b61"
93
- def hex(n=nil)
94
- random_bytes(n).unpack1("H*")
95
- end
96
-
97
- # Generate a random base64 string.
98
- #
99
- # The argument _n_ specifies the length, in bytes, of the random number
100
- # to be generated. The length of the result string is about 4/3 of _n_.
101
- #
102
- # If _n_ is not specified or is nil, 16 is assumed.
103
- # It may be larger in the future.
104
- #
105
- # The result may contain A-Z, a-z, 0-9, "+", "/" and "=".
106
- #
107
- # require 'bundler/vendor/securerandom/lib/random/formatter'
108
- #
109
- # Random.base64 #=> "/2BuBuLf3+WfSKyQbRcc/A=="
110
- # # or
111
- # prng = Random.new
112
- # prng.base64 #=> "6BbW0pxO0YENxn38HMUbcQ=="
113
- #
114
- # See RFC 3548 for the definition of base64.
115
- def base64(n=nil)
116
- [random_bytes(n)].pack("m0")
117
- end
118
-
119
- # Generate a random URL-safe base64 string.
120
- #
121
- # The argument _n_ specifies the length, in bytes, of the random number
122
- # to be generated. The length of the result string is about 4/3 of _n_.
123
- #
124
- # If _n_ is not specified or is nil, 16 is assumed.
125
- # It may be larger in the future.
126
- #
127
- # The boolean argument _padding_ specifies the padding.
128
- # If it is false or nil, padding is not generated.
129
- # Otherwise padding is generated.
130
- # By default, padding is not generated because "=" may be used as a URL delimiter.
131
- #
132
- # The result may contain A-Z, a-z, 0-9, "-" and "_".
133
- # "=" is also used if _padding_ is true.
134
- #
135
- # require 'bundler/vendor/securerandom/lib/random/formatter'
136
- #
137
- # Random.urlsafe_base64 #=> "b4GOKm4pOYU_-BOXcrUGDg"
138
- # # or
139
- # prng = Random.new
140
- # prng.urlsafe_base64 #=> "UZLdOkzop70Ddx-IJR0ABg"
141
- #
142
- # prng.urlsafe_base64(nil, true) #=> "i0XQ-7gglIsHGV2_BNPrdQ=="
143
- # prng.urlsafe_base64(nil, true) #=> "-M8rLhr7JEpJlqFGUMmOxg=="
144
- #
145
- # See RFC 3548 for the definition of URL-safe base64.
146
- def urlsafe_base64(n=nil, padding=false)
147
- s = [random_bytes(n)].pack("m0")
148
- s.tr!("+/", "-_")
149
- s.delete!("=") unless padding
150
- s
151
- end
152
-
153
- # Generate a random v4 UUID (Universally Unique IDentifier).
154
- #
155
- # require 'bundler/vendor/securerandom/lib/random/formatter'
156
- #
157
- # Random.uuid #=> "2d931510-d99f-494a-8c67-87feb05e1594"
158
- # Random.uuid #=> "bad85eb9-0713-4da7-8d36-07a8e4b00eab"
159
- # # or
160
- # prng = Random.new
161
- # prng.uuid #=> "62936e70-1815-439b-bf89-8492855a7e6b"
162
- #
163
- # The version 4 UUID is purely random (except the version).
164
- # It doesn't contain meaningful information such as MAC addresses, timestamps, etc.
165
- #
166
- # The result contains 122 random bits (15.25 random bytes).
167
- #
168
- # See RFC4122[https://datatracker.ietf.org/doc/html/rfc4122] for details of UUID.
169
- #
170
- def uuid
171
- ary = random_bytes(16).unpack("NnnnnN")
172
- ary[2] = (ary[2] & 0x0fff) | 0x4000
173
- ary[3] = (ary[3] & 0x3fff) | 0x8000
174
- "%08x-%04x-%04x-%04x-%04x%08x" % ary
175
- end
176
-
177
- alias uuid_v4 uuid
178
-
179
- # Generate a random v7 UUID (Universally Unique IDentifier).
180
- #
181
- # require 'bundler/vendor/securerandom/lib/random/formatter'
182
- #
183
- # Random.uuid_v7 # => "0188d4c3-1311-7f96-85c7-242a7aa58f1e"
184
- # Random.uuid_v7 # => "0188d4c3-16fe-744f-86af-38fa04c62bb5"
185
- # Random.uuid_v7 # => "0188d4c3-1af8-764f-b049-c204ce0afa23"
186
- # Random.uuid_v7 # => "0188d4c3-1e74-7085-b14f-ef6415dc6f31"
187
- # # |<--sorted-->| |<----- random ---->|
188
- #
189
- # # or
190
- # prng = Random.new
191
- # prng.uuid_v7 # => "0188ca51-5e72-7950-a11d-def7ff977c98"
192
- #
193
- # The version 7 UUID starts with the least significant 48 bits of a 64 bit
194
- # Unix timestamp (milliseconds since the epoch) and fills the remaining bits
195
- # with random data, excluding the version and variant bits.
196
- #
197
- # This allows version 7 UUIDs to be sorted by creation time. Time ordered
198
- # UUIDs can be used for better database index locality of newly inserted
199
- # records, which may have a significant performance benefit compared to random
200
- # data inserts.
201
- #
202
- # The result contains 74 random bits (9.25 random bytes).
203
- #
204
- # Note that this method cannot be made reproducable because its output
205
- # includes not only random bits but also timestamp.
206
- #
207
- # See draft-ietf-uuidrev-rfc4122bis[https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/]
208
- # for details of UUIDv7.
209
- #
210
- # ==== Monotonicity
211
- #
212
- # UUIDv7 has millisecond precision by default, so multiple UUIDs created
213
- # within the same millisecond are not issued in monotonically increasing
214
- # order. To create UUIDs that are time-ordered with sub-millisecond
215
- # precision, up to 12 bits of additional timestamp may added with
216
- # +extra_timestamp_bits+. The extra timestamp precision comes at the expense
217
- # of random bits. Setting <tt>extra_timestamp_bits: 12</tt> provides ~244ns
218
- # of precision, but only 62 random bits (7.75 random bytes).
219
- #
220
- # prng = Random.new
221
- # Array.new(4) { prng.uuid_v7(extra_timestamp_bits: 12) }
222
- # # =>
223
- # ["0188d4c7-13da-74f9-8b53-22a786ffdd5a",
224
- # "0188d4c7-13da-753b-83a5-7fb9b2afaeea",
225
- # "0188d4c7-13da-754a-88ea-ac0baeedd8db",
226
- # "0188d4c7-13da-7557-83e1-7cad9cda0d8d"]
227
- # # |<--- sorted --->| |<-- random --->|
228
- #
229
- # Array.new(4) { prng.uuid_v7(extra_timestamp_bits: 8) }
230
- # # =>
231
- # ["0188d4c7-3333-7a95-850a-de6edb858f7e",
232
- # "0188d4c7-3333-7ae8-842e-bc3a8b7d0cf9", # <- out of order
233
- # "0188d4c7-3333-7ae2-995a-9f135dc44ead", # <- out of order
234
- # "0188d4c7-3333-7af9-87c3-8f612edac82e"]
235
- # # |<--- sorted -->||<---- random --->|
236
- #
237
- # Any rollbacks of the system clock will break monotonicity. UUIDv7 is based
238
- # on UTC, which excludes leap seconds and can rollback the clock. To avoid
239
- # this, the system clock can synchronize with an NTP server configured to use
240
- # a "leap smear" approach. NTP or PTP will also be needed to synchronize
241
- # across distributed nodes.
242
- #
243
- # Counters and other mechanisms for stronger guarantees of monotonicity are
244
- # not implemented. Applications with stricter requirements should follow
245
- # {Section 6.2}[https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-07.html#monotonicity_counters]
246
- # of the specification.
247
- #
248
- def uuid_v7(extra_timestamp_bits: 0)
249
- case (extra_timestamp_bits = Integer(extra_timestamp_bits))
250
- when 0 # min timestamp precision
251
- ms = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)
252
- rand = random_bytes(10)
253
- rand.setbyte(0, rand.getbyte(0) & 0x0f | 0x70) # version
254
- rand.setbyte(2, rand.getbyte(2) & 0x3f | 0x80) # variant
255
- "%08x-%04x-%s" % [
256
- (ms & 0x0000_ffff_ffff_0000) >> 16,
257
- (ms & 0x0000_0000_0000_ffff),
258
- rand.unpack("H4H4H12").join("-")
259
- ]
260
-
261
- when 12 # max timestamp precision
262
- ms, ns = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
263
- .divmod(1_000_000)
264
- extra_bits = ns * 4096 / 1_000_000
265
- rand = random_bytes(8)
266
- rand.setbyte(0, rand.getbyte(0) & 0x3f | 0x80) # variant
267
- "%08x-%04x-7%03x-%s" % [
268
- (ms & 0x0000_ffff_ffff_0000) >> 16,
269
- (ms & 0x0000_0000_0000_ffff),
270
- extra_bits,
271
- rand.unpack("H4H12").join("-")
272
- ]
273
-
274
- when (0..12) # the generic version is slower than the special cases above
275
- rand_a, rand_b1, rand_b2, rand_b3 = random_bytes(10).unpack("nnnN")
276
- rand_mask_bits = 12 - extra_timestamp_bits
277
- ms, ns = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
278
- .divmod(1_000_000)
279
- "%08x-%04x-%04x-%04x-%04x%08x" % [
280
- (ms & 0x0000_ffff_ffff_0000) >> 16,
281
- (ms & 0x0000_0000_0000_ffff),
282
- 0x7000 |
283
- ((ns * (1 << extra_timestamp_bits) / 1_000_000) << rand_mask_bits) |
284
- rand_a & ((1 << rand_mask_bits) - 1),
285
- 0x8000 | (rand_b1 & 0x3fff),
286
- rand_b2,
287
- rand_b3
288
- ]
289
-
290
- else
291
- raise ArgumentError, "extra_timestamp_bits must be in 0..12"
292
- end
293
- end
294
-
295
- # Internal interface to Random; Generate random data _n_ bytes.
296
- private def gen_random(n)
297
- self.bytes(n)
298
- end
299
-
300
- # Generate a string that randomly draws from a
301
- # source array of characters.
302
- #
303
- # The argument _source_ specifies the array of characters from which
304
- # to generate the string.
305
- # The argument _n_ specifies the length, in characters, of the string to be
306
- # generated.
307
- #
308
- # The result may contain whatever characters are in the source array.
309
- #
310
- # require 'bundler/vendor/securerandom/lib/random/formatter'
311
- #
312
- # prng.choose([*'l'..'r'], 16) #=> "lmrqpoonmmlqlron"
313
- # prng.choose([*'0'..'9'], 5) #=> "27309"
314
- private def choose(source, n)
315
- size = source.size
316
- m = 1
317
- limit = size
318
- while limit * size <= 0x100000000
319
- limit *= size
320
- m += 1
321
- end
322
- result = ''.dup
323
- while m <= n
324
- rs = random_number(limit)
325
- is = rs.digits(size)
326
- (m-is.length).times { is << 0 }
327
- result << source.values_at(*is).join('')
328
- n -= m
329
- end
330
- if 0 < n
331
- rs = random_number(limit)
332
- is = rs.digits(size)
333
- if is.length < n
334
- (n-is.length).times { is << 0 }
335
- else
336
- is.pop while n < is.length
337
- end
338
- result.concat source.values_at(*is).join('')
339
- end
340
- result
341
- end
342
-
343
- # The default character list for #alphanumeric.
344
- ALPHANUMERIC = [*'A'..'Z', *'a'..'z', *'0'..'9']
345
-
346
- # Generate a random alphanumeric string.
347
- #
348
- # The argument _n_ specifies the length, in characters, of the alphanumeric
349
- # string to be generated.
350
- # The argument _chars_ specifies the character list which the result is
351
- # consist of.
352
- #
353
- # If _n_ is not specified or is nil, 16 is assumed.
354
- # It may be larger in the future.
355
- #
356
- # The result may contain A-Z, a-z and 0-9, unless _chars_ is specified.
357
- #
358
- # require 'bundler/vendor/securerandom/lib/random/formatter'
359
- #
360
- # Random.alphanumeric #=> "2BuBuLf3WfSKyQbR"
361
- # # or
362
- # prng = Random.new
363
- # prng.alphanumeric(10) #=> "i6K93NdqiH"
364
- #
365
- # Random.alphanumeric(4, chars: [*"0".."9"]) #=> "2952"
366
- # # or
367
- # prng = Random.new
368
- # prng.alphanumeric(10, chars: [*"!".."/"]) #=> ",.,++%/''."
369
- def alphanumeric(n = nil, chars: ALPHANUMERIC)
370
- n = 16 if n.nil?
371
- choose(chars, n)
372
- end
373
- end
@@ -1,22 +0,0 @@
1
- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions
5
- are met:
6
- 1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- 2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
- SUCH DAMAGE.
@@ -1,22 +0,0 @@
1
- Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without
4
- modification, are permitted provided that the following conditions
5
- are met:
6
- 1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
8
- 2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
- SUCH DAMAGE.