gem-adapter
is a SDK for managing Gem repositories with low-level operations and HTTP endpoint for Gem repository.
This is the dependency you need:
<dependency>
<groupId>com.artipie</groupId>
<artifactId>gem-adapter</artifactId>
<version>[...]</version>
</dependency>
gem-adapter
is a slice in Artipie, aimed to support gem packages.
Read the Javadoc
for more technical details.
If you have any question or suggestions, do not hesitate to create an issue or contact us in
Telegram.
Artipie roadmap.
Usage
There are two public APIs for working with Gem repository:
- low-level
Gem
SDK - high-level
GemSlice
HTTP endpoint
Gem SDK
Create a new instance of Gem
class with: new Gem(storage)
,
where storage
is a asto Storage
implementation
with Gem repository.
To update repository with a new gem
package use gem.update(key)
, where key
is a package key in storage.
For retreiving package spec info use gem.info(key)
method with, where key
is a package key in storage.
It returns future with MetaInfo
interface, which can be printed to one of standard formats with meta.print(fmt)
:
JsonMetaFormat
- for JSON meta spec formatYamlMetaFormat
- for YAML meta spec format
To extract dependencies binary metadata of packages, use gem.dependencies(names)
method, where
names
is a set of gem names (Set<String>
); this method returns future with binary dependencies metadata
merged for multiple packages.
HTTP endpoint
To integrate Gem HTTP endpoint to server, use GemSlice
class instance: new GemSlice(storage)
, where
storage
is a repository storage for gem packages. This Slice
implementation exposes standard Gem repository
APIs and could be used by gem
CLI.
Useful links
- RubyGem Index Internals - File structure and gem format
- Make Your Own Gem - How to create and publish a simple ruby gem into rubygems.org registry.
- rubygems.org API - A page with rubygems.org API specification
- Gugelines at rubygems.org - Guidelines around the
gem
package manager.
How to contribute
Please read contributing rules.
Fork repository, make changes, send us a pull request. We will review
your changes and apply them to the master
branch shortly, provided
they don't violate our quality standards. To avoid frustration, before
sending us your pull request please run full Maven build:
$ mvn clean install -Pqulice
To avoid build errors use Maven 3.2+.