Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit beecc9f

Browse files
hsbtclaude
andcommitted
Update README for rubygems.org integration
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 #34 Fixes #74 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ffd1d74 commit beecc9f

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# CompactIndex
44

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+
57
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).
68

79
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/).
@@ -31,7 +33,7 @@ CompactIndex.names(%W(a_test b_test c_test))
3133

3234
### `/versions`
3335

34-
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).
3537

3638
```ruby
3739
gem 'compact_index'
@@ -59,7 +61,7 @@ CompactIndex.versions(versions_file, extra_gems)
5961

6062
### `/info/gem_name`
6163

62-
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:
6365

6466
```ruby
6567
gem 'compact_index'
@@ -76,13 +78,4 @@ CompactIndex.info(versions)
7678

7779
### Updating the versions file
7880

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.
80-
81-
```ruby
82-
gem 'compact_index'
83-
84-
versions_file = CompactIndex::VersionsFile.new(file_path)
85-
last_update = versions_file.updated_at
86-
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

Comments
 (0)