rubygems-update 3.5.10 → 3.5.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +60 -1
  3. data/CODE_OF_CONDUCT.md +79 -28
  4. data/CONTRIBUTING.md +2 -2
  5. data/Manifest.txt +2 -0
  6. data/bundler/CHANGELOG.md +48 -0
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/install.rb +1 -1
  9. data/bundler/lib/bundler/cli.rb +5 -8
  10. data/bundler/lib/bundler/compact_index_client/cache.rb +47 -72
  11. data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
  12. data/bundler/lib/bundler/compact_index_client.rb +51 -80
  13. data/bundler/lib/bundler/constants.rb +8 -1
  14. data/bundler/lib/bundler/definition.rb +21 -27
  15. data/bundler/lib/bundler/errors.rb +14 -0
  16. data/bundler/lib/bundler/fetcher/compact_index.rb +15 -24
  17. data/bundler/lib/bundler/gem_helper.rb +1 -1
  18. data/bundler/lib/bundler/installer/gem_installer.rb +0 -1
  19. data/bundler/lib/bundler/installer.rb +8 -8
  20. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-config.1 +2 -2
  26. data/bundler/lib/bundler/man/bundle-config.1.ronn +1 -1
  27. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle.1 +1 -1
  49. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  50. data/bundler/lib/bundler/rubygems_ext.rb +20 -12
  51. data/bundler/lib/bundler/rubygems_integration.rb +14 -0
  52. data/bundler/lib/bundler/self_manager.rb +6 -1
  53. data/bundler/lib/bundler/settings.rb +12 -8
  54. data/bundler/lib/bundler/setup.rb +3 -0
  55. data/bundler/lib/bundler/shared_helpers.rb +6 -4
  56. data/bundler/lib/bundler/source/git/git_proxy.rb +8 -0
  57. data/bundler/lib/bundler/source/git.rb +14 -0
  58. data/bundler/lib/bundler/source/metadata.rb +2 -0
  59. data/bundler/lib/bundler/source/path.rb +0 -13
  60. data/bundler/lib/bundler/source/rubygems.rb +32 -15
  61. data/bundler/lib/bundler/source_list.rb +13 -2
  62. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  63. data/bundler/lib/bundler/version.rb +1 -1
  64. data/bundler/lib/bundler/yaml_serializer.rb +1 -8
  65. data/bundler/lib/bundler.rb +6 -1
  66. data/exe/update_rubygems +1 -1
  67. data/lib/rubygems/basic_specification.rb +27 -0
  68. data/lib/rubygems/commands/pristine_command.rb +12 -9
  69. data/lib/rubygems/commands/setup_command.rb +2 -0
  70. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  71. data/lib/rubygems/dependency.rb +1 -13
  72. data/lib/rubygems/ext/cargo_builder.rb +1 -16
  73. data/lib/rubygems/installer.rb +1 -1
  74. data/lib/rubygems/package/tar_header.rb +20 -4
  75. data/lib/rubygems/package.rb +0 -1
  76. data/lib/rubygems/platform.rb +1 -0
  77. data/lib/rubygems/specification.rb +45 -118
  78. data/lib/rubygems/specification_policy.rb +3 -1
  79. data/lib/rubygems/specification_record.rb +212 -0
  80. data/lib/rubygems/stub_specification.rb +21 -0
  81. data/lib/rubygems/uninstaller.rb +26 -19
  82. data/lib/rubygems/util/licenses.rb +25 -0
  83. data/lib/rubygems/yaml_serializer.rb +1 -8
  84. data/lib/rubygems.rb +8 -1
  85. data/rubygems-update.gemspec +1 -1
  86. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97ec064ecaff6444c3f5d4886ab9f26d8816ecbfd69bde14cc9d9748fd5216ca
4
- data.tar.gz: 8faa5fd2aff20db824858c72c8630330d756a0c1ed4be3ebed776f34312d78a7
3
+ metadata.gz: c35be5895f916b09303ca0a72f0cc908f52df658c8860de916b73d4e0637fb1d
4
+ data.tar.gz: 5ca038be72e7dd475544a0fe4baa5998dc4ec4fc40169c86bbceaf3004a28993
5
5
  SHA512:
6
- metadata.gz: efd2a5427612ce3ba3752fabb0b8bb3896fc39bcbbec9b96b901cae4ea1f11b074865a5a1d1a2d648b6557a0cd8bca53701ad9479f2b2d9492da0f58bdfb20d0
7
- data.tar.gz: 9cc9ec7254e49127dbf7f48c1d052ff86195075e09d7e59b0ed5d053233fd7e1f0dffc5ba7def7f5d3e71102d8efbcabac0616c0e47caef385bf96fe18012a50
6
+ metadata.gz: '018263fd318b8ff0f135774f71daac0b005472254e524cf93fc9616650ddba36f397a0c0f94ed2c278e276ab8ec6cc5a6323af2375d0a1a220e066d863904142'
7
+ data.tar.gz: f9713050e6ab501c1777a44c1409c5aa45cb17bdf5795f61113d27bbad2abf502a604a1d6d4930ff59c548349920a61ea7d4bae1a99eeef8e41842b6a9a3af1a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,62 @@
1
+ # 3.5.12 / 2024-06-13
2
+
3
+ ## Enhancements:
4
+
5
+ * Installs bundler 2.5.12 as a default gem.
6
+
7
+ ## Bug fixes:
8
+
9
+ * Fix `gem uninstall` unresolved specifications warning. Pull request
10
+ [#7667](https://github.com/rubygems/rubygems/pull/7667) by
11
+ deivid-rodriguez
12
+ * Fix `gem pristine` sometimes failing to pristine user installed gems.
13
+ Pull request [#7664](https://github.com/rubygems/rubygems/pull/7664) by
14
+ deivid-rodriguez
15
+
16
+ # 3.5.11 / 2024-05-28
17
+
18
+ ## Enhancements:
19
+
20
+ * Update SPDX license list as of 2024-05-22. Pull request
21
+ [#7689](https://github.com/rubygems/rubygems/pull/7689) by
22
+ github-actions[bot]
23
+ * Fix the update_rubygems inconsistency (--disable-gems). Pull request
24
+ [#7658](https://github.com/rubygems/rubygems/pull/7658) by x-yuri
25
+ * Accept WASI as an OS name in Gem::Platform. Pull request
26
+ [#7629](https://github.com/rubygems/rubygems/pull/7629) by kateinoigakukun
27
+ * Warn if RubyGems version explicitly set in gemspec does not match
28
+ running version. Pull request
29
+ [#7460](https://github.com/rubygems/rubygems/pull/7460) by
30
+ deivid-rodriguez
31
+ * Installs bundler 2.5.11 as a default gem.
32
+
33
+ ## Bug fixes:
34
+
35
+ * Fix binstubs sometimes not getting regenerated when `--destdir` is
36
+ given. Pull request
37
+ [#7660](https://github.com/rubygems/rubygems/pull/7660) by
38
+ deivid-rodriguez
39
+ * Fix `gem uninstall --user-install` for symlinked HOME. Pull request
40
+ [#7645](https://github.com/rubygems/rubygems/pull/7645) by
41
+ deivid-rodriguez
42
+ * Fix issue when plugin stubs would sometimes not be properly removed by
43
+ `gem uninstall`. Pull request
44
+ [#7631](https://github.com/rubygems/rubygems/pull/7631) by
45
+ deivid-rodriguez
46
+ * Fix plugins uninstallation for user installed gems. Pull request
47
+ [#6456](https://github.com/rubygems/rubygems/pull/6456) by voxik
48
+
49
+ ## Performance:
50
+
51
+ * Use a constant empty tar header to avoid extra allocations. Pull request
52
+ [#7484](https://github.com/rubygems/rubygems/pull/7484) by segiddins
53
+
54
+ ## Documentation:
55
+
56
+ * Recommend `bin/rake` over `rake` in contributing docs. Pull request
57
+ [#7648](https://github.com/rubygems/rubygems/pull/7648) by
58
+ deivid-rodriguez
59
+
1
60
  # 3.5.10 / 2024-05-03
2
61
 
3
62
  ## Security:
@@ -5949,7 +6008,7 @@ There has been some minor usability enhancements and changes ...
5949
6008
  This *greatly* speeds up gem commands run in non-admin mode when the
5950
6009
  site-wide cache is out of date.
5951
6010
  * The gem command now used an HTTP HEAD command to detect if the
5952
- server's source index needs to be downloaed.
6011
+ server's source index needs to be downloaded.
5953
6012
  * gem check gemname --test will run unit tests on installed gems that
5954
6013
  have unit tests.
5955
6014
  * Multiple gem names are allowed on the gem install command line.
data/CODE_OF_CONDUCT.md CHANGED
@@ -2,80 +2,131 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
6
11
 
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
8
14
 
9
15
  ## Our Standards
10
16
 
11
- Examples of behavior that contributes to a positive environment for our community include:
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
12
19
 
13
20
  * Demonstrating empathy and kindness toward other people
14
21
  * Being respectful of differing opinions, viewpoints, and experiences
15
22
  * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
18
27
 
19
28
  Examples of unacceptable behavior include:
20
29
 
21
- * The use of sexualized language or imagery, and sexual attention or advances of any kind
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
22
32
  * Trolling, insulting or derogatory comments, and personal or political attacks
23
33
  * Public or private harassment
24
- * Publishing others' private information, such as a physical or email address, without their explicit permission
25
- * Other conduct which could reasonably be considered inappropriate in a professional setting
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
26
38
 
27
39
  ## Enforcement Responsibilities
28
40
 
29
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
30
45
 
31
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
32
50
 
33
51
  ## Scope
34
52
 
35
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
36
58
 
37
59
  ## Enforcement
38
60
 
39
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at team@bundler.io, or directly contacting project team members via email or Slack. All complaints will be reviewed and investigated promptly and fairly.
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ team@bundler.io.
64
+ All complaints will be reviewed and investigated promptly and fairly.
40
65
 
41
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
42
68
 
43
69
  ## Enforcement Guidelines
44
70
 
45
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
46
73
 
47
74
  ### 1. Correction
48
75
 
49
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
50
78
 
51
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
52
82
 
53
83
  ### 2. Warning
54
84
 
55
- **Community Impact**: A violation through a single incident or series of actions.
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
56
87
 
57
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
58
94
 
59
95
  ### 3. Temporary Ban
60
96
 
61
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
62
99
 
63
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
64
105
 
65
106
  ### 4. Permanent Ban
66
107
 
67
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
68
111
 
69
- **Consequence**: A permanent ban from any sort of public interaction within the community.
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
70
114
 
71
115
  ## Attribution
72
116
 
73
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
74
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
75
120
 
76
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
77
-
78
- [homepage]: https://www.contributor-covenant.org
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
79
123
 
80
124
  For answers to common questions about this code of conduct, see the FAQ at
81
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/CONTRIBUTING.md CHANGED
@@ -31,7 +31,7 @@ here: https://guides.rubygems.org/contributing/
31
31
 
32
32
  ### Installing dependencies
33
33
 
34
- rake setup
34
+ bin/rake setup
35
35
 
36
36
  > **NOTE**: If the above fails with permission related errors, you're most
37
37
  > likely using a global Ruby installation (like the one packaged by your OS),
@@ -58,7 +58,7 @@ To run commands like `bundle install` from the repo:
58
58
 
59
59
  To run the entire test suite you can use:
60
60
 
61
- rake test
61
+ bin/rake test
62
62
 
63
63
  To run an individual test file located for example in `test/rubygems/test_deprecate.rb` you can use:
64
64
 
data/Manifest.txt CHANGED
@@ -54,6 +54,7 @@ bundler/lib/bundler/compact_index_client.rb
54
54
  bundler/lib/bundler/compact_index_client/cache.rb
55
55
  bundler/lib/bundler/compact_index_client/cache_file.rb
56
56
  bundler/lib/bundler/compact_index_client/gem_parser.rb
57
+ bundler/lib/bundler/compact_index_client/parser.rb
57
58
  bundler/lib/bundler/compact_index_client/updater.rb
58
59
  bundler/lib/bundler/constants.rb
59
60
  bundler/lib/bundler/current_ruby.rb
@@ -515,6 +516,7 @@ lib/rubygems/source_list.rb
515
516
  lib/rubygems/spec_fetcher.rb
516
517
  lib/rubygems/specification.rb
517
518
  lib/rubygems/specification_policy.rb
519
+ lib/rubygems/specification_record.rb
518
520
  lib/rubygems/ssl_certs/.document
519
521
  lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem
520
522
  lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ # 2.5.12 (June 13, 2024)
2
+
3
+ ## Enhancements:
4
+
5
+ - Keep credentials in lockfile if they are already there [#7720](https://github.com/rubygems/rubygems/pull/7720)
6
+ - Auto switch to locked bundler version even when using binstubs [#7719](https://github.com/rubygems/rubygems/pull/7719)
7
+ - Don't validate local gemspecs twice unnecessarily [#7725](https://github.com/rubygems/rubygems/pull/7725)
8
+ - Improve default gem handling by treating default gems as any other gem [#7673](https://github.com/rubygems/rubygems/pull/7673)
9
+
10
+ ## Bug fixes:
11
+
12
+ - Fix slow and incorrect resolution when adding `sorbet` to a Gemfile and the lockfile only includes "RUBY" in the platforms section [#7731](https://github.com/rubygems/rubygems/pull/7731)
13
+ - Fix duplicated config keys generated when `fallback_timeout` uri option is used [#7704](https://github.com/rubygems/rubygems/pull/7704)
14
+ - Fix `bundle exec` no longer working in truffleruby after explicit `require` of `pathname` was removed [#7703](https://github.com/rubygems/rubygems/pull/7703)
15
+ - Don't let `bundle config` report a path without a Gemfile as "local app" [#7687](https://github.com/rubygems/rubygems/pull/7687)
16
+
17
+ ## Documentation:
18
+
19
+ - Clarify BUNDLE_USER_CONFIG is a file [#7668](https://github.com/rubygems/rubygems/pull/7668)
20
+
21
+ # 2.5.11 (May 28, 2024)
22
+
23
+ ## Deprecations:
24
+
25
+ - Deprecate Bundler constants [#7653](https://github.com/rubygems/rubygems/pull/7653)
26
+
27
+ ## Enhancements:
28
+
29
+ - Bump `bundle gem` generated COC to Contributor Covenant 2.1 [#7692](https://github.com/rubygems/rubygems/pull/7692)
30
+ - Retry a full clone when git server does not support shallow capabilities [#7649](https://github.com/rubygems/rubygems/pull/7649)
31
+
32
+ ## Bug fixes:
33
+
34
+ - Fix regression when caching gems from secondary sources [#7659](https://github.com/rubygems/rubygems/pull/7659)
35
+ - Fix error when Bundler installation is corrupted [#7642](https://github.com/rubygems/rubygems/pull/7642)
36
+ - Fix crash caused by RubyGems `require` gem activation logic running before Bundler can properly register its own monkeypatches [#7647](https://github.com/rubygems/rubygems/pull/7647)
37
+
38
+ ## Performance:
39
+
40
+ - Update cache checksums to decrease string allocations [#7637](https://github.com/rubygems/rubygems/pull/7637)
41
+ - Fix performance regression in applications with a local cache [#7680](https://github.com/rubygems/rubygems/pull/7680)
42
+
43
+ ## Documentation:
44
+
45
+ - Recommend `bin/rake` over `rake` in contributing docs [#7648](https://github.com/rubygems/rubygems/pull/7648)
46
+ - Monthly man update for May 2024 [#7640](https://github.com/rubygems/rubygems/pull/7640)
47
+ - Clarify Bundler support policy [#7633](https://github.com/rubygems/rubygems/pull/7633)
48
+
1
49
  # 2.5.10 (May 3, 2024)
2
50
 
3
51
  ## Security:
@@ -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 = "2024-05-03".freeze
8
- @git_commit_sha = "24cac00613".freeze
7
+ @built_at = "2024-06-13".freeze
8
+ @git_commit_sha = "05dc7d98e5".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -14,7 +14,7 @@ module Bundler
14
14
 
15
15
  Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed
16
16
 
17
- Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
17
+ Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Gem.freebsd_platform?
18
18
 
19
19
  # Disable color in deployment mode
20
20
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
@@ -65,7 +65,7 @@ module Bundler
65
65
  Bundler.reset_settings_and_root!
66
66
  end
67
67
 
68
- Bundler.self_manager.restart_with_locked_bundler_if_needed
68
+ Bundler.auto_switch
69
69
 
70
70
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
71
71
 
@@ -767,13 +767,10 @@ module Bundler
767
767
 
768
768
  return unless SharedHelpers.md5_available?
769
769
 
770
- latest = Fetcher::CompactIndex.
771
- new(nil, Source::Rubygems::Remote.new(Gem::URI("https://rubygems.org")), nil, nil).
772
- send(:compact_index_client).
773
- instance_variable_get(:@cache).
774
- dependencies("bundler").
775
- map {|d| Gem::Version.new(d.first) }.
776
- max
770
+ require_relative "vendored_uri"
771
+ remote = Source::Rubygems::Remote.new(Gem::URI("https://rubygems.org"))
772
+ cache_path = Bundler.user_cache.join("compact_index", remote.cache_slug)
773
+ latest = Bundler::CompactIndexClient.new(cache_path).latest_version("bundler")
777
774
  return unless latest
778
775
 
779
776
  current = Gem::Version.new(VERSION)
@@ -7,114 +7,89 @@ module Bundler
7
7
  class Cache
8
8
  attr_reader :directory
9
9
 
10
- def initialize(directory)
10
+ def initialize(directory, fetcher = nil)
11
11
  @directory = Pathname.new(directory).expand_path
12
- info_roots.each {|dir| mkdir(dir) }
13
- mkdir(info_etag_root)
12
+ @updater = Updater.new(fetcher) if fetcher
13
+ @mutex = Thread::Mutex.new
14
+ @endpoints = Set.new
15
+
16
+ @info_root = mkdir("info")
17
+ @special_characters_info_root = mkdir("info-special-characters")
18
+ @info_etag_root = mkdir("info-etags")
14
19
  end
15
20
 
16
21
  def names
17
- lines(names_path)
22
+ fetch("names", names_path, names_etag_path)
18
23
  end
19
24
 
20
- def names_path
21
- directory.join("names")
25
+ def versions
26
+ fetch("versions", versions_path, versions_etag_path)
22
27
  end
23
28
 
24
- def names_etag_path
25
- directory.join("names.etag")
26
- end
29
+ def info(name, remote_checksum = nil)
30
+ path = info_path(name)
27
31
 
28
- def versions
29
- versions_by_name = Hash.new {|hash, key| hash[key] = [] }
30
- info_checksums_by_name = {}
31
-
32
- lines(versions_path).each do |line|
33
- name, versions_string, info_checksum = line.split(" ", 3)
34
- info_checksums_by_name[name] = info_checksum || ""
35
- versions_string.split(",") do |version|
36
- delete = version.delete_prefix!("-")
37
- version = version.split("-", 2).unshift(name)
38
- if delete
39
- versions_by_name[name].delete(version)
40
- else
41
- versions_by_name[name] << version
42
- end
43
- end
32
+ if remote_checksum && remote_checksum != SharedHelpers.checksum_for_file(path, :MD5)
33
+ fetch("info/#{name}", path, info_etag_path(name))
34
+ else
35
+ Bundler::CompactIndexClient.debug { "update skipped info/#{name} (#{remote_checksum ? "versions index checksum is nil" : "versions index checksum matches local"})" }
36
+ read(path)
44
37
  end
45
-
46
- [versions_by_name, info_checksums_by_name]
47
- end
48
-
49
- def versions_path
50
- directory.join("versions")
51
38
  end
52
39
 
53
- def versions_etag_path
54
- directory.join("versions.etag")
40
+ def reset!
41
+ @mutex.synchronize { @endpoints.clear }
55
42
  end
56
43
 
57
- def checksums
58
- checksums = {}
59
-
60
- lines(versions_path).each do |line|
61
- name, _, checksum = line.split(" ", 3)
62
- checksums[name] = checksum
63
- end
64
-
65
- checksums
66
- end
44
+ private
67
45
 
68
- def dependencies(name)
69
- lines(info_path(name)).map do |line|
70
- parse_gem(line)
71
- end
72
- end
46
+ def names_path = directory.join("names")
47
+ def names_etag_path = directory.join("names.etag")
48
+ def versions_path = directory.join("versions")
49
+ def versions_etag_path = directory.join("versions.etag")
73
50
 
74
51
  def info_path(name)
75
52
  name = name.to_s
53
+ # TODO: converge this into the info_root by hashing all filenames like info_etag_path
76
54
  if /[^a-z0-9_-]/.match?(name)
77
55
  name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
78
- info_roots.last.join(name)
56
+ @special_characters_info_root.join(name)
79
57
  else
80
- info_roots.first.join(name)
58
+ @info_root.join(name)
81
59
  end
82
60
  end
83
61
 
84
62
  def info_etag_path(name)
85
63
  name = name.to_s
86
- info_etag_root.join("#{name}-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}")
64
+ @info_etag_root.join("#{name}-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}")
87
65
  end
88
66
 
89
- private
90
-
91
- def mkdir(dir)
92
- SharedHelpers.filesystem_access(dir) do
93
- FileUtils.mkdir_p(dir)
67
+ def mkdir(name)
68
+ directory.join(name).tap do |dir|
69
+ SharedHelpers.filesystem_access(dir) do
70
+ FileUtils.mkdir_p(dir)
71
+ end
94
72
  end
95
73
  end
96
74
 
97
- def lines(path)
98
- return [] unless path.file?
99
- lines = SharedHelpers.filesystem_access(path, :read, &:read).split("\n")
100
- header = lines.index("---")
101
- header ? lines[header + 1..-1] : lines
102
- end
75
+ def fetch(remote_path, path, etag_path)
76
+ if already_fetched?(remote_path)
77
+ Bundler::CompactIndexClient.debug { "already fetched #{remote_path}" }
78
+ else
79
+ Bundler::CompactIndexClient.debug { "fetching #{remote_path}" }
80
+ @updater&.update(remote_path, path, etag_path)
81
+ end
103
82
 
104
- def parse_gem(line)
105
- @dependency_parser ||= GemParser.new
106
- @dependency_parser.parse(line)
83
+ read(path)
107
84
  end
108
85
 
109
- def info_roots
110
- [
111
- directory.join("info"),
112
- directory.join("info-special-characters"),
113
- ]
86
+ def already_fetched?(remote_path)
87
+ @mutex.synchronize { !@endpoints.add?(remote_path) }
114
88
  end
115
89
 
116
- def info_etag_root
117
- directory.join("info-etags")
90
+ def read(path)
91
+ return unless path.file?
92
+ SharedHelpers.filesystem_access(path, :read, &:read)
118
93
  end
119
94
  end
120
95
  end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bundler
4
+ class CompactIndexClient
5
+ class Parser
6
+ # `compact_index` - an object responding to #names, #versions, #info(name, checksum),
7
+ # returning the file contents as a string
8
+ def initialize(compact_index)
9
+ @compact_index = compact_index
10
+ @info_checksums = nil
11
+ @versions_by_name = nil
12
+ @available = nil
13
+ @gem_parser = nil
14
+ end
15
+
16
+ def names
17
+ lines(@compact_index.names)
18
+ end
19
+
20
+ def versions
21
+ @versions_by_name ||= Hash.new {|hash, key| hash[key] = [] }
22
+ @info_checksums = {}
23
+
24
+ lines(@compact_index.versions).each do |line|
25
+ name, versions_string, checksum = line.split(" ", 3)
26
+ @info_checksums[name] = checksum || ""
27
+ versions_string.split(",") do |version|
28
+ delete = version.delete_prefix!("-")
29
+ version = version.split("-", 2).unshift(name)
30
+ if delete
31
+ @versions_by_name[name].delete(version)
32
+ else
33
+ @versions_by_name[name] << version
34
+ end
35
+ end
36
+ end
37
+
38
+ @versions_by_name
39
+ end
40
+
41
+ def info(name)
42
+ data = @compact_index.info(name, info_checksums[name])
43
+ lines(data).map {|line| gem_parser.parse(line).unshift(name) }
44
+ end
45
+
46
+ def available?
47
+ return @available unless @available.nil?
48
+ @available = !info_checksums.empty?
49
+ end
50
+
51
+ private
52
+
53
+ def info_checksums
54
+ @info_checksums ||= lines(@compact_index.versions).each_with_object({}) do |line, checksums|
55
+ parse_version_checksum(line, checksums)
56
+ end
57
+ end
58
+
59
+ def lines(data)
60
+ return [] if data.nil? || data.empty?
61
+ lines = data.split("\n")
62
+ header = lines.index("---")
63
+ header ? lines[header + 1..-1] : lines
64
+ end
65
+
66
+ def gem_parser
67
+ @gem_parser ||= GemParser.new
68
+ end
69
+
70
+ # This is mostly the same as `split(" ", 3)` but it avoids allocating extra objects.
71
+ # This method gets called at least once for every gem when parsing versions.
72
+ def parse_version_checksum(line, checksums)
73
+ return unless (name_end = line.index(" ")) # Artifactory bug causes blank lines in artifactor index files
74
+ return unless (checksum_start = line.index(" ", name_end + 1) + 1)
75
+ checksum_end = line.size - checksum_start
76
+
77
+ line.freeze # allows slicing into the string to not allocate a copy of the line
78
+ name = line[0, name_end]
79
+ checksum = line[checksum_start, checksum_end]
80
+ checksums[name.freeze] = checksum # freeze name since it is used as a hash key
81
+ end
82
+ end
83
+ end
84
+ end