Documentation
¶
Index ¶
- func IsTestFile(filePath string) bool
- func ParseRubyConstantReferences(sourceCode []byte) []string
- func ResolveRubyConstantReferencePath(ref string, suppliedFiles map[string]bool) []string
- func ResolveRubyImportPath(sourceFile string, imp RubyImport, suppliedFiles map[string]bool) []string
- func ResolveRubyProjectImports(absPath string, filePath string, suppliedFiles map[string]bool, ...) ([]string, error)
- type Provider
- type RubyImport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTestFile ¶
IsTestFile reports whether the given Ruby path is a test/spec file.
func ParseRubyConstantReferences ¶
ParseRubyConstantReferences extracts qualified constant references from Ruby source. Examples: ActiveSupport::Cache::Coder, ::JSON::ParserError.
func ResolveRubyConstantReferencePath ¶
ResolveRubyConstantReferencePath maps a qualified constant reference to a concrete file path. Returns no paths when resolution is ambiguous.
func ResolveRubyImportPath ¶
func ResolveRubyImportPath(sourceFile string, imp RubyImport, suppliedFiles map[string]bool) []string
ResolveRubyImportPath resolves a Ruby require path to possible file paths.
Types ¶
type Provider ¶ added in v0.27.0
type Provider struct{}
func (Provider) Extensions ¶ added in v0.27.0
func (Provider) IsTestFile ¶ added in v0.27.0
func (Provider) IsTestFile(filePath string, _ vcs.ContentReader) bool
func (Provider) Maturity ¶ added in v0.27.0
func (Provider) Maturity() moduleapi.MaturityLevel
func (Provider) NewResolver ¶ added in v0.27.0
type RubyImport ¶
type RubyImport struct {
// contains filtered or unexported fields
}
RubyImport represents a require/require_relative in a Ruby file.
func ParseRubyImports ¶
func ParseRubyImports(sourceCode []byte) ([]RubyImport, error)
ParseRubyImports parses Ruby source code and extracts require directives.
func RubyImports ¶
func RubyImports(filePath string) ([]RubyImport, error)
RubyImports parses a Ruby file and returns its imports.
func (RubyImport) IsRelative ¶
func (i RubyImport) IsRelative() bool
func (RubyImport) Path ¶
func (i RubyImport) Path() string
Click to show internal directories.
Click to hide internal directories.