Giter Site home page Giter Site logo

pivotal / licensefinder Goto Github PK

View Code? Open in Web Editor NEW
1.7K 51.0 333.0 5.69 MB

Find licenses for your project's dependencies.

License: MIT License

Shell 0.64% Ruby 95.42% Python 0.14% Erlang 0.02% HTML 1.55% Go 0.06% PowerShell 0.29% Elixir 0.60% Scala 0.04% Dockerfile 1.12% Makefile 0.03% Swift 0.08%
ruby

licensefinder's Issues

Error when running in node.js project: undefined method `downcase' for ["type", "BSD"]:Array (NoMethodError)

Getting the following error when running license_finder in a node project with ruby-1.9.3-p392 or ruby-2.1.2p95

/Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license.rb:42:in `map': undefined method `downcase' for ["type", "BSD"]:Array (NoMethodError)
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license.rb:42:in `matches_name?'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `block in whitelist_if_necessary'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `each'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `any?'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:35:in `whitelist_if_necessary'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license/definitions.rb:29:in `build_unrecognized'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/license.rb:10:in `find_by_name'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:46:in `block in licenses_from_spec'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:45:in `map'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:45:in `licenses_from_spec'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:27:in `determine_license'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package.rb:21:in `license'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:28:in `save'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:12:in `block in save_all'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:11:in `map'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/package_saver.rb:11:in `save_all'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:7:in `block in sync_with_package_managers'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:38:in `block in modifying'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/transactions.rb:126:in `_transaction'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/transactions.rb:100:in `block in transaction'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/connecting.rb:229:in `block in synchronize'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/connection_pool/threaded.rb:104:in `hold'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/connecting.rb:229:in `synchronize'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/sequel-4.12.0/lib/sequel/database/transactions.rb:89:in `transaction'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:38:in `modifying'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/dependency_manager.rb:6:in `sync_with_package_managers'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:17:in `block (2 levels) in sync_with_spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:42:in `spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:16:in `block in sync_with_spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:23:in `die_on_error'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:15:in `sync_with_spinner'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/lib/license_finder/cli.rb:220:in `rescan'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/gems/license_finder-1.1.0/bin/license_finder:5:in `<top (required)>'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/license_finder:19:in `load'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/license_finder:19:in `<main>'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/ruby_executable_hooks:15:in `eval'
    from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392/bin/ruby_executable_hooks:15:in `<main>'

The package.json looks like this:

{
  "name": "junglebear",
  "version": "0.0.0",
  "repository": {
    "type": "git",
    "url": "AWESOME_CODE"
  },
  "dependencies": {},
  "devDependencies": {
    "buffer-crc32": "^0.2.1",
    "connect": "^3.0.1",
    "formidable": "^1.0.14",
    "grunt": "~0.4.1",
    "grunt-autoprefixer": "~0.2.0",
    "grunt-bower-install": "~0.5.0",
    "grunt-concurrent": "~0.3.0",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-coffee": "~0.7.0",
    "grunt-contrib-compass": "~0.5.0",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-connect": "~0.5.0",
    "grunt-contrib-copy": "~0.4.1",
    "grunt-contrib-cssmin": "~0.6.0",
    "grunt-contrib-htmlmin": "~0.1.3",
    "grunt-contrib-imagemin": "~0.2.0",
    "grunt-contrib-jshint": "~0.6.3",
    "grunt-contrib-uglify": "~0.2.0",
    "grunt-contrib-watch": "~0.5.2",
    "grunt-karma": "~0.7.1",
    "grunt-mocha": "~0.4.0",
    "grunt-phonegap": "~0.6.2",
    "grunt-rev": "~0.1.0",
    "grunt-svgmin": "~0.2.0",
    "grunt-usemin": "~0.1.10",
    "load-grunt-tasks": "~0.1.0",
    "send": "^0.1.1",
    "time-grunt": "~0.1.1"
  },
  "engines": {
    "node": ">=0.8.0"
  }
}

Outdated README

As I can see there are no more license_finder help or license_finder approve commands.
They are available on -h and -a command line options.
Readme still displays commands

Readme is out of date

It references license_finder license but license_finder --help shows license_finder -l

Wrong license for ansi

LicenseFinder detects a GPLv2 license for the ansi gem. The only mention of GPL I found is in the NOTICE.md file, while README.md, LICENSE.txt and also NOTICE.md all specify the FreeBSD license for the gem.

Recommended way to include in CI/rake?

This would be great to include in my CI environment, but I note that the old tasks mentioned in #3 and #9 have gone away, and that the one remaining rake task is deprecated. Is there a recommended way to include license_finder in a CI build?

No such file or directory - git ls-files in Cucumber Spec with LicenseFinder

When I've included license_finder in my development group

    group :development do
      gem 'license_finder', :git => "https://github.com/pivotal/LicenseFinder.git"
      gem 'pivotal_git_scripts'
    end

And I run a plain cucumber spec in RubyMine I get this output:

Testing started at 12:02 PM ...
/Users/pivotal/.rvm/gems/ruby-1.9.2-p180@sumuru/bundler/gems/LicenseFinder-7fd224f264a1/license_finder.gemspec:19:in ``': No such file or directory - git ls-files (Errno::ENOENT)
    from /Users/pivotal/.rvm/gems/ruby-1.9.2-p180@sumuru/bundler/gems/LicenseFinder-7fd224f264a1/license_finder.gemspec:19:in `block in <main>'
    from /Users/pivotal/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:349:in `initialize'

When I remove license finder, everything works appropriately.

manually approving rdoc fails

When trying to approve rdoc manually it fails with the below error.

± ga+dlb |master ✗| → license_finder -a rdoc

/Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/gems/license_finder-0.8.1/lib/license_finder/tables/dependency.rb:18:in approve!': undefined methodstate=' for nil:NilClass (NoMethodError)
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/gems/license_finder-0.8.1/lib/license_finder/cli.rb:33:in execute!' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/gems/license_finder-0.8.1/bin/license_finder:64:inblock in <top (required)>'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/gems/license_finder-0.8.1/bin/license_finder:17:in run' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/gems/license_finder-0.8.1/bin/license_finder:63:in<top (required)>'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/bin/license_finder:19:in load' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/bin/license_finder:19:in

'
from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/bin/ruby_noexec_wrapper:14:in eval' from /Users/pivotal/.rvm/gems/ruby-1.9.3-p392@push/bin/ruby_noexec_wrapper:14:in'

Version 1.0.1 can't be installed on jRuby

Everything work great on MRI, but bundle update license_finder on jRuby ends up with something like this:

...
Installing sqlite3 (1.3.9)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/mekssart/.rvm/rubies/jruby-1.7.11/bin/jruby extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.

   (root) at /Users/mekssart/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/mkmf.rb:8
  require at org/jruby/RubyKernel.java:1085
   (root) at /Users/mekssart/.rvm/rubies/jruby-1.7.11/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
   (root) at extconf.rb:3

extconf failed, uncaught signal 1

Gem files will remain installed in /Users/mekssart/.rvm/gems/jruby-1.7.11@mytime2/gems/sqlite3-1.3.9 for inspection.
Results logged to /Users/mekssart/.rvm/gems/jruby-1.7.11@mytime2/extensions/universal-java-1.7/1.9/sqlite3-1.3.9/gem_make.out

An error occurred while installing sqlite3 (1.3.9), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.9'` succeeds before bundling.

It seems that you forgot to release jRuby version to ruby gems, so it should install jdbc-sqlite3 instead as a dependency in this step. Could you please release it?

license_finder 0.8.2 and later all fail with '`<class:Dependencies>': undefined method `option' for LicenseFinder::CLI::Dependencies:Class (NoMethodError)'

Ruby 1.9.2-p290
Rails 3.0.20

Upgrading license_finder to 0.8.2 or any later version results in the error:

<class:Dependencies>': undefined methodoption' for LicenseFinder::CLI::Dependencies:Class (NoMethodError)

being thrown when running

license_finder

Apparently, it is failing on this line in cli.rb (next line after the class Dependencies < Base line):

option :approve, type: :boolean, aliases: :a

Not sure what's going on here - I can't tell where the class level "option" method is defined. I thought perhaps this was a Ruby version issue, but couldn't verify it.

LicenseFinder dependency on bundler creates unexpected diffs

LicenseFinder itself has a dependency on Bundler, which it is then tracking as a project dependency. Because the bundler version is not specified in the gem, we get diffs with different bundler versions on different machines. Arguably bundler is a tool, not a dependency, so it should not be in the LicenseFinder gemspec.

Doesn't work under Ruby 2.0.0

When we run license finder under Ruby 2.0.0, we get the following error:

/Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/bundled_gem_saver.rb:3:in <class:BundledGemSaver>': uninitialized constant LicenseFinder::BundledGemSaver::Forwardable (NameError) from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/bundled_gem_saver.rb:2:inmodule:LicenseFinder'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/bundled_gem_saver.rb:1:in <top (required)>' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/dependency_manager.rb:7:inblock in sync_with_bundler'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/dependency_manager.rb:39:in modifying' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/dependency_manager.rb:6:insync_with_bundler'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/cli.rb:153:in block (2 levels) in rescan' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/cli.rb:218:inspinner'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/cli.rb:152:in block in rescan' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/cli.rb:15:indie_on_error'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/lib/license_finder/cli.rb:151:in rescan' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/thor-0.18.1/lib/thor/command.rb:27:inrun'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in invoke_command' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/thor-0.18.1/lib/thor.rb:363:indispatch'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/thor-0.18.1/lib/thor/base.rb:439:in start' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.9.1/bin/license_finder:5:in<top (required)>'
from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/bin/license_finder:23:in load' from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/bin/license_finder:23:in

'

could use an option to remove the spinner for license finder

The spinner creates some really interesting log files on jenkins. Our last run generated about 50MB of this:

 ------ \ ----------
 ---------- | ----------
 ---------- / ----------
 ---------- - ----------
 ---------- \ ----------
 ---------- | ----------
...

`license_finder -a json` raises an exception

dickinson:NYCVotes (master) dg gh$ license_finder

Dependencies that need approval:
json, 1.7.7, other
pg, 0.15.0, BSD
rails, 3.2.13, other
rdoc, 3.12.2, other
thin, 1.5.1, Ruby
dickinson:NYCVotes (master) dg gh$ license_finder -a json

/Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.8.1/lib/license_finder/tables/dependency.rb:18:in `approve!': undefined method `state=' for nil:NilClass (NoMethodError)
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.8.1/lib/license_finder/cli.rb:33:in `execute!'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.8.1/bin/license_finder:64:in `block in <top (required)>'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.8.1/bin/license_finder:17:in `run'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/gems/license_finder-0.8.1/bin/license_finder:63:in `<top (required)>'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/bin/license_finder:23:in `load'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/bin/license_finder:23:in `<main>'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/pivotal/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

The definition of irony

LicenseFinder 0.8.1 depends on the sqlite3 gem, which has a license type of "other," so it needs approval.

Support node dependency groups

Currently LicenseFinder is punting on the existence of npm dependency groups (e.g. "dependencies" vs "devDependencies"). It would be great to be able to exclude npm devDependencies the same way you can exclude bundler groups.

cc @nertzy

Javascript dependencies

Before the introduction of sqlite, I could add javascript dependencies to the yml file and track them as well. When I pulled the new version, all those dependencies are gone now, and I don't see how I could add them again.

Add rake task that can be used on CI

As a developer
I want to be able to add a rake task to my CI build that will fail if there are license action items to address
So that I don't inadvertently add a dependency to my app that the client doesn't want

One option would be to add a new rake task like so:

namespace :license do
  desc 'checks whether there are action items and returns a 0 or a 1 - useful for ci'
  task :check => :generate_dependencies do
    action_items = LicenseFinder::Finder.new.action_items
    if action_items.present?
      puts "License action items:", action_items
      exit -1
    else
      exit 0
    end
  end
end

The other option would be to update the license:actions task to exit with a non-zero return code if there are any actions to take.

Charles LeRose and Jeff Dean

License files and readme files should not use absolute paths

We're working on a project where not all developers are on Pivotal machines. Because of the different usernames, our dependency files continue changing every time a new machine runs specs, because we get changes between lines like these:

license_files:
  - /Users/pivotal/.rvm/gems/ruby-1.9.3-p194@project/gems/rake-0.9.2.2/MIT-LICENSE

license_files:
  - /Users/johndoe/.rvm/gems/ruby-1.9.3-p194@project/gems/rake-0.9.2.2/MIT-LICENSE

Ideally we could pass an option to LicenseFinder to use relative paths from the home directory, or from the gem path.

Several MIT-licensed libraries are "other"

Using the 1.0.0.0 Ruby release, I've noticed that several libraries which have licenses defined in their gemspecs do not get their license properly recognized by license_finder. This occurs with an empty dependencies.db (new project). It has occurred both locally and on Travis CI.

Surprisingly, license_finder is one of the unrecognized offenders; along with minitest, addressable, json, and sqlite3.

licenses in node.js aren't discovered for children of project dependencies.

This is easiest to describe with an example.
Assume A1 is dependent on L1 as described in A1's package.json.
Also, L1 is dependent on L2 as described in L1's package.json.

license_finder will only discover the license for L1 and NOT for L2.
What's required to fix this? It would seem that anybody using license_finder will care not only about the direct dependencies but also the indirect ones through the dependent packages.

Wrong license for pg?

license_finder shows a BSD license (4-clause) for pg, while looking at the project itself I think it should be ruby or SimplifiedBSD (2-clause).

Also: How about multi-license models? The Ruby license actually gives you the choice between 2-clause BSD (or GPLv2 in older versions) and its custom license text.

Downgrading from master branch to released (0.8.1) version of license_finder causes failure

In an attempt to verify the issue in #27 I updated my Gemfile to use master branch HEAD. When this failed, I then attempted to downgrade back to the released version of license_finder (0.8.1), and now I get this error:

$ license_finder
/Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/sequel-3.48.0/lib/sequel/extensions/migration.rb:678:in get_applied_migrations': Applied migration files not in file system: 201304181524_add_manual_to_dependencies.rb (Sequel::Migrator::Error) from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/sequel-3.48.0/lib/sequel/extensions/migration.rb:634:ininitialize'
from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/sequel-3.48.0/lib/sequel/extensions/migration.rb:390:in new' from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/sequel-3.48.0/lib/sequel/extensions/migration.rb:390:inrun'
from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/license_finder-0.8.1/lib/license_finder/tables.rb:7:in <top (required)>' from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/license_finder-0.8.1/lib/license_finder.rb:45:inrequire'
from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/license_finder-0.8.1/lib/license_finder.rb:45:in <top (required)>' from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/license_finder-0.8.1/bin/license_finder:3:inrequire'
from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/gems/license_finder-0.8.1/bin/license_finder:3:in <top (required)>' from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/bin/license_finder:19:inload'
from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/bin/license_finder:19:in <main>' from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/bin/ruby_noexec_wrapper:14:ineval'
from /Users/weyus/.rvm/gems/ruby-1.9.2-p290@redflag/bin/ruby_noexec_wrapper:14:in `

'

Even if I uninstall license_finder and reinstall using 'bundle install', I get this.

Timestamp only when dependencies change

In certain projects it's necessary to check in doc/dependencies.*, and we want developers running license_finder frequently. We'd prefer if the timestamps in dependencies.html/md/etc only changed when the dependencies changed, or at least if there were an option to enable this behavior.

Also, you may want to consider using an ISO timestamp. Otherwise the timestamp will thrash depending on the timezone setting of the machine on which license_finder runs.

Example diff:

diff --git a/doc/dependencies.html b/doc/dependencies.html
index cc48bab..f4207c9 100644
--- a/doc/dependencies.html
+++ b/doc/dependencies.html
@@ -29,7 +29,7 @@
       <div class="span5">
         <h2>Dependencies</h2>

-        <p>As of September 22, 2014  6:28pm</p>
+        <p>As of September 22, 2014  6:57pm</p>

         <h4>12 total</h4>

diff --git a/doc/dependencies.md b/doc/dependencies.md
index 85f6e0a..a44df6d 100644
--- a/doc/dependencies.md
+++ b/doc/dependencies.md
@@ -1,6 +1,6 @@
 # Node Gemfire

-As of September 22, 2014  6:28pm. 12 total
+As of September 22, 2014  6:57pm. 12 total

 ## Summary
 * 10 MIT

cc @nertzy

List Project URL

This gem creates a CSV file that lists the Name, Version, License

Is there a way to add a 4th value as "URL" and fill with the appropriate URL. For example, gems would list the Homepage and for node modules the Repository?

Thanks

Does not work on 1.8

if that's intentional, fix it, otherwise document in gemspec with ruby_version >= 1.9.3

license_finder
/opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:711:in `load': /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/license_finder-0.9.3/db/migrate/201303290935_create_dependencies.rb:7: syntax error, unexpected ':', expecting kEND (SyntaxError)
      String :name, null: false
                         ^
/opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/license_finder-0.9.3/db/migrate/201303290935_create_dependencies.rb:8: syntax error, unexpected ':', expecting kEND
      String :version, null: false
                            ^
    from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:711:in `get_migration_tuples'
    from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:697:in `each'

NPM License Finder Error - undefined method `fetch'

Here is the full error log:

/Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/npm.rb:21:in `block in current_modules': undefined method `fetch' for "1.8.1":String (NoMethodError)
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/npm.rb:19:in `map'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/npm.rb:19:in `current_modules'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/dependency_manager.rb:18:in `block in sync_with_bundler'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/dependency_manager.rb:56:in `modifying'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/dependency_manager.rb:6:in `sync_with_bundler'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/cli.rb:157:in `block (2 levels) in rescan'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/cli.rb:222:in `spinner'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/cli.rb:156:in `block in rescan'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/cli.rb:15:in `die_on_error'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/lib/license_finder/cli.rb:155:in `rescan'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/gems/license_finder-0.9.4/bin/license_finder:5:in `<top (required)>'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/bin/license_finder:23:in `load'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/bin/license_finder:23:in `<main>'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
    from /Users/brettchalupa/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'

Here is the package.json:

{
  "name": "supermarket",
  "devDependencies": {
    "chai": "1.8.1",
    "karma": "0.10.2",
    "karma-mocha": "0.1.0",
    "karma-osx-reporter": "0.0.3",
    "karma-spec-reporter": "0.0.6",
    "mocha": "1.13.0",
    "sprockets-chain": "0.0.9"
  }
}

It looks like fetch is not working for the NPM dependencies specified in the package.json. Am I doing something wrong? Thanks a lot!

edit: Is there a way to ignore NPM license finding?

edit2: Some more information:

  • Ruby 2.0.0
  • Rails 4.0.x
  • NPM 1.3.21
  • On OS X 10.9

Do not execute in the context of the current repositories bundle

atm license finder loads the bundle of the repo it is in, which means loading older versions of json/bundler etc, that might conflict with the currently activated version / might not be installed on the system ('bundle --path vendor/bundle').

I'm hacking the GEM_PATH AS workaround but it's pretty ugly, so ideally the bundle inspector should just shell out to bundle exec ruby -e something and parse the result (Marshal dump + load ?) and then construct it's dependency graph from this list.

Error using -a under 1.8 (ree)

bundle exec license_finder -a acts_as_list

The acts_as_list has been approved!

/home/user/.rvm/gems/ree-1.8.7-2012.02@project/bundler/gems/LicenseFinder-8c1c23df95b9/bin/license_finder:12:in run': private methodclass_variable_get' called for LicenseFinder::CLI:Module (NoMethodError)

near "DEFAULT": syntax error by running license_finder

By running license_finder

Error is raised in:

license_finder-0.9.3/lib/license_finder/tables/dependency.rb:53:in `ensure_approval_exists!'

When I change

self.approval = Approval.create

to

app = Approval.new
app.id = nil
app.save
self.approval = app

then there is no error

I am using 3.8.1 sqllite3

handling of multiple licenses could use better documentation

License Finder detects dependencies that have multiple licenses, but it doesn't treat them as approved if one of the licenses is whitelisted. License Finder seems to be taking a conservative approach, but the README isn't making it clear what users should do in this case. If the expectation is that dual-licensed dependencies must always be manually approved, this could be made clearer.

For example: Our Gemfile includes newrelic_rpm, which is triple-licensed under the New Relic, MIT, and Ruby licenses. Our whitelist includes MIT and Ruby, but the newrelic_rpm gem still gets flagged as needing approval.

→ license_finder

Ignored Dependencies:
(none)
Dependencies that need approval:
newrelic_rpm, 3.8.1.221, multiple licenses: New Relic, MIT, ruby
license_finder.yml

---
whitelist:
- MIT
- ruby
- Apache 2.0
- Apache 1.1
- NewBSD

Does not work with LICENSE as a directory

havemeyer:~/workspace/abc (master)$ rake license:generate_dependencies
rake aborted!
Is a directory - /Users/pivotal/.rvm/gems/ruby-1.9.2-p180@abc/gems/ansi-1.3.0/LICENSE

Tasks: TOP => license:generate_dependencies
(See full trace by running task with --trace)
havemeyer:~/workspace/abc (master)$ ls -la /Users/pivotal/.rvm/gems/ruby-1.9.2-p180@abc/gems/ansi-1.3.0/LICENSE
total 64
drwxr-xr-x 6 pivotal staff 204 Aug 22 10:39 .
drwxr-xr-x 10 pivotal staff 340 Aug 22 10:39 ..
-rw-r--r-- 1 pivotal staff 1475 Aug 22 10:39 BSD-2-Clause.txt
-rw-r--r-- 1 pivotal staff 18091 Aug 22 10:39 GPL-2.0.txt
-rw-r--r-- 1 pivotal staff 1037 Aug 22 10:39 MIT.txt
-rw-r--r-- 1 pivotal staff 2580 Aug 22 10:39 RUBY.txt

Broken build due to missing Gemfile.lock

Since there is no Gemfile.lock, gems are whatever is newest when the person pulls down the repo. I'm not sure what the motivation was for this, but the current behavior is that the build is actually broken and Travis isn't saying anything until the next time someone pushes.

Line 21 in spec_helper.rb

/Users/jboyens/.rvm/gems/ruby-1.9.3-p194@LicenseFinder/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in initialize': SQLite3::SQLException: near "ancestries": syntax error (Sequel::DatabaseError)`

Failure on initial run

$ gem install license_finder
Fetching: sequel-4.0.0.gem (100%)
Successfully installed sequel-4.0.0
Fetching: license_finder-0.8.2.gem (100%)
Successfully installed license_finder-0.8.2
2 gems installed
$ rbenv rehash
$ license_finder 
/Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/license_finder-0.8.2/lib/license_finder/configuration.rb:15:in `make_config_file': uninitialized constant LicenseFinder::Configuration::FileUtils (NameError)
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/license_finder-0.8.2/lib/license_finder/configuration.rb:10:in `ensure_default'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/license_finder-0.8.2/lib/license_finder.rb:34:in `config'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/license_finder-0.8.2/lib/license_finder/tables.rb:5:in `<top (required)>'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/license_finder-0.8.2/lib/license_finder.rb:43:in `<top (required)>'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/license_finder-0.8.2/bin/license_finder:3:in `<top (required)>'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/bin/license_finder:23:in `load'
    from /Users/mrm/.rbenv/versions/2.0.0-p195/bin/license_finder:23:in `<main>'
$ rbenv local
2.0.0-p195

Same thing with 1.9.3, fwiw:

$ rbenv local 1.9.3-p429 
$ gem install license_finder
Fetching: sequel-4.0.0.gem (100%)hs
Successfully installed sequel-4.0.0
Fetching: license_finder-0.8.2.gem (100%)
Successfully installed license_finder-0.8.2
2 gems installed

$ rbenv rehash
$ license_finder 
/Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/license_finder-0.8.2/lib/license_finder/configuration.rb:15:in `make_config_file': uninitialized constant LicenseFinder::Configuration::FileUtils (NameError)
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/license_finder-0.8.2/lib/license_finder/configuration.rb:10:in `ensure_default'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/license_finder-0.8.2/lib/license_finder.rb:34:in `config'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/license_finder-0.8.2/lib/license_finder/tables.rb:5:in `<top (required)>'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/license_finder-0.8.2/lib/license_finder.rb:43:in `<top (required)>'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:58:in `require'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/license_finder-0.8.2/bin/license_finder:3:in `<top (required)>'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/bin/license_finder:23:in `load'
    from /Users/mrm/.rbenv/versions/1.9.3-p429/bin/license_finder:23:in `<main>'

Installation documentation is misleading

The installation documentation suggests that you add license_finder to your Gemfile. This is one way to install license_finder, but it's not ideal. gem install license_finder also works, and doesn't add license_finder (or its dependencies) as a project dependency. The only reason to have a production dependency on LF (and therefore to care about its license) is if you actually use its code somewhere in your own Ruby code.

The documentation should:

  • suggest gem install license_finder followed by license_finder, or
  • suggest adding license_finder as a "development" dependency, so it can be excluded from the dependency list with the "ignored_bundler_groups" configuration, or
  • both.

More generally, LF is no longer a Rails plugin. It is a command-line tool that happens to be written in Ruby. It interacts with Bundler, along with many other language's package managers. If it's being used on a Python project, there's no reason to suggest a Gemfile - gem install license_finder is more appropriate.

I'm bringing this up because there are regular github issues about license_finder's own license. That suggests people are tracking it (and worrying about it) when it's very unlikely they need to care.

Approving the sqlite3 gem causes an exception

When approving the new sqlite3 gem (now required by this library), an exception occurs:

$ license_finder

Dependencies that need approval:
sqlite3, 1.3.7, BSD3

$ license_finder -a sqlite3

/Users/name/.rvm/gems/ruby-1.9.3-p0@course/gems/license_finder-0.8.1/lib/license_finder/tables/dependency.rb:18:in `approve!': undefined method `state=' for nil:NilClass (NoMethodError)
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/gems/license_finder-0.8.1/lib/license_finder/cli.rb:33:in `execute!'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/gems/license_finder-0.8.1/bin/license_finder:64:in `block in <top (required)>'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/gems/license_finder-0.8.1/bin/license_finder:17:in `run'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/gems/license_finder-0.8.1/bin/license_finder:63:in `<top (required)>'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/bin/license_finder:23:in `load'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/bin/license_finder:23:in `<main>'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/name/.rvm/gems/ruby-1.9.3-p0@course/bin/ruby_noexec_wrapper:14:in `<main>'

migrate/201303290935_create_dependencies.rb:7: syntax error

Hi,
with rails 3.2.13, ruby 1.8.7, sequel 4.5.0, licence_finder 0.9.3
when executing license_finder, having this syntax error :

/usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:711:in load': /usr/lib/ruby/gems/1.8/gems/license_finder-0.9.3/db/migrate/201303290935_create_dependencies.rb:7: syntax error, unexpected ':', expecting kEND (SyntaxError) String :name, null: false ^ /usr/lib/ruby/gems/1.8/gems/license_finder-0.9.3/db/migrate/201303290935_create_dependencies.rb:8: syntax error, unexpected ':', expecting kEND String :version, null: false ^ from /usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:711:inget_migration_tuples'
from /usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:697:in each' from /usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:697:inget_migration_tuples'
from /usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:634:in initialize' from /usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:390:innew'
from /usr/lib/ruby/gems/1.8/gems/sequel-4.5.0/lib/sequel/extensions/migration.rb:390:in run' from /usr/lib/ruby/gems/1.8/gems/license_finder-0.9.3/lib/license_finder/tables.rb:7 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:ingem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in require' from /usr/lib/ruby/gems/1.8/gems/license_finder-0.9.3/lib/license_finder.rb:42 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:ingem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in require' from /usr/lib/ruby/gems/1.8/gems/license_finder-0.9.3/bin/license_finder:3 from /usr/bin/license_finder:19:inload'
from /usr/bin/license_finder:19

regards

ignore_groups isn't ignoring some of our bundler groups

We have multiple group blocks in our Gemfile. Some of them are for multiple groups, and some are for just one. Like this:

group :development do
  gem "some_gem"
end

group :test, :development do
  gem "another_gem
end

platforms :jruby do
  group :development do
    gem "yet_another_gem"
  end
end

Our config/license_finder.yml has

ignore_groups:
- development
- test

But we are seeing some of the development gems show up in our dependencies. They also trigger license warnings when we run our audits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.