license_auto(v0.1.1.2)

Progress Code Climate Build Status

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/ 50
Java Gradle, Maven build.gradle, pom.xml https://repo1.maven.org/maven2 0
NodeJS npm package.json http://registry.npmjs.org 0
Debian dpkg -l https://launchpad.net/ 0
Golang go list -json ./... 0
Python pip requirements.txt https://pypi.python.org/pypi 0
Erlang rebar rebar.config 0

Requirements

  • 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
  • npm v3.3.12
  • Python pip v1.5.6
  • go v1.4.2

Install

gem install license_auto

Configure

sudo cp license_auto/config/sample.config.yml etc/license_auto.conf.yml
cp license_auto/config/gitconfig ~/.gitconfig

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
  • Speed up License name recognizing.
  • Groovy gradle
  • CMake
  • Fork Github official licenses text sample