swh.loader.package.rubygems.loader module#
- class swh.loader.package.rubygems.loader.RubyGemsPackageInfo(url: str, filename: str | None, name: str, version: str, built_at: TimestampWithTimezone | None, authors: List[Person], sha256: str, *, directory_extrinsic_metadata: List[RawExtrinsicMetadataCore] = [], checksums: Dict[str, str] = {})[source]#
Bases:
BasePackageInfo
Method generated by attrs for class RubyGemsPackageInfo.
- name#
Name of the package
- version#
Current version
- built_at#
Version build date
- authors#
Authors
- sha256#
Extid as sha256
- class swh.loader.package.rubygems.loader.RubyGemsLoader(storage: StorageInterface, url: str, artifacts: List[Dict[str, Any]], rubygem_metadata: List[Dict[str, Any]], max_content_size: int | None = None, **kwargs)[source]#
Bases:
PackageLoader
[RubyGemsPackageInfo
]Load
.gem
files fromRubyGems.org
into the SWH archive.- Loader’s constructor. This raises exception if the minimal required
configuration is missing (cf. fn:check method).
- Parameters:
storage – Storage instance
url – Origin url to load data from
- get_metadata_authority()[source]#
For package loaders that get extrinsic metadata, returns the authority the metadata are coming from.
- get_package_info(version: str) Iterator[Tuple[str, RubyGemsPackageInfo]] [source]#
- Given a release version of a package, retrieve the associated
package information for such version.
- Parameters:
version – Package version
- Returns:
(branch name, package metadata)
- build_release(p_info: RubyGemsPackageInfo, uncompressed_path: str, directory: bytes) Release | None [source]#
Build the release from the archive metadata (extrinsic artifact metadata) and the intrinsic metadata.
- Parameters:
p_info – Package information
uncompressed_path – Artifact uncompressed path on disk