env

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2013 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName    = "uru"
	AppVersion = "0.3.0"
)

Variables

View Source
var BashWrapper = `` /* 663-byte string literal not displayed */

Functions

func CopyFile

func CopyFile(dst, src string) (written int64, err error)

CopyFile copies a source file to a destination file.

func MarshalRubies

func MarshalRubies(ctx *Context) (err error)

MarshallRubies persists the registered rubies to a JSON formatted file.

func PathListForTag

func PathListForTag(ctx *Context, tag string) (path []string, err error)

PathListForTag returns a PATH list appropriate for a given ruby tag.

func StringSplitPath

func StringSplitPath() (path []string, err error)

StringSplitPath splits the PATH env var into a slice of strings.

func UIYesConfirm

func UIYesConfirm(prompt string) (resp string, err error)

UIYesConfirm asks the user a question and returns Y or N with Y being the default.

Types

type Context

type Context struct {
	Rubies RubyRegistry
	// contains filtered or unexported fields
}

func (*Context) Cmd

func (c *Context) Cmd() string

func (*Context) CmdArgs

func (c *Context) CmdArgs() []string

func (*Context) CmdRegex

func (c *Context) CmdRegex(cmd string) *regexp.Regexp

func (*Context) Home

func (c *Context) Home() string

func (*Context) Init

func (c *Context) Init()

func (*Context) SetCmd

func (c *Context) SetCmd(cmd string)

func (*Context) SetCmdAndArgs

func (c *Context) SetCmdAndArgs(cmd string, args []string)

func (*Context) SetCmdArgs

func (c *Context) SetCmdArgs(args []string)

func (*Context) SetCmdRegex

func (c *Context) SetCmdRegex(cmd string, r string) error

func (*Context) SetHome

func (c *Context) SetHome(h string)

type Ruby

type Ruby struct {
	ID          string // ruby version including patch number
	Exe         string // ruby executable name
	Home        string // full path to ruby executable directory
	GemHome     string // full path to a ruby's gem home directory
	Description string // full ruby description
}

func CurrentRubyInfo

func CurrentRubyInfo(ctx *Context) (tag string, info Ruby, err error)

CurrentRubyInfo returns the identifying tag and metadata information for the ruby currently in use.

func RubyInfo

func RubyInfo(ruby string) (tag string, info Ruby, err error)

RubyInfo returns an identifying tag and metadata information about a specific ruby. It accepts a string of either the simple name of the ruby executable, or the ruby executables absolute path.

type RubyRegistry

type RubyRegistry map[string]Ruby

Jump to

Keyboard shortcuts

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