olenagerasimova / gem-adapter

Ruby Gem Adapter for Artipie

Home Page:https://www.artipie.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Join our Telegramm group

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

Javadoc License codecov Hits-of-Code Maven Central PDD status

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 format
  • YamlMetaFormat - 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

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+.

About

Ruby Gem Adapter for Artipie

https://www.artipie.com

License:MIT License


Languages

Language:Java 95.2%Language:Ruby 3.1%Language:Shell 1.7%