You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library is being vendored into rubygems.org, so direct users to
the rubygems.org issue tracker for future inquiries. Also clarify the
meaning of "consistently ordered" and replace the non-existent
VersionsFile#update_with example with a pointer to CompactIndex.versions.
Fixes#34Fixes#74
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+5-12Lines changed: 5 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
# CompactIndex
4
4
5
+
> **Note**: This library is being integrated directly into [rubygems.org](https://github.com/rubygems/rubygems.org). For bug reports, feature requests, and questions, please use the [rubygems.org issue tracker](https://github.com/rubygems/rubygems.org/issues).
6
+
5
7
This gem is a **server-side** library that generates responses in the compact index format. It is not a client for consuming compact index endpoints. Client implementations exist separately in [RubyGems](https://github.com/rubygems/rubygems) and [Bundler](https://github.com/rubygems/rubygems/tree/master/bundler/lib/bundler/compact_index_client).
6
8
7
9
The compact index format has three endpoints: `/names`, `/versions` and `/info/gem_name`. The versions file is a file which holds the versions in a cache-friendly way. You can see the body response formats on [the official Compact Index API guide](https://guides.rubygems.org/rubygems-org-compact-index-api/).
The body of this endpoint can be rendered calling the `CompactIndex.versions` method. It receives two parameters: a `CompactIndex::VersionsFile` object and a set of extra gems that aren't in the file yet. The gems lists should be ordered consistently by the user.
36
+
The body of this endpoint can be rendered calling the `CompactIndex.versions` method. It receives two parameters: a `CompactIndex::VersionsFile` object and a set of extra gems that aren't in the file yet. The gems should be ordered in the order they were added (i.e., chronological order of first publication).
Much like `/versions`, the `/info/gem_name` expects a pre-defined structure to render the text on the screen. The lists also should be ordered by the user. This is the expected format:
64
+
Much like `/versions`, the `/info/gem_name` expects a pre-defined structure to render the text on the screen. The versions should be ordered chronologically. This is the expected format:
63
65
64
66
```ruby
65
67
gem 'compact_index'
@@ -76,13 +78,4 @@ CompactIndex.info(versions)
76
78
77
79
### Updating the versions file
78
80
79
-
The versions file creation and update are different. When created, all versions are at the side of the gem name, which appears only on one line. When updated, the file appends the new information on the end of the file, to avoid file changes.
gems = ... # Query your database, same format from `/versions` expected
87
-
versions_file.update_with(gems)
88
-
```
81
+
The versions file creation and update are different. When created, all versions are at the side of the gem name, which appears only on one line. When updated, the file appends the new information on the end of the file, to avoid file changes. To append new gems, use `CompactIndex.versions(versions_file, extra_gems)` as shown in the `/versions` section above.
0 commit comments