gem

package
v0.0.0-...-9878773 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Title                 = "specs:"
	SpecDependencyPath    = "vendor/bundle/ruby"
	SpecExtension         = ".gemspec"
	SpecDefaultDir        = "specifications"
	CacheDefaultDir       = "cache"
	GemDefaultDir         = "gems"
	RakefileDefaultName   = "Rakefile"
	PlatformsDefaultName  = "PLATFORMS"
	LegacyLockExtension   = ".lock"
	LicenseDefaultFile    = "LICENSE"
	CopyrightDefaultLabel = "Copyright (c)"
	LockExtension         = ".locked"
	GemDefaultExtension   = ".gem"
	DetectionModeSpec     = "spec"
	DetectionModeLock     = "lock"
	None                  = "NO ASSERTION"
)
View Source
const (
	DefaultMethod       = "GET"
	DefaultURL          = "https://rubygems.org/api/v1/gems"
	DefaultResponseType = ".json"
)

Variables

View Source
var (
	Required = map[string]bool{
		"s.name":                          true,
		"spec.name":                       true,
		"s.license":                       true,
		"spec.license":                    true,
		"s.licenses":                      true,
		"spec.licenses":                   true,
		"s.email":                         true,
		"spec.email":                      true,
		"s.homepage":                      true,
		"spec.homepage":                   true,
		"s.authors":                       true,
		"spec.authors":                    true,
		"s.summary":                       true,
		"spec.summary":                    true,
		"s.description":                   true,
		"spec.description":                true,
		"s.add_runtime_dependency":        true,
		"spec.add_runtime_dependency":     true,
		"s.add_development_dependency":    true,
		"spec.add_development_dependency": true,
		"s.add_dependency":                true,
		"spec.add_dependency":             true,
		"s.rubygems_version":              true,
		"spec.rubygems_version":           true,
		"s.required_ruby_version":         true,
		"spec.required_ruby_version":      true,
	}
)

Functions

func BuildLockDependencyTree

func BuildLockDependencyTree(rows []string)

Builds Dependency Tree from Gemfile.lock

func BuildSpecDependencies

func BuildSpecDependencies(path string, isFullPath bool, module *Spec)

Builds parent and child dependency tree from .gemspec

func Content

func Content(path string) []string

Scans and return file content

func ReduceSpec

func ReduceSpec(row, column string, spec *Spec)

Speeds up the build process concurrently

Types

type DependencyMap

type DependencyMap map[string]VersionMap

type Gem

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

func New

func New() *Gem

New ...

func (*Gem) GetMetadata

func (g *Gem) GetMetadata() plugin.Metadata

GetMetadata ...

func (*Gem) GetModule

func (g *Gem) GetModule(path string) ([]meta.Package, error)

GetModule ...

func (*Gem) GetRootModule

func (g *Gem) GetRootModule(path string) (*meta.Package, error)

GetRootModule...

func (*Gem) GetVersion

func (g *Gem) GetVersion() (string, error)

GetVersion ...

func (*Gem) HasModulesInstalled

func (g *Gem) HasModulesInstalled(path string) error

HasModulesInstalled ...

func (*Gem) IsValid

func (g *Gem) IsValid(path string) bool

IsValid ...

func (*Gem) ListModulesWithDeps

func (g *Gem) ListModulesWithDeps(path string, globalSettingFile string) ([]meta.Package, error)

ListModulesWithDeps ...

func (*Gem) ListUsedModules

func (g *Gem) ListUsedModules(path string) ([]meta.Package, error)

ListUsedModules ...

func (*Gem) SetRootModule

func (g *Gem) SetRootModule(path string) error

SetRootModule ...

type Line

type Line struct {
	Position  int
	Value     string
	Relations []string
}

type MetaVM

type MetaVM struct {
	Name             string   `json:"name"`
	Downloads        int64    `json:"downloads"`
	Version          string   `json:"version"`
	VersionCreatedAt string   `json:"version_created_at"`
	VersionDownloads int64    `json:"version_downloads"`
	Platform         string   `json:"platform"`
	Authors          string   `json:"authors"`
	Info             string   `json:"info"`
	Licenses         []string `json:"licenses"`
	Metadata         struct {
		ChangeLogURI     string `json:"changelog_uri"`
		BugTrackerURI    string `json:"bug_tracker_uri"`
		SourceCodeURI    string `json:"source_code_uri"`
		DocumentationURI string `json:"documentation_uri"`
	} `json:"metadata"`
	Yanked         bool   `json:"yanked"`
	SHA            string `json:"sha"`
	ProjectURI     string `json:"project_uri"`
	GemURI         string `json:"gem_uri"`
	HomepageURI    string `json:"homepage_uri"`
	WikiURI        string `json:"wiki_uri"`
	DocumentURI    string `json:"documentation_uri"`
	MailingListURI string `json:"mailing_list_uri"`
	SourceCodeURI  string `json:"source_code_uri"`
	BugTrackerURI  string `json:"bug_tracker_uri"`
	ChangeLogURI   string `json:"changelog_uri"`
	FundingURI     string `json:"funding_uri"`
	Dependencies   struct {
		Development []struct {
			Name         string `json:"name"`
			Requirements string `json:"requirements"`
		} `json:"development"`
		Runtime []struct {
			Name         string `json:"name"`
			Requirements string `json:"requirements"`
		} `json:"runtime"`
	} `json:"dependencies"`
	BuiltAt         string `json:"built_at"`
	CreatedAt       string `json:"created_at"`
	Description     string `json:"description"`
	DownloadCount   int64  `json:"downloads_count"`
	Number          string `json:"number"`
	Summary         string `json:"summary"`
	RubyGemsVersion string `json:"rubygems_version"`
	RubyVersion     string `json:"ruby_version"`
	Prerelease      bool   `json:"prerelease"`
}

type Package

type Package struct {
	Name      string
	Relations []string
}

func GetLockedDependencies

func GetLockedDependencies(path string) ([]Package, error)

Gets parent and child dependency tree from Gemfile.lock

type Service

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

func NewService

func NewService(name string) (*Service, error)

func (*Service) GetGem

func (service *Service) GetGem() (MetaVM, error)

type Spec

type Spec struct {
	Name                    string
	License                 string
	Licenses                []string
	LicenseText             string
	GemLocationDir          string
	CopyRight               string
	Version                 string
	Emails                  []string
	HomePage                string
	Authors                 []string
	Summary                 string
	Description             string
	Checksum                string
	RuntimeDependencies     []string
	DevelopmentDependencies []string
	RubyGemsVersion         string
	RequiredRubyVersion     string
	Specifications          []Spec
}

type VersionMap

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

Jump to

Keyboard shortcuts

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