license_auto
license_auto is a Ruby Gem for Open Source License collection job inspired by LicenseFinder
Dependencies Management Detecting Implement Details
Language | DepsMgmt Program | Dependencies file | Default project servers | Progress(%) |
---|---|---|---|---|
Ruby | bundler | Gemfile(.lock) | https://rubygems.org/ | 70 |
Java | Gradle, Maven | build.gradle, pom.xml | https://repo1.maven.org/maven2 | 100 |
NodeJS | npm | package.json | http://registry.npmjs.org | 100 |
Debian | dpkg -l | https://launchpad.net/ | 0 | |
Golang | go list -json ./... | 50 | ||
Python | pip | requirements.txt | https://pypi.python.org/pypi | 0 |
Erlang | rebar | rebar.config | 0 | |
BowerJS | bower | bower.json | 50 |
Requirements
- OS: Ubuntu-16.04
- HTTP Network(WiFi on)
- HTTP proxy to Google.com is a plus
- Ruby v2.2.x
- bundler v1.10.x
- Gradle v2.9
- Maven v3.x
- Rebar v2.6.1
- NodeJS v5.7.0+
- npm v3.6.0
- Python pip v1.5.6
- golang v1.6
Install
gem install license_auto
Configure
sudo cp license_auto/config/sample.config.yml /etc/license_auto.conf.yml
git config --global git-credential
Examples
- Get dependencies of a repository
require 'license_auto'
my_repo = {
"clone_url": "https://github.com/mineworks/license_auto.git",
"ref": "test-branch"
}
repo = LicenseAuto::Repo.new(my_repo)
dependencies = repo.find_dependencies
- Get License Info of a package
require 'license_auto'
my_pack = {
language: 'Ruby', # Ruby|Golang|Java|NodeJS|Erlang|Python|
name: 'bundler',
group: 'com.google.http-client', # Optional: Assign nil if your package is not a Java
version: '1.11.2', # Optional: Assign nil if check the latest
server: 'rubygems.org' # Optional: github.com|rubygems.org|pypi.python.org/pypi|registry.npmjs.org
}
package = LicenseAuto::Package.new(my_pack)
license_info = package.get_license_info()
puts license_info.licenses
# => #<Hashie::Mash _links=#<Hashie::Mash git="https://api.github.com/repos/bundler/bundler/git/blobs/e356f59f949264bff1600af3476d5e37147957cc" html="https://github.com/bundler/bundler/blob/v1.11.2/LICENSE.md" self="https://api.github.com/repos/bundler/bundler/contents/LICENSE.md?ref=v1.11.2"> download_url="https://raw.githubusercontent.com/bundler/bundler/v1.11.2/LICENSE.md" git_url="https://api.github.com/repos/bundler/bundler/git/blobs/e356f59f949264bff1600af3476d5e37147957cc" html_url="https://github.com/bundler/bundler/blob/v1.11.2/LICENSE.md" name="LICENSE.md" path="LICENSE.md" sha="e356f59f949264bff1600af3476d5e37147957cc" size=1118 type="file" url="https://api.github.com/repos/bundler/bundler/contents/LICENSE.md?ref=v1.11.2">
Test
rake spec
TODO
- Check My
Gemfile
licensing for legal issues safe - Groovy gradle: optional
CMake- Fork Github official licenses text sample or SPDX template