Help us shape the future of Go! Take the 2026 Go Developer Survey

rubygems

package
v3.1.46 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 11 Imported by: 0

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 any) 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]any
}

RubyObject is a default Ruby object.

type RubyUserDef

type RubyUserDef struct {
	Name  string
	Value any
}

RubyUserDef is a Ruby object that has a _load function.

type RubyUserMarshal

type RubyUserMarshal struct {
	Name  string
	Value any
}

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

Source Files

  • marshal.go
  • metadata.go

Jump to

Keyboard shortcuts

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