license_finder 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.rdoc +15 -1
- data/features/cli.feature +1 -1
- data/features/step_definitions/cli_steps.rb +2 -2
- data/features/step_definitions/non_bundler_steps.rb +1 -1
- data/lib/license_finder.rb +3 -0
- data/lib/license_finder/bower.rb +57 -0
- data/lib/license_finder/cli.rb +17 -13
- data/lib/license_finder/configuration.rb +8 -0
- data/lib/license_finder/dependency_manager.rb +4 -0
- data/lib/license_finder/license/apache2.rb +1 -1
- data/lib/license_finder/npm.rb +13 -6
- data/lib/license_finder/reports/detailed_text_report.rb +20 -0
- data/lib/license_finder/reports/markdown_report.rb +23 -0
- data/lib/license_finder/reports/reporter.rb +2 -0
- data/lib/templates/markdown_report.erb +43 -0
- data/license_finder.gemspec +3 -2
- data/readme.md +5 -5
- data/release/manual_instructions.md +2 -2
- data/release/publish.sh +4 -4
- data/spec/lib/license_finder/bower_spec.rb +85 -0
- data/spec/lib/license_finder/cli_spec.rb +32 -0
- data/spec/lib/license_finder/detailed_text_report_spec.rb +35 -0
- data/spec/lib/license_finder/markdown_report_spec.rb +54 -0
- data/spec/lib/license_finder/npm_spec.rb +68 -23
- data/spec/lib/license_finder/reporter_spec.rb +8 -0
- data/spec/lib/license_finder/text_report_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -1
- metadata +47 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b65d1f533fe92270a5d6924fb5bb496c39f5bbb
|
4
|
+
data.tar.gz: 61b8c1a0c33212a69497fa1f95ba3c3825794dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e3315d6de234859334ea3d7426bf6aec588c1b381ab081839d7a0e59e325c9ad1375229b36c0c4ff9b95062c727accf11d7b9019ced480cd4b4ac6c13a3dd1b
|
7
|
+
data.tar.gz: c5a56556655e5852ae8156f02838262d4d3f4064f0dc53c652385073779551b404b8cde0199bece774a2c7c1f667309b1feb3c02cf798191beccc2920b2bb9bd
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,4 +1,18 @@
|
|
1
|
-
=== 0.9.
|
1
|
+
=== 0.9.4 / 2014-01-05
|
2
|
+
|
3
|
+
* Features
|
4
|
+
|
5
|
+
* Add detailed csv report
|
6
|
+
* Add markdown report
|
7
|
+
* Add support for "licenses" => ["license"] (npn)
|
8
|
+
* Add basic bower support
|
9
|
+
* Allow adding/removing multiple licenses from whitelist
|
10
|
+
|
11
|
+
* Bugfixes
|
12
|
+
|
13
|
+
* Use all dependencies by default for npm as bundler does
|
14
|
+
|
15
|
+
=== 0.9.3 / 2013-10-01
|
2
16
|
|
3
17
|
* Features
|
4
18
|
|
data/features/cli.feature
CHANGED
@@ -18,7 +18,7 @@ Feature: License Finder command line executable
|
|
18
18
|
Given I have an app with license finder that depends on a MIT licensed gem
|
19
19
|
When I whitelist MIT and 'other' and New BSD and Apache 2.0 licenses
|
20
20
|
Then it should exit with status code 0
|
21
|
-
And I should see all
|
21
|
+
And I should see all dependencies approved for use
|
22
22
|
|
23
23
|
Scenario: Keep manually set license dependencies
|
24
24
|
Given I have a project that depends on mime-types with a manual license type
|
@@ -44,8 +44,8 @@ Then(/^should list my MIT gem in the output$/) do
|
|
44
44
|
@output.should include 'mit_gem'
|
45
45
|
end
|
46
46
|
|
47
|
-
Then(/^I should see all
|
48
|
-
@output.should include 'All
|
47
|
+
Then(/^I should see all dependencies approved for use$/) do
|
48
|
+
@output.should include 'All dependencies are approved for use'
|
49
49
|
end
|
50
50
|
|
51
51
|
Then(/^the mime\-types license remains set with my manual license type$/) do
|
@@ -10,7 +10,7 @@ end
|
|
10
10
|
|
11
11
|
When(/^I add my JS dependency with an approval flag$/) do
|
12
12
|
@output = @user.execute_command 'license_finder dependencies add --approve MIT my_js_dep 1.2.3'
|
13
|
-
@output.should
|
13
|
+
@output.should match /The my_js_dep dependency has been added and approved/
|
14
14
|
end
|
15
15
|
|
16
16
|
When(/^I remove my JS dependency$/) do
|
data/lib/license_finder.rb
CHANGED
@@ -9,6 +9,7 @@ module LicenseFinder
|
|
9
9
|
|
10
10
|
autoload :Bundle, 'license_finder/bundle'
|
11
11
|
autoload :PackageSaver, 'license_finder/package_saver'
|
12
|
+
autoload :Bower, 'license_finder/bower'
|
12
13
|
autoload :CLI, 'license_finder/cli'
|
13
14
|
autoload :Configuration, 'license_finder/configuration'
|
14
15
|
autoload :DependencyManager, 'license_finder/dependency_manager'
|
@@ -29,8 +30,10 @@ module LicenseFinder
|
|
29
30
|
|
30
31
|
autoload :DependencyReport, 'license_finder/reports/dependency_report'
|
31
32
|
autoload :HtmlReport, 'license_finder/reports/html_report'
|
33
|
+
autoload :MarkdownReport, 'license_finder/reports/markdown_report'
|
32
34
|
autoload :Reporter, 'license_finder/reports/reporter'
|
33
35
|
autoload :TextReport, 'license_finder/reports/text_report'
|
36
|
+
autoload :DetailedTextReport, 'license_finder/reports/detailed_text_report'
|
34
37
|
|
35
38
|
def self.config
|
36
39
|
@config ||= Configuration.ensure_default
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'license_finder/package'
|
3
|
+
|
4
|
+
module LicenseFinder
|
5
|
+
class Bower
|
6
|
+
|
7
|
+
def self.current_packages
|
8
|
+
return @packages if @packages
|
9
|
+
|
10
|
+
output = `bower list --json`
|
11
|
+
|
12
|
+
json = JSON(output)
|
13
|
+
|
14
|
+
@packages = json.fetch("dependencies",[]).map do |package|
|
15
|
+
package = package[1]
|
16
|
+
pkg_meta = package.fetch("pkgMeta", Hash.new)
|
17
|
+
|
18
|
+
Package.new(OpenStruct.new(
|
19
|
+
:name => pkg_meta.fetch("name", nil),
|
20
|
+
:version => pkg_meta.fetch("version", nil),
|
21
|
+
:full_gem_path => package.fetch("canonicalDir", nil),
|
22
|
+
:license => self.harvest_license(pkg_meta),
|
23
|
+
:summary => pkg_meta.fetch("description", nil),
|
24
|
+
:description => pkg_meta.fetch("readme", nil)
|
25
|
+
))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.has_package_file?
|
30
|
+
File.exists?(package_path)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def self.package_path
|
36
|
+
Pathname.new('bower.json').expand_path
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.harvest_license(package)
|
40
|
+
license = package.fetch("licenses", []).first
|
41
|
+
|
42
|
+
if license.is_a? Hash
|
43
|
+
license = license.fetch("type", nil)
|
44
|
+
end
|
45
|
+
|
46
|
+
if license.nil?
|
47
|
+
license = package.fetch("license", nil)
|
48
|
+
|
49
|
+
if license.is_a? Hash
|
50
|
+
license = license.fetch("type", nil)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
license
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/license_finder/cli.rb
CHANGED
@@ -74,26 +74,30 @@ module LicenseFinder
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
desc "add LICENSE", "Add
|
78
|
-
def add(
|
77
|
+
desc "add LICENSE", "Add one ore more licenses to the whitelist"
|
78
|
+
def add(*licenses)
|
79
79
|
die_on_error {
|
80
|
-
|
80
|
+
licenses.each do |license|
|
81
|
+
LicenseFinder.config.whitelist.push(license)
|
82
|
+
end
|
81
83
|
LicenseFinder.config.save
|
82
84
|
|
83
85
|
Reporter.write_reports
|
84
86
|
}
|
85
|
-
say "Added #{
|
87
|
+
say "Added #{licenses.join(", ")} to the license whitelist"
|
86
88
|
end
|
87
89
|
|
88
|
-
desc "remove LICENSE", "Remove
|
89
|
-
def remove(
|
90
|
+
desc "remove LICENSE", "Remove one ore more licenses from the whitelist"
|
91
|
+
def remove(*licenses)
|
90
92
|
die_on_error {
|
91
|
-
|
93
|
+
licenses.each do |license|
|
94
|
+
LicenseFinder.config.whitelist.delete(license)
|
95
|
+
end
|
92
96
|
LicenseFinder.config.save
|
93
97
|
|
94
98
|
Reporter.write_reports
|
95
99
|
}
|
96
|
-
say "Removed #{
|
100
|
+
say "Removed #{licenses.join(", ")} from the license whitelist"
|
97
101
|
end
|
98
102
|
end
|
99
103
|
|
@@ -158,13 +162,13 @@ module LicenseFinder
|
|
158
162
|
end
|
159
163
|
default_task :rescan
|
160
164
|
|
161
|
-
desc "approve DEPENDENCY_NAME", "Approve
|
162
|
-
def approve(
|
165
|
+
desc "approve DEPENDENCY_NAME", "Approve one ore more dependencies by name."
|
166
|
+
def approve(*names)
|
163
167
|
die_on_error {
|
164
|
-
DependencyManager.approve!(name)
|
168
|
+
names.each { |name| DependencyManager.approve!(name) }
|
165
169
|
}
|
166
170
|
|
167
|
-
say "The #{
|
171
|
+
say "The #{names.join(", ")} dependency has been approved!", :green
|
168
172
|
end
|
169
173
|
|
170
174
|
desc "license LICENSE DEPENDENCY_NAME", "Update a dependency's license."
|
@@ -187,7 +191,7 @@ module LicenseFinder
|
|
187
191
|
unapproved = Dependency.unapproved
|
188
192
|
|
189
193
|
if unapproved.empty?
|
190
|
-
say "All
|
194
|
+
say "All dependencies are approved for use", :green
|
191
195
|
else
|
192
196
|
say "Dependencies that need approval:", :red
|
193
197
|
say TextReport.new(unapproved)
|
@@ -61,6 +61,10 @@ module LicenseFinder
|
|
61
61
|
File.join(dependencies_dir, "dependencies.csv")
|
62
62
|
end
|
63
63
|
|
64
|
+
def dependencies_detailed_text
|
65
|
+
File.join(dependencies_dir, "dependencies_detailed.csv")
|
66
|
+
end
|
67
|
+
|
64
68
|
def dependencies_legacy_text
|
65
69
|
File.join(dependencies_dir, "dependencies.txt")
|
66
70
|
end
|
@@ -69,6 +73,10 @@ module LicenseFinder
|
|
69
73
|
File.join(dependencies_dir, "dependencies.html")
|
70
74
|
end
|
71
75
|
|
76
|
+
def dependencies_markdown
|
77
|
+
File.join(dependencies_dir, "dependencies.md")
|
78
|
+
end
|
79
|
+
|
72
80
|
def whitelisted?(license_name)
|
73
81
|
license = License.find_by_name(license_name) || license_name
|
74
82
|
whitelisted_licenses.include? license
|
@@ -18,6 +18,10 @@ module LicenseFinder
|
|
18
18
|
current_dependencies += PackageSaver.save_packages(NPM.current_modules())
|
19
19
|
end
|
20
20
|
|
21
|
+
if Bower.has_package_file?
|
22
|
+
current_dependencies += PackageSaver.save_packages(Bower.current_packages())
|
23
|
+
end
|
24
|
+
|
21
25
|
Dependency.bundler.obsolete(current_dependencies).each(&:destroy)
|
22
26
|
}
|
23
27
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class LicenseFinder::License::Apache2 < LicenseFinder::License::Base
|
2
|
-
self.alternative_names = ["Apache 2.0", "Apache2", "Apache-2.0", "Apache Software License", "Apache License 2.0"]
|
2
|
+
self.alternative_names = ["Apache 2.0", "Apache2", "Apache-2.0", "Apache Software License", "Apache License 2.0", "Apache License Version 2.0"]
|
3
3
|
self.license_url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
|
4
4
|
|
5
5
|
def self.pretty_name
|
data/lib/license_finder/npm.rb
CHANGED
@@ -4,16 +4,19 @@ require 'license_finder/package'
|
|
4
4
|
module LicenseFinder
|
5
5
|
class NPM
|
6
6
|
|
7
|
+
DEPENDENCY_GROUPS = ["dependencies", "devDependencies", "bundleDependencies", "bundledDependencies"]
|
8
|
+
|
7
9
|
def self.current_modules
|
8
10
|
return @modules if @modules
|
9
11
|
|
10
|
-
|
12
|
+
command = "npm list --json --long"
|
13
|
+
output, success = capture(command)
|
14
|
+
raise "Command #{command} failed to execute: #{output}" unless success
|
11
15
|
|
12
16
|
json = JSON(output)
|
17
|
+
dependencies = DEPENDENCY_GROUPS.map { |g| (json[g] || {}).values }.flatten(1)
|
13
18
|
|
14
|
-
@modules =
|
15
|
-
node_module = node_module[1]
|
16
|
-
|
19
|
+
@modules = dependencies.map do |node_module|
|
17
20
|
Package.new(OpenStruct.new(
|
18
21
|
:name => node_module.fetch("name", nil),
|
19
22
|
:version => node_module.fetch("version", nil),
|
@@ -31,6 +34,10 @@ module LicenseFinder
|
|
31
34
|
|
32
35
|
private
|
33
36
|
|
37
|
+
def self.capture(command)
|
38
|
+
[`#{command}`, $?.success?]
|
39
|
+
end
|
40
|
+
|
34
41
|
def self.package_path
|
35
42
|
Pathname.new('package.json').expand_path
|
36
43
|
end
|
@@ -38,7 +45,7 @@ module LicenseFinder
|
|
38
45
|
def self.harvest_license(node_module)
|
39
46
|
license = node_module.fetch("licenses", []).first
|
40
47
|
|
41
|
-
if license
|
48
|
+
if license.is_a? Hash
|
42
49
|
license = license.fetch("type", nil)
|
43
50
|
end
|
44
51
|
|
@@ -53,4 +60,4 @@ module LicenseFinder
|
|
53
60
|
license
|
54
61
|
end
|
55
62
|
end
|
56
|
-
end
|
63
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'csv'
|
3
|
+
|
4
|
+
module LicenseFinder
|
5
|
+
class DetailedTextReport < DependencyReport
|
6
|
+
def to_s
|
7
|
+
CSV.generate(col_sep: ",") do |csv|
|
8
|
+
sorted_dependencies.each do |s|
|
9
|
+
csv << [
|
10
|
+
s.name,
|
11
|
+
s.version,
|
12
|
+
s.license.name,
|
13
|
+
s.summary ? s.summary.strip : "",
|
14
|
+
s.description ? s.description.strip : ""
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
module LicenseFinder
|
4
|
+
class MarkdownReport < DependencyReport
|
5
|
+
private
|
6
|
+
def unapproved_dependencies
|
7
|
+
dependencies.reject(&:approved?)
|
8
|
+
end
|
9
|
+
|
10
|
+
def grouped_dependencies
|
11
|
+
find_name = lambda do |dep|
|
12
|
+
license = License.find_by_name(dep.license.name)
|
13
|
+
if license
|
14
|
+
license.pretty_name
|
15
|
+
else
|
16
|
+
dep.license.name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
dependencies.group_by(&find_name).sort_by { |_, group| group.size }.reverse
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -6,7 +6,9 @@ module LicenseFinder
|
|
6
6
|
dependencies = Dependency.all
|
7
7
|
|
8
8
|
write_file LicenseFinder.config.dependencies_text, TextReport.new(dependencies).to_s
|
9
|
+
write_file LicenseFinder.config.dependencies_detailed_text, DetailedTextReport.new(dependencies).to_s
|
9
10
|
write_file LicenseFinder.config.dependencies_html, HtmlReport.new(dependencies).to_s
|
11
|
+
write_file LicenseFinder.config.dependencies_markdown, MarkdownReport.new(dependencies).to_s
|
10
12
|
|
11
13
|
if File.exists?(LicenseFinder.config.dependencies_legacy_text)
|
12
14
|
File.delete(LicenseFinder.config.dependencies_legacy_text)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# <%= LicenseFinder.config.project_name %>
|
2
|
+
|
3
|
+
As of <%= Time.now.strftime("%B %e, %Y %l:%M%P") %>. <%= dependencies.size %> total, _<%= unapproved_dependencies.size %> unapproved_
|
4
|
+
|
5
|
+
## Summary
|
6
|
+
<% grouped_dependencies.each do |license_name, group| -%>
|
7
|
+
* <%= group.size %> <%= license_name %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if unapproved_dependencies.any? -%>
|
11
|
+
<%= unapproved_dependencies.size %> unapproved dependencies
|
12
|
+
|
13
|
+
<% unapproved_dependencies.each do |dependency| -%>
|
14
|
+
* <a href='#<%= dependency.name %>'><%= dependency.name %></a> (<%= dependency.license.name %>)
|
15
|
+
<% end %>
|
16
|
+
<% end -%>
|
17
|
+
|
18
|
+
## Items
|
19
|
+
|
20
|
+
<% sorted_dependencies.each do |dependency|
|
21
|
+
version_groups = "v#{dependency.version}"
|
22
|
+
if dependency.bundler_groups.any?
|
23
|
+
version_groups += "(#{dependency.bundler_groups.map(&:name).join(", ")})"
|
24
|
+
end -%>
|
25
|
+
|
26
|
+
<% if dependency.homepage && !dependency.homepage.empty? -%>
|
27
|
+
<a name="<%= dependency.name %>"></a>
|
28
|
+
### [<%= dependency.name %>](<%= dependency.homepage %>) <%= version_groups -%>
|
29
|
+
<% else -%>
|
30
|
+
### <%= dependency.name %> <%= version_groups -%>
|
31
|
+
<% end -%>
|
32
|
+
<%
|
33
|
+
license_text = (dependency.license.url && !dependency.license.url.empty?) ? "<a href='#{dependency.license.url}'>#{dependency.license.name}</a>" : dependency.license.name
|
34
|
+
%>
|
35
|
+
|
36
|
+
| Summary | License | Approved? |
|
37
|
+
|---------|-------------|---------|
|
38
|
+
|<%= dependency.summary %>|<%= license_text %>| <%= dependency.approved? ? 'Yes' : '_*No*_' %> |
|
39
|
+
|
40
|
+
<% if dependency.description %>
|
41
|
+
<% dependency.description.lines.each{|l| %>> <%= l -%><% } %>
|
42
|
+
<% end %>
|
43
|
+
<% end -%>
|
data/license_finder.gemspec
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
require './lib/license_finder/platform'
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
+
s.required_ruby_version = '>= 1.9.2'
|
4
5
|
s.name = "license_finder"
|
5
|
-
s.version = "0.9.
|
6
|
+
s.version = "0.9.4"
|
6
7
|
s.authors = ["Jacob Maine", "Matthew Kane Parker", "Ian Lesperance", "David Edwards", "Paul Meskers", "Brent Wheeldon", "Trevor John", "David Tengdin", "William Ramsey"]
|
7
8
|
s.email = ["licensefinder@pivotalabs.com"]
|
8
9
|
s.homepage = "https://github.com/pivotal/LicenseFinder"
|
@@ -22,7 +23,7 @@ Gem::Specification.new do |s|
|
|
22
23
|
s.add_dependency "sequel"
|
23
24
|
s.add_dependency "thor"
|
24
25
|
s.add_dependency "rake"
|
25
|
-
s.add_dependency "httparty"
|
26
|
+
s.add_dependency "httparty", "0.11.0"
|
26
27
|
s.add_dependency LicenseFinder::Platform.sqlite_gem
|
27
28
|
|
28
29
|
%w(rspec xpath cucumber pry).each do |gem|
|
data/readme.md
CHANGED
@@ -100,16 +100,16 @@ To list licenses currently on the whitelist:
|
|
100
100
|
$ license_finder whitelist list
|
101
101
|
```
|
102
102
|
|
103
|
-
To add a
|
103
|
+
To add a licenses to the whitelist:
|
104
104
|
|
105
105
|
```sh
|
106
|
-
$ license_finder whitelist add MIT
|
106
|
+
$ license_finder whitelist add MIT [BSD [...]]
|
107
107
|
```
|
108
108
|
|
109
|
-
To remove a
|
109
|
+
To remove a licenses from the whitelist:
|
110
110
|
|
111
111
|
```sh
|
112
|
-
$ license_finder whitelist remove MIT
|
112
|
+
$ license_finder whitelist remove MIT [BSD [...]]
|
113
113
|
```
|
114
114
|
|
115
115
|
### Managing ignored Bundler groups
|
@@ -215,7 +215,7 @@ This will move your dependencies.* files to the /doc directory and update the co
|
|
215
215
|
|
216
216
|
## Compatibility
|
217
217
|
|
218
|
-
license_finder is compatible with ruby 1.9, and
|
218
|
+
license_finder is compatible with ruby >= 1.9, and jruby.
|
219
219
|
|
220
220
|
|
221
221
|
## A note to gem authors / maintainers
|
data/release/publish.sh
CHANGED
@@ -14,12 +14,12 @@ function perform {
|
|
14
14
|
$1
|
15
15
|
}
|
16
16
|
|
17
|
-
printf "\nBuilding jruby...
|
18
|
-
perform "rvm use jruby
|
17
|
+
printf "\nBuilding jruby..."
|
18
|
+
perform "rvm use jruby"
|
19
19
|
perform "rake build"
|
20
20
|
|
21
|
-
printf "\nBuilding ruby...
|
22
|
-
perform "rvm use ruby
|
21
|
+
printf "\nBuilding ruby..."
|
22
|
+
perform "rvm use ruby"
|
23
23
|
perform "rake build"
|
24
24
|
|
25
25
|
printf "\nPublishing to rubygems..."
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module LicenseFinder
|
4
|
+
describe Bower do
|
5
|
+
describe '.current_packages' do
|
6
|
+
it 'lists all the current packages' do
|
7
|
+
json = <<-resp
|
8
|
+
{
|
9
|
+
"dependencies": {
|
10
|
+
"dependency-library": {
|
11
|
+
"canonicalDir": "/path/to/thing",
|
12
|
+
"pkgMeta": {
|
13
|
+
"name": "dependency-library",
|
14
|
+
"description": "description",
|
15
|
+
"version": "1.3.3.7",
|
16
|
+
"main": "normalize.css"
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"another-dependency": {
|
20
|
+
"canonicalDir": "/path/to/thing2",
|
21
|
+
"pkgMeta": {
|
22
|
+
"name": "another-dependency",
|
23
|
+
"description": "description2",
|
24
|
+
"version": "4.2",
|
25
|
+
"main": "denormalize.css"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
resp
|
31
|
+
allow(Bower).to receive(:`).with(/bower/).and_return(json)
|
32
|
+
|
33
|
+
current_packages = Bower.current_packages
|
34
|
+
|
35
|
+
expect(current_packages.size).to eq(2)
|
36
|
+
expect(current_packages.first).to be_a(Package)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'memoizes the current_packages' do
|
40
|
+
allow(Bower).to receive(:`).with(/bower/).and_return('{}').once
|
41
|
+
|
42
|
+
Bower.current_packages
|
43
|
+
Bower.current_packages
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '.harvest_license' do
|
48
|
+
let(:package1) { {"license" => "MIT"} }
|
49
|
+
let(:package2) { {"licenses" => [{"type" => "BSD", "url" => "github.github/github"}]} }
|
50
|
+
let(:package3) { {"license" => {"type" => "PSF", "url" => "github.github/github"}} }
|
51
|
+
let(:package4) { {"licenses" => ["MIT"]} }
|
52
|
+
|
53
|
+
it 'finds the license for both license structures' do
|
54
|
+
Bower.harvest_license(package1).should eq("MIT")
|
55
|
+
Bower.harvest_license(package2).should eq("BSD")
|
56
|
+
Bower.harvest_license(package3).should eq("PSF")
|
57
|
+
Bower.harvest_license(package4).should eq("MIT")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '.has_package_file?' do
|
62
|
+
let(:package) { Pathname.new('bower.json').expand_path }
|
63
|
+
|
64
|
+
context 'with a bower.json file' do
|
65
|
+
before :each do
|
66
|
+
allow(File).to receive(:exists?).with(package).and_return(true)
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'returns true' do
|
70
|
+
expect(Bower.has_package_file?).to eq(true)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'without a bower.json file' do
|
75
|
+
before :each do
|
76
|
+
allow(File).to receive(:exists?).with(package).and_return(false)
|
77
|
+
end
|
78
|
+
|
79
|
+
it 'returns false' do
|
80
|
+
expect(Bower.has_package_file?).to eq(false)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -63,6 +63,17 @@ module LicenseFinder
|
|
63
63
|
subject.add("test")
|
64
64
|
end
|
65
65
|
end
|
66
|
+
|
67
|
+
it "adds multiple licenses to the whitelist" do
|
68
|
+
config.whitelist.should_receive(:push).with("test")
|
69
|
+
config.whitelist.should_receive(:push).with("rest")
|
70
|
+
config.should_receive(:save)
|
71
|
+
Reporter.should_receive(:write_reports)
|
72
|
+
|
73
|
+
silence_stdout do
|
74
|
+
subject.add("test", "rest")
|
75
|
+
end
|
76
|
+
end
|
66
77
|
end
|
67
78
|
|
68
79
|
describe "remove" do
|
@@ -72,9 +83,21 @@ module LicenseFinder
|
|
72
83
|
Reporter.should_receive(:write_reports)
|
73
84
|
|
74
85
|
silence_stdout do
|
86
|
+
|
75
87
|
subject.remove("test")
|
76
88
|
end
|
77
89
|
end
|
90
|
+
|
91
|
+
it "removes multiple licenses from the whitelist" do
|
92
|
+
config.should_receive(:save)
|
93
|
+
config.whitelist.should_receive(:delete).with("test")
|
94
|
+
config.whitelist.should_receive(:delete).with("rest")
|
95
|
+
Reporter.should_receive(:write_reports)
|
96
|
+
|
97
|
+
silence_stdout do
|
98
|
+
subject.remove("test", "rest")
|
99
|
+
end
|
100
|
+
end
|
78
101
|
end
|
79
102
|
end
|
80
103
|
|
@@ -174,6 +197,15 @@ module LicenseFinder
|
|
174
197
|
subject.approve 'foo'
|
175
198
|
end
|
176
199
|
end
|
200
|
+
|
201
|
+
it "approves multiple gem" do
|
202
|
+
DependencyManager.should_receive(:approve!).with("foo")
|
203
|
+
DependencyManager.should_receive(:approve!).with("bar")
|
204
|
+
|
205
|
+
silence_stdout do
|
206
|
+
subject.approve 'foo', 'bar'
|
207
|
+
end
|
208
|
+
end
|
177
209
|
end
|
178
210
|
|
179
211
|
describe "#action_items" do
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module LicenseFinder
|
4
|
+
describe DetailedTextReport do
|
5
|
+
describe '#to_s' do
|
6
|
+
let(:dep1) do
|
7
|
+
dependency = Dependency.new(
|
8
|
+
'name' => 'gem_a',
|
9
|
+
'version' => '1.0',
|
10
|
+
'summary' => 'Summary',
|
11
|
+
'description' => 'Description'
|
12
|
+
)
|
13
|
+
dependency.license = LicenseFinder::LicenseAlias.create(name: 'MIT')
|
14
|
+
dependency
|
15
|
+
end
|
16
|
+
|
17
|
+
let(:dep2) do
|
18
|
+
dependency = Dependency.new(
|
19
|
+
'name' => 'gem_b',
|
20
|
+
'version' => '1.0',
|
21
|
+
'summary' => 'Summary',
|
22
|
+
'description' => 'Description'
|
23
|
+
)
|
24
|
+
dependency.license = LicenseFinder::LicenseAlias.create(name: 'MIT')
|
25
|
+
dependency
|
26
|
+
end
|
27
|
+
|
28
|
+
subject { DetailedTextReport.new([dep2, dep1]).to_s }
|
29
|
+
|
30
|
+
it 'should generate a text report with the name, version, license, summary and description of each dependency, sorted by name' do
|
31
|
+
should == "gem_a,1.0,MIT,Summary,Description\ngem_b,1.0,MIT,Summary,Description\n"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module LicenseFinder
|
4
|
+
describe MarkdownReport do
|
5
|
+
describe '#to_s' do
|
6
|
+
let(:dep1) do
|
7
|
+
dependency = Dependency.new(
|
8
|
+
'name' => 'gem_a',
|
9
|
+
'version' => '1.0'
|
10
|
+
)
|
11
|
+
dependency.license = LicenseFinder::LicenseAlias.create(name: 'MIT')
|
12
|
+
dependency.approval = Approval.create(state: false)
|
13
|
+
dependency
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:dep2) do
|
17
|
+
dependency = Dependency.new(
|
18
|
+
'name' => 'gem_b',
|
19
|
+
'version' => '2.3'
|
20
|
+
)
|
21
|
+
dependency.license = LicenseFinder::LicenseAlias.create(name: 'BSD')
|
22
|
+
dependency.approval = Approval.create(state: true)
|
23
|
+
dependency
|
24
|
+
end
|
25
|
+
|
26
|
+
subject { MarkdownReport.new([dep2, dep1]).to_s }
|
27
|
+
|
28
|
+
it 'should have the correct header' do
|
29
|
+
LicenseFinder.config.project_name = "new_project_name"
|
30
|
+
should match "# new_project_name"
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should list the total, and unapproved counts' do
|
34
|
+
should match "2 total, _1 unapproved_"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should list the unapproved dependency" do
|
38
|
+
should match "href='#gem_a'"
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should display a summary" do
|
42
|
+
should match "## Summary"
|
43
|
+
should match /\s+\* 1 MIT/
|
44
|
+
should match /\s+\* 1 BSD/
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should list both gems" do
|
48
|
+
should match "## Items"
|
49
|
+
should match "### gem_a v1.0"
|
50
|
+
should match "### gem_b v2.3"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -3,52 +3,97 @@ require 'spec_helper'
|
|
3
3
|
module LicenseFinder
|
4
4
|
describe NPM do
|
5
5
|
describe '.current_modules' do
|
6
|
+
before { NPM.instance_variable_set(:@modules, nil) }
|
7
|
+
|
6
8
|
it 'lists all the current modules' do
|
7
|
-
json = <<-
|
8
|
-
{
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
9
|
+
json = <<-JSON
|
10
|
+
{
|
11
|
+
"dependencies": {
|
12
|
+
"dependency.js": {
|
13
|
+
"name": "depjs",
|
14
|
+
"version": "1.3.3.7",
|
15
|
+
"description": "description",
|
16
|
+
"readme": "readme",
|
17
|
+
"path": "/path/to/thing"
|
18
|
+
},
|
19
|
+
"dependency2.js": {
|
20
|
+
"name": "dep2js",
|
21
|
+
"version": "4.2",
|
22
|
+
"description": "description2",
|
23
|
+
"readme": "readme2",
|
24
|
+
"path": "/path/to/thing2"
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"devDependencies": {
|
28
|
+
"dependency3.js": {
|
29
|
+
"name": "dep3js",
|
30
|
+
"version": "4.2",
|
31
|
+
"description": "description3",
|
32
|
+
"readme": "readme3",
|
33
|
+
"path": "/path/to/thing3"
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"bundledDependencies": {
|
37
|
+
"dependency4.js": {
|
38
|
+
"name": "dep4js",
|
39
|
+
"version": "4.2",
|
40
|
+
"description": "description4",
|
41
|
+
"readme": "readme4",
|
42
|
+
"path": "/path/to/thing4"
|
43
|
+
}
|
44
|
+
},
|
45
|
+
"bundleDependencies": {
|
46
|
+
"dependency5.js": {
|
47
|
+
"name": "dep5js",
|
48
|
+
"version": "4.2",
|
49
|
+
"description": "description5",
|
50
|
+
"readme": "readme5",
|
51
|
+
"path": "/path/to/thing5"
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"notADependency": {
|
55
|
+
"dependency6.js": {
|
56
|
+
"name": "dep6js",
|
57
|
+
"version": "4.2",
|
58
|
+
"description": "description6",
|
59
|
+
"readme": "readme6",
|
60
|
+
"path": "/path/to/thing6"
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
64
|
+
JSON
|
65
|
+
allow(NPM).to receive(:capture).with(/npm/).and_return([json, true])
|
28
66
|
|
29
67
|
current_modules = NPM.current_modules
|
30
68
|
|
31
|
-
expect(current_modules.
|
69
|
+
expect(current_modules.map(&:name)).to eq(["depjs 1.3.3.7", "dep2js 4.2", "dep3js 4.2", "dep5js 4.2", "dep4js 4.2"])
|
32
70
|
expect(current_modules.first).to be_a(Package)
|
33
71
|
end
|
34
72
|
|
35
73
|
it 'memoizes the current_modules' do
|
36
|
-
allow(NPM).to receive(
|
74
|
+
allow(NPM).to receive(:capture).with(/npm/).and_return(['{}', true]).once
|
37
75
|
|
38
76
|
NPM.current_modules
|
39
77
|
NPM.current_modules
|
40
78
|
end
|
79
|
+
|
80
|
+
it "fails when command fails" do
|
81
|
+
allow(NPM).to receive(:capture).with(/npm/).and_return('Some error', false).once
|
82
|
+
expect { NPM.current_modules }.to raise_error(RuntimeError)
|
83
|
+
end
|
41
84
|
end
|
42
85
|
|
43
86
|
describe '.harvest_license' do
|
44
87
|
let(:node_module1) { {"license" => "MIT"} }
|
45
88
|
let(:node_module2) { {"licenses" => [{"type" => "BSD", "url" => "github.github/github"}]} }
|
46
89
|
let(:node_module3) { {"license" => {"type" => "PSF", "url" => "github.github/github"}} }
|
90
|
+
let(:node_module4) { {"licenses" => ["MIT"]} }
|
47
91
|
|
48
92
|
it 'finds the license for both license structures' do
|
49
93
|
NPM.harvest_license(node_module1).should eq("MIT")
|
50
94
|
NPM.harvest_license(node_module2).should eq("BSD")
|
51
95
|
NPM.harvest_license(node_module3).should eq("PSF")
|
96
|
+
NPM.harvest_license(node_module4).should eq("MIT")
|
52
97
|
end
|
53
98
|
end
|
54
99
|
|
@@ -11,7 +11,11 @@ module LicenseFinder
|
|
11
11
|
|
12
12
|
LicenseFinder.stub_chain(:config, :dependencies_html) { 'html_file_path' }
|
13
13
|
LicenseFinder.stub_chain(:config, :dependencies_text) { 'text_file_path' }
|
14
|
+
LicenseFinder.stub_chain(:config, :dependencies_detailed_text) { 'detailed_text_file_path' }
|
15
|
+
LicenseFinder.stub_chain(:config, :dependencies_markdown) { 'markdown_file_path' }
|
14
16
|
|
17
|
+
MarkdownReport.stub_chain(:new, :to_s) { 'text report' }
|
18
|
+
DetailedTextReport.stub_chain(:new, :to_s) { 'text report' }
|
15
19
|
TextReport.stub_chain(:new, :to_s) { 'text report' }
|
16
20
|
HtmlReport.stub_chain(:new, :to_s) { 'text report' }
|
17
21
|
|
@@ -20,11 +24,15 @@ module LicenseFinder
|
|
20
24
|
|
21
25
|
File.stub(:open).with('html_file_path', 'w+')
|
22
26
|
File.stub(:open).with('text_file_path', 'w+')
|
27
|
+
File.stub(:open).with('detailed_text_file_path', 'w+')
|
28
|
+
File.stub(:open).with('markdown_file_path', 'w+')
|
23
29
|
end
|
24
30
|
|
25
31
|
it "writes an html file" do
|
26
32
|
File.should_receive(:open).with('html_file_path', 'w+')
|
27
33
|
File.should_receive(:open).with('text_file_path', 'w+')
|
34
|
+
File.should_receive(:open).with('detailed_text_file_path', 'w+')
|
35
|
+
File.should_receive(:open).with('markdown_file_path', 'w+')
|
28
36
|
subject
|
29
37
|
end
|
30
38
|
|
@@ -6,7 +6,7 @@ module LicenseFinder
|
|
6
6
|
let(:dep1) do
|
7
7
|
dependency = Dependency.new(
|
8
8
|
'name' => 'gem_a',
|
9
|
-
'version' => '1.0'
|
9
|
+
'version' => '1.0'
|
10
10
|
)
|
11
11
|
dependency.license = LicenseFinder::LicenseAlias.create(name: 'MIT')
|
12
12
|
dependency
|
@@ -15,7 +15,7 @@ module LicenseFinder
|
|
15
15
|
let(:dep2) do
|
16
16
|
dependency = Dependency.new(
|
17
17
|
'name' => 'gem_b',
|
18
|
-
'version' => '1.0'
|
18
|
+
'version' => '1.0'
|
19
19
|
)
|
20
20
|
dependency.license = LicenseFinder::LicenseAlias.create(name: 'MIT')
|
21
21
|
dependency
|
@@ -23,7 +23,7 @@ module LicenseFinder
|
|
23
23
|
|
24
24
|
subject { TextReport.new([dep2, dep1]).to_s }
|
25
25
|
|
26
|
-
it 'should generate a text report with the name, version
|
26
|
+
it 'should generate a text report with the name, version and license of each dependency, sorted by name' do
|
27
27
|
should == "gem_a, 1.0, MIT\ngem_b, 1.0, MIT"
|
28
28
|
end
|
29
29
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -15,7 +15,8 @@ RSpec.configure do |config|
|
|
15
15
|
end
|
16
16
|
|
17
17
|
RSpec.configure do |config|
|
18
|
-
config.
|
18
|
+
config.before { FileUtils.rm_f("config/license_finder.yml") }
|
19
|
+
config.around do |example|
|
19
20
|
DB.transaction(rollback: :always) { example.run }
|
20
21
|
end
|
21
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: license_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Maine
|
@@ -16,188 +16,188 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date:
|
19
|
+
date: 2014-01-05 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: bundler
|
23
23
|
requirement: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
type: :runtime
|
29
29
|
prerelease: false
|
30
30
|
version_requirements: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: sequel
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: thor
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: rake
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
78
|
name: httparty
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - '
|
81
|
+
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 0.11.0
|
84
84
|
type: :runtime
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - '
|
88
|
+
- - '='
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
90
|
+
version: 0.11.0
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sqlite3
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
type: :runtime
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: rspec
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: xpath
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
type: :development
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: cucumber
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
type: :development
|
141
141
|
prerelease: false
|
142
142
|
version_requirements: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- -
|
144
|
+
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: pry
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- -
|
151
|
+
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
type: :development
|
155
155
|
prerelease: false
|
156
156
|
version_requirements: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- -
|
158
|
+
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
- !ruby/object:Gem::Dependency
|
162
162
|
name: capybara
|
163
163
|
requirement: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- - ~>
|
165
|
+
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: 2.0.0
|
168
168
|
type: :development
|
169
169
|
prerelease: false
|
170
170
|
version_requirements: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
|
-
- - ~>
|
172
|
+
- - "~>"
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: 2.0.0
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
176
|
name: rails
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- - ~>
|
179
|
+
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: 3.2.0
|
182
182
|
type: :development
|
183
183
|
prerelease: false
|
184
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- - ~>
|
186
|
+
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: 3.2.0
|
189
189
|
- !ruby/object:Gem::Dependency
|
190
190
|
name: webmock
|
191
191
|
requirement: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
|
-
- - ~>
|
193
|
+
- - "~>"
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '1.13'
|
196
196
|
type: :development
|
197
197
|
prerelease: false
|
198
198
|
version_requirements: !ruby/object:Gem::Requirement
|
199
199
|
requirements:
|
200
|
-
- - ~>
|
200
|
+
- - "~>"
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '1.13'
|
203
203
|
description: |2
|
@@ -213,9 +213,9 @@ executables:
|
|
213
213
|
extensions: []
|
214
214
|
extra_rdoc_files: []
|
215
215
|
files:
|
216
|
-
- .gitignore
|
217
|
-
- .rspec
|
218
|
-
- .travis.yml
|
216
|
+
- ".gitignore"
|
217
|
+
- ".rspec"
|
218
|
+
- ".travis.yml"
|
219
219
|
- CHANGELOG.rdoc
|
220
220
|
- Gemfile
|
221
221
|
- LICENSE
|
@@ -274,6 +274,7 @@ files:
|
|
274
274
|
- lib/data/licenses/Ruby.txt
|
275
275
|
- lib/data/licenses/SimplifiedBSD.txt
|
276
276
|
- lib/license_finder.rb
|
277
|
+
- lib/license_finder/bower.rb
|
277
278
|
- lib/license_finder/bundle.rb
|
278
279
|
- lib/license_finder/cli.rb
|
279
280
|
- lib/license_finder/configuration.rb
|
@@ -299,7 +300,9 @@ files:
|
|
299
300
|
- lib/license_finder/possible_license_files.rb
|
300
301
|
- lib/license_finder/railtie.rb
|
301
302
|
- lib/license_finder/reports/dependency_report.rb
|
303
|
+
- lib/license_finder/reports/detailed_text_report.rb
|
302
304
|
- lib/license_finder/reports/html_report.rb
|
305
|
+
- lib/license_finder/reports/markdown_report.rb
|
303
306
|
- lib/license_finder/reports/reporter.rb
|
304
307
|
- lib/license_finder/reports/text_report.rb
|
305
308
|
- lib/license_finder/tables.rb
|
@@ -310,6 +313,7 @@ files:
|
|
310
313
|
- lib/license_finder/yml_to_sql.rb
|
311
314
|
- lib/tasks/license_finder.rake
|
312
315
|
- lib/templates/html_report.erb
|
316
|
+
- lib/templates/markdown_report.erb
|
313
317
|
- lib/templates/text_report.erb
|
314
318
|
- license_finder.gemspec
|
315
319
|
- readme.md
|
@@ -341,10 +345,12 @@ files:
|
|
341
345
|
- spec/fixtures/readme/README
|
342
346
|
- spec/fixtures/readme/Readme.markdown
|
343
347
|
- spec/fixtures/utf8_gem/README
|
348
|
+
- spec/lib/license_finder/bower_spec.rb
|
344
349
|
- spec/lib/license_finder/bundle_spec.rb
|
345
350
|
- spec/lib/license_finder/cli_spec.rb
|
346
351
|
- spec/lib/license_finder/configuration_spec.rb
|
347
352
|
- spec/lib/license_finder/dependency_manager_spec.rb
|
353
|
+
- spec/lib/license_finder/detailed_text_report_spec.rb
|
348
354
|
- spec/lib/license_finder/html_report_spec.rb
|
349
355
|
- spec/lib/license_finder/license/apache_spec.rb
|
350
356
|
- spec/lib/license_finder/license/bsd_spec.rb
|
@@ -358,6 +364,7 @@ files:
|
|
358
364
|
- spec/lib/license_finder/license/simplified_bsd_spec.rb
|
359
365
|
- spec/lib/license_finder/license_spec.rb
|
360
366
|
- spec/lib/license_finder/license_url_spec.rb
|
367
|
+
- spec/lib/license_finder/markdown_report_spec.rb
|
361
368
|
- spec/lib/license_finder/npm_spec.rb
|
362
369
|
- spec/lib/license_finder/package_saver_spec.rb
|
363
370
|
- spec/lib/license_finder/package_spec.rb
|
@@ -383,17 +390,17 @@ require_paths:
|
|
383
390
|
- lib
|
384
391
|
required_ruby_version: !ruby/object:Gem::Requirement
|
385
392
|
requirements:
|
386
|
-
- -
|
393
|
+
- - ">="
|
387
394
|
- !ruby/object:Gem::Version
|
388
|
-
version:
|
395
|
+
version: 1.9.2
|
389
396
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
390
397
|
requirements:
|
391
|
-
- -
|
398
|
+
- - ">="
|
392
399
|
- !ruby/object:Gem::Version
|
393
400
|
version: '0'
|
394
401
|
requirements: []
|
395
402
|
rubyforge_project:
|
396
|
-
rubygems_version: 2.
|
403
|
+
rubygems_version: 2.2.0
|
397
404
|
signing_key:
|
398
405
|
specification_version: 4
|
399
406
|
summary: Audit the OSS licenses of your application's dependencies.
|
@@ -448,10 +455,12 @@ test_files:
|
|
448
455
|
- spec/fixtures/readme/README
|
449
456
|
- spec/fixtures/readme/Readme.markdown
|
450
457
|
- spec/fixtures/utf8_gem/README
|
458
|
+
- spec/lib/license_finder/bower_spec.rb
|
451
459
|
- spec/lib/license_finder/bundle_spec.rb
|
452
460
|
- spec/lib/license_finder/cli_spec.rb
|
453
461
|
- spec/lib/license_finder/configuration_spec.rb
|
454
462
|
- spec/lib/license_finder/dependency_manager_spec.rb
|
463
|
+
- spec/lib/license_finder/detailed_text_report_spec.rb
|
455
464
|
- spec/lib/license_finder/html_report_spec.rb
|
456
465
|
- spec/lib/license_finder/license/apache_spec.rb
|
457
466
|
- spec/lib/license_finder/license/bsd_spec.rb
|
@@ -465,6 +474,7 @@ test_files:
|
|
465
474
|
- spec/lib/license_finder/license/simplified_bsd_spec.rb
|
466
475
|
- spec/lib/license_finder/license_spec.rb
|
467
476
|
- spec/lib/license_finder/license_url_spec.rb
|
477
|
+
- spec/lib/license_finder/markdown_report_spec.rb
|
468
478
|
- spec/lib/license_finder/npm_spec.rb
|
469
479
|
- spec/lib/license_finder/package_saver_spec.rb
|
470
480
|
- spec/lib/license_finder/package_spec.rb
|