Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertPathToURI(path string) lsp.DocumentURI
- func ConvertURItoFilePath(uri lsp.DocumentURI) string
- func Download(url, targetDir, fileName string, silent bool) (string, error)
- func DownloadAndUnzip(downloadLink, tempDir string) (string, error)
- func FindAllNestedDirs(dir string) []string
- func FindConceptFilesIn(dir string) []string
- func GaugeFileExtensions() []string
- func GetFileContents(filepath string) (string, error)
- func GetLineCount(text string) int
- func GetLinesFromText(text string) []string
- func GetPathToFile(path string) string
- func GetSpecDirs() []string
- func IsConcept(path string) bool
- func IsDir(path string) bool
- func IsGaugeFile(path string) bool
- func IsProcessRunning(pid int) bool
- func IsSpec(path string) bool
- func IsValidConceptExtension(path string) bool
- func IsValidSpecExtension(path string) bool
- func IsWindows() bool
- func ListContains(list []string, val string) bool
- func NumberOfCores() int
- func OpenFile(fileName string) (io.Writer, error)
- func RLimit() (int, error)
- func RelPathToProjectRoot(path string) string
- func Remove(dir string)
- func RemoveTempDir()
- func SaveFile(fileName string, content string, backup bool)
- func SetWorkingDir(workingDir string)
Constants ¶
const ( UnixSep = "/" WindowsSep = "\\" )
Variables ¶
var FindSpecFilesIn = func(dir string) []string { return findFilesIn(dir, IsValidSpecExtension, func(path string, f os.FileInfo) bool { return false }) }
FindSpecFilesIn Finds spec files in the given directory
var GetConceptFiles = func() []string { projRoot := config.ProjectRoot if projRoot == "" { logger.Fatalf(true, "Failed to get project root.") } absPath, err := filepath.Abs(projRoot) if err != nil { logger.Fatalf(true, "Error getting absolute path. %v", err) } files := FindConceptFilesIn(absPath) var specFromProperties = os.Getenv(env.SpecsDir) if specFromProperties == "" { return files } var specDirectories = strings.Split(specFromProperties, ",") for _, dir := range specDirectories { absSpecPath, err := filepath.Abs(strings.TrimSpace(dir)) if err != nil { logger.Fatalf(true, "Error getting absolute path. %v", err) } files = append(files, FindConceptFilesIn(absSpecPath)...) } return files }
GetConceptFiles returns the list of concept files present in the PROJECTROOT
var GetSpecFiles = func(paths []string) []string { var specFiles []string for _, path := range paths { if !common.FileExists(path) { exitWithMessage(fmt.Sprintf("Specs directory %s does not exists.", path)) } if common.DirExists(path) { specFilesInpath := FindSpecFilesIn(path) if len(specFilesInpath) < 1 { exitWithMessage(fmt.Sprintf("No specifications found in %s.", path)) } specFiles = append(specFiles, specFilesInpath...) } else if IsValidSpecExtension(path) { f, _ := filepath.Abs(path) specFiles = append(specFiles, f) } } return specFiles }
Functions ¶
func ConvertPathToURI ¶ added in v0.9.4
func ConvertPathToURI(path string) lsp.DocumentURI
ConvertPathToURI - converts OS specific file paths to file uri (eg: file://example.spec).
func ConvertURItoFilePath ¶ added in v0.9.4
func ConvertURItoFilePath(uri lsp.DocumentURI) string
ConvertURItoFilePath - converts file uri (eg: file://example.spec) to OS specific file paths.
func Download ¶ added in v0.3.2
Download fires a HTTP GET request to download a resource to target directory
func DownloadAndUnzip ¶ added in v0.3.0
DownloadAndUnzip downloads the zip file from given download link and unzips it. Returns the unzipped file path.
func FindAllNestedDirs ¶ added in v0.1.3
FindAllNestedDirs returns list of all nested directories in given path
func FindConceptFilesIn ¶
FindConceptFilesIn Finds the concept files in specified directory
func GaugeFileExtensions ¶ added in v0.9.8
func GaugeFileExtensions() []string
IsGaugeFile Returns true if spec file or concept file
func GetFileContents ¶ added in v1.0.1
func GetLineCount ¶ added in v0.9.8
GetLineCount give no of lines in given text
func GetLinesFromText ¶ added in v0.9.8
GetLinesFromText gets lines of a text in an array
func GetPathToFile ¶ added in v0.1.7
GetPathToFile returns the path to a given file from the Project root
func GetSpecDirs ¶ added in v0.9.8
func GetSpecDirs() []string
GetSpecDirs returns the specification directory. It checks whether the environment variable for gauge_specs_dir is set. It returns 'specs' otherwise
func IsGaugeFile ¶ added in v0.9.5
IsGaugeFile Returns true if spec file or concept file
func IsProcessRunning ¶ added in v0.3.2
IsProcessRunning checks if the process with the given process id is still running
func IsValidConceptExtension ¶
IsValidConceptExtension Checks if the path has a concept file extension
func IsValidSpecExtension ¶
IsValidSpecExtension Checks if the path has a spec file extension
func IsWindows ¶ added in v0.1.7
func IsWindows() bool
IsWindows returns if Gauge is running on Windows
func ListContains ¶ added in v0.9.8
func NumberOfCores ¶ added in v0.1.7
func NumberOfCores() int
NumberOfCores returns the number of CPU cores on the system
func RelPathToProjectRoot ¶ added in v0.5.0
func Remove ¶ added in v0.3.0
func Remove(dir string)
Remove removes all the files and directories recursively for the given path
func SetWorkingDir ¶ added in v0.4.0
func SetWorkingDir(workingDir string)
SetWorkingDir sets the current working directory to specified location
Types ¶
This section is empty.