Documentation
¶
Index ¶
- func DetectFramework(gf *Gemfile) (framework string, version string)
- func ExtractBundleVersion(path string) string
- func ExtractRubyVersion(path string) string
- func GetReverseDependencies(gemName string, gemfile *Gemfile) []string
- type AnalysisResult
- type DependencyInfo
- type DependencyNode
- type DependencyResult
- type Gem
- type GemStatus
- type Gemfile
- type OutdatedChecker
- type RubygemeInfo
- type Vulnerability
- type VulnerabilityChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectFramework ¶ added in v1.0.6
DetectFramework detects the primary framework (Rails, Sinatra, etc.) from installed gems
func ExtractBundleVersion ¶ added in v1.0.6
ExtractBundleVersion extracts the Bundle version from Gemfile.lock
func ExtractRubyVersion ¶ added in v1.0.6
ExtractRubyVersion extracts the Ruby version from Gemfile.lock
func GetReverseDependencies ¶
GetReverseDependencies returns a list of gems that depend on the given gem This is useful for local calculations without needing to rebuild the tree
Types ¶
type AnalysisResult ¶
type AnalysisResult struct {
TotalGems int
OutdatedGems []string
VulnerableGems []string
FirstLevelGems []string // Names of directly installed gems (from Gemfile, not transitive)
AllGems []*Gem
GemStatuses []*GemStatus
Summary string
Details string
}
func Analyze ¶
func Analyze(gemfile *Gemfile) *AnalysisResult
type DependencyInfo ¶
type DependencyInfo struct {
GemName string
Version string
ForwardDeps []string // What this gem depends on
ReverseDeps []string // What depends on this gem
ForwardDepsCount int
ReverseDepsCount int
// Tree structures
ForwardTree *DependencyNode // Tree of what this gem depends on
ReverseTree *DependencyNode // Tree of what depends on this gem
}
type DependencyNode ¶
type DependencyNode struct {
Name string
Version string
Children []*DependencyNode
Depth int
}
type DependencyResult ¶
type DependencyResult struct {
SelectedGem string
DependencyInfo *DependencyInfo
AllGems map[string]*Gem // For version lookups
}
func AnalyzeDependencies ¶
func AnalyzeDependencies(gemfile *Gemfile, selectedGemName string) *DependencyResult
AnalyzeDependencies analyzes dependencies for a selected gem
type GemStatus ¶
type GemStatus struct {
Name string
Version string
Groups []string // e.g., "default", "development", "test"
IsOutdated bool
LatestVersion string // Latest available version
IsVulnerable bool
VulnerabilityInfo string // Detailed vulnerability info
HomepageURL string // Homepage or source code URL
Description string // Gem description from rubygems.org
}
GemStatus represents the status information for a gem
type Gemfile ¶
func (*Gemfile) GetGemCount ¶
func (*Gemfile) GetGemsAsList ¶
func (*Gemfile) LoadGroupsFromGemfile ¶
LoadGroupsFromGemfile parses the Gemfile to extract group information It updates the gems map with group information
type OutdatedChecker ¶
type OutdatedChecker struct {
// contains filtered or unexported fields
}
OutdatedChecker checks if gems are outdated by querying rubygems.org
func NewOutdatedChecker ¶
func NewOutdatedChecker() *OutdatedChecker
NewOutdatedChecker creates a new checker with HTTP client
func (*OutdatedChecker) GetDescription ¶
func (oc *OutdatedChecker) GetDescription(gemName string) string
GetDescription returns the description for a gem, using cached data or fetching if needed
func (*OutdatedChecker) GetHomepage ¶
func (oc *OutdatedChecker) GetHomepage(gemName string) string
GetHomepage returns the homepage URL for a gem, using cached data or fetching if needed
func (*OutdatedChecker) IsOutdated ¶
func (oc *OutdatedChecker) IsOutdated(gemName, currentVersion string) (bool, string)
IsOutdated checks if a gem version is outdated and returns the latest version
type RubygemeInfo ¶
type RubygemeInfo struct {
Version string `json:"version"`
HomepageURI string `json:"homepage_uri"`
SourceCodeURI string `json:"source_code_uri"`
Info string `json:"info"`
}
RubygemeInfo represents gem data from rubygems.org API
type Vulnerability ¶
type Vulnerability struct {
GemName string
AffectedVersions []string // e.g., "< 6.1.4", ">= 6.0.0, < 6.0.5"
Description string
CVE string
}
Vulnerability represents a known vulnerability
type VulnerabilityChecker ¶
type VulnerabilityChecker struct {
// contains filtered or unexported fields
}
VulnerabilityChecker checks if gems have known vulnerabilities
func NewVulnerabilityChecker ¶
func NewVulnerabilityChecker() *VulnerabilityChecker
NewVulnerabilityChecker creates a new checker with known vulnerabilities
func (*VulnerabilityChecker) HasVulnerability ¶
func (vc *VulnerabilityChecker) HasVulnerability(gemName, version string) (bool, string, string)
HasVulnerability checks if a gem has known vulnerabilities Returns (hasVulnerability, cveID, description)