ruby

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTestFile

func IsTestFile(filePath string) bool

IsTestFile reports whether the given Ruby path is a test/spec file.

func ParseRubyConstantReferences

func ParseRubyConstantReferences(sourceCode []byte) []string

ParseRubyConstantReferences extracts qualified constant references from Ruby source. Examples: ActiveSupport::Cache::Coder, ::JSON::ParserError.

func ResolveRubyConstantReferencePath

func ResolveRubyConstantReferencePath(ref string, suppliedFiles map[string]bool) []string

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.

func ResolveRubyProjectImports

func ResolveRubyProjectImports(
	absPath string,
	filePath string,
	suppliedFiles map[string]bool,
	contentReader vcs.ContentReader,
) ([]string, error)

Types

type Module

type Module struct{}

func (Module) Extensions

func (Module) Extensions() []string

func (Module) IsTestFile

func (Module) IsTestFile(filePath string, _ vcs.ContentReader) bool

func (Module) Maturity

func (Module) Maturity() moduleapi.MaturityLevel

func (Module) Name

func (Module) Name() string

func (Module) NewResolver

func (Module) NewResolver(ctx *moduleapi.Context, contentReader vcs.ContentReader) moduleapi.Resolver

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

Jump to

Keyboard shortcuts

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