ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Registry.Rubygems.Wire

Description

The RubyGems registry wire JSON, decoded into a typed model.

A placeholder boundary mirroring Ecluse.Registry.Pypi.Wire. Écluse serves only npm, so this models just the one shape another part of the system reads from RubyGems: the published version strings of the /api/v1/versions/{gem}.json response, which is a JSON array with one entry per version. Only each entry's number (the version string) is modelled; the rest of the entry (platform, SHA, timestamps) is ignored, leaving room for a full RubyGems adapter to grow the model later.

Unlike the npm and PyPI listings, the document is a top-level array, so parseJSON decodes it as a list of VersionEntry. An entry without a number is a decode failure rather than a silently-dropped element, since a version entry that names no version is meaningless.

Synopsis

Documentation

newtype VersionEntry Source #

One entry of the RubyGems versions array, modelled only by its version string.

Constructors

VersionEntry 

Fields

  • veNumber :: Text

    The version string (number), exactly as RubyGems lists it.

newtype VersionListing Source #

The whole /api/v1/versions/{gem}.json array, one VersionEntry per version.

Constructors

VersionListing 

Fields

listingVersions :: VersionListing -> [Text] Source #

The published version strings of a gem: each entry's number, in the order RubyGems returns them.