gems

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrGemLockNotFound is thrown when the gem file is not found.
	ErrGemLockNotFound = errors.New("gem lock file not found")
)

Functions

func BundleExecPrefix

func BundleExecPrefix(bundlerVersion Version) []string

BundleExecPrefix returns a slice containing: "bundle [_verson_] exec"

func BundleInstallCommand

func BundleInstallCommand(gemfileLockVersion Version) (*command.Model, error)

BundleInstallCommand returns a command to install a bundle using bundler

func GemFileLockContent

func GemFileLockContent(searchDir string) (string, error)

GemFileLockContent gets the content of the gem lock file from the given directory.

func GemFileLockPth

func GemFileLockPth(searchDir string) (string, error)

GemFileLockPth gets the path for the gem lock file from the given directory.

func InstallBundlerCommand

func InstallBundlerCommand(gemfileLockVersion Version) *command.Model

InstallBundlerCommand returns a command to install a specific bundler version

func RbenvVersionsCommand

func RbenvVersionsCommand() *command.Model

RbenvVersionsCommand retruns a command to print used and available ruby versions if rbenv is installed

Types

type Version

type Version struct {
	Version string
	Found   bool
}

Version contains a gem version

func ParseBundlerVersion

func ParseBundlerVersion(gemfileLockContent string) (gemVersion Version, err error)

ParseBundlerVersion returns the bundler version used to create the bundle

func ParseVersionFromBundle

func ParseVersionFromBundle(gemName string, gemfileLockContent string) (gemVersion Version, err error)

ParseVersionFromBundle returns the specified gem version parsed from a Gemfile.lock on a best effort basis, for logging purposes only.

for "fastlane" and the following Gemfile.lock example, it returns: ">= 2.0)"

specs:
  CFPropertyList (3.0.0)
  addressable (2.6.0)
    public_suffix (>= 2.0.2, < 4.0)
  atomos (0.1.3)
  babosa (1.0.2)
  badge (0.8.5)
    curb (~> 0.9)
    fastimage (>= 1.6)
    fastlane (>= 2.0)
    mini_magick (>= 4.5)
  claide (1.0.2)

func ParseVersionFromBundlePth

func ParseVersionFromBundlePth(gemName string, gemFileLockPth string) (Version, error)

ParseVersionFromBundlePth overload for ParseVersionFromBundle.

Jump to

Keyboard shortcuts

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