rubygems

package
v1.19.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedType indicates an unsupported type
	ErrUnsupportedType = util.NewInvalidArgumentErrorf("type is unsupported")
	// ErrInvalidIntRange indicates an invalid number range
	ErrInvalidIntRange = util.NewInvalidArgumentErrorf("number is not in valid range")
)
View Source
var (
	// ErrMissingMetadataFile indicates a missing metadata.gz file
	ErrMissingMetadataFile = util.NewInvalidArgumentErrorf("metadata.gz file is missing")
	// ErrInvalidName indicates an invalid id in the metadata.gz file
	ErrInvalidName = util.NewInvalidArgumentErrorf("package name is invalid")
	// ErrInvalidVersion indicates an invalid version in the metadata.gz file
	ErrInvalidVersion = util.NewInvalidArgumentErrorf("package version is invalid")
)

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Name    string               `json:"name"`
	Version []VersionRequirement `json:"version"`
}

Dependency represents a dependency of a RubyGems package

type MarshalEncoder

type MarshalEncoder struct {
	// contains filtered or unexported fields
}

MarshalEncoder mimics Rubys Marshal class. Note: Only supports types used by the RubyGems package registry.

func NewMarshalEncoder

func NewMarshalEncoder(w io.Writer) *MarshalEncoder

NewMarshalEncoder creates a new MarshalEncoder

func (*MarshalEncoder) Encode

func (e *MarshalEncoder) Encode(v interface{}) error

Encode encodes the given type

type Metadata

type Metadata struct {
	Platform                string               `json:"platform,omitempty"`
	Description             string               `json:"description,omitempty"`
	Summary                 string               `json:"summary,omitempty"`
	Authors                 []string             `json:"authors,omitempty"`
	Licenses                []string             `json:"licenses,omitempty"`
	RequiredRubyVersion     []VersionRequirement `json:"required_ruby_version,omitempty"`
	RequiredRubygemsVersion []VersionRequirement `json:"required_rubygems_version,omitempty"`
	ProjectURL              string               `json:"project_url,omitempty"`
	RuntimeDependencies     []Dependency         `json:"runtime_dependencies,omitempty"`
	DevelopmentDependencies []Dependency         `json:"development_dependencies,omitempty"`
}

Metadata represents the metadata of a RubyGems package

type Package

type Package struct {
	Name     string
	Version  string
	Metadata *Metadata
}

Package represents a RubyGems package

func ParsePackageMetaData

func ParsePackageMetaData(r io.Reader) (*Package, error)

ParsePackageMetaData parses the metadata of a Gem package file

type RubyObject

type RubyObject struct {
	Name   string
	Member map[string]interface{}
}

RubyObject is a default Ruby object.

type RubyUserDef

type RubyUserDef struct {
	Name  string
	Value interface{}
}

RubyUserDef is a Ruby object that has a _load function.

type RubyUserMarshal

type RubyUserMarshal struct {
	Name  string
	Value interface{}
}

RubyUserMarshal is a Ruby object that has a marshal_load function.

type VersionRequirement

type VersionRequirement struct {
	Restriction string `json:"restriction"`
	Version     string `json:"version"`
}

VersionRequirement represents a version restriction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL