ruby

package
v0.0.0-...-9c274a4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 10 Imported by: 0

README

Ruby (Bundler) license analyzer

Will run for the local repository source given. Uses ruby and bundler as a dependency.

Detect

Checks if there is a Gemfile in the repository, will mean detected if found any.

Analyze

Collects all Gemfile.lock files in the repository (outside of a vendor directory). Uses the bundler lockfile parser from a ruby script to get a list of dependencies. It assumes all dependencies are from rubygems.org. Queries the rubygem API (https://rubygems.org/api/v1/versions/[depname].json" and gets the licenses key of the first element (latest version) of the returned array.

One package can be made available under multiple licenses. Meaning we, the user can choose the less restrictive of the licenses e.g. MIT instead of GPL.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGemDeps

func GetGemDeps(repoPath string) ([]string, map[string][]string, error)

GetGemDeps ...

Types

type Analyzer

type Analyzer struct {
	// contains filtered or unexported fields
}

func (*Analyzer) AnalyzeRepository

func (a *Analyzer) AnalyzeRepository() (analyzers.RepositoryLicenseInfos, error)

func (*Analyzer) Detect

func (a *Analyzer) Detect(repoURL, localSourcePath string) (bool, error)

func (Analyzer) String

func (a Analyzer) String() string

Jump to

Keyboard shortcuts

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