license_finder 6.1.2 → 6.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +64 -0
- data/Dockerfile +23 -15
- data/README.md +24 -2
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/ci/pipelines/release.yml.erb +8 -19
- data/ci/scripts/pushscript.sh +1 -1
- data/ci/scripts/updateChangelog.sh +8 -1
- data/ci/tasks/build-and-push-gem.yml +2 -2
- data/ci/tasks/rubocop.yml +1 -1
- data/ci/tasks/update-changelog.yml +2 -2
- data/lib/license_finder/cli.rb +1 -0
- data/lib/license_finder/cli/base.rb +1 -0
- data/lib/license_finder/cli/inherited_decisions.rb +32 -0
- data/lib/license_finder/cli/main.rb +3 -1
- data/lib/license_finder/configuration.rb +4 -0
- data/lib/license_finder/decision_applier.rb +8 -4
- data/lib/license_finder/decisions.rb +63 -20
- data/lib/license_finder/license/definitions.rb +48 -1
- data/lib/license_finder/license/templates/0BSD.txt +10 -0
- data/lib/license_finder/license/templates/OFL.txt +91 -0
- data/lib/license_finder/license/templates/SimplifiedBSD.txt +0 -4
- data/lib/license_finder/license/templates/WTFPL.txt +14 -0
- data/lib/license_finder/license/text.rb +24 -2
- data/lib/license_finder/logger.rb +2 -0
- data/lib/license_finder/package.rb +2 -1
- data/lib/license_finder/package_manager.rb +6 -2
- data/lib/license_finder/package_managers/bundler.rb +5 -3
- data/lib/license_finder/package_managers/cargo.rb +2 -1
- data/lib/license_finder/package_managers/composer.rb +5 -1
- data/lib/license_finder/package_managers/dep.rb +2 -2
- data/lib/license_finder/package_managers/dotnet.rb +2 -1
- data/lib/license_finder/package_managers/glide.rb +2 -7
- data/lib/license_finder/package_managers/go_15vendorexperiment.rb +1 -1
- data/lib/license_finder/package_managers/go_modules.rb +11 -4
- data/lib/license_finder/package_managers/go_workspace.rb +5 -1
- data/lib/license_finder/package_managers/nuget.rb +37 -3
- data/lib/license_finder/package_managers/pipenv.rb +1 -1
- data/lib/license_finder/package_managers/sbt.rb +3 -1
- data/lib/license_finder/package_managers/yarn.rb +16 -2
- data/lib/license_finder/package_utils/license_files.rb +2 -2
- data/lib/license_finder/packages/bower_package.rb +7 -0
- data/lib/license_finder/packages/bundler_package.rb +4 -0
- data/lib/license_finder/packages/cargo_package.rb +4 -0
- data/lib/license_finder/packages/cocoa_pods_package.rb +4 -0
- data/lib/license_finder/packages/composer_package.rb +4 -0
- data/lib/license_finder/packages/conan_package.rb +4 -0
- data/lib/license_finder/packages/go_package.rb +5 -1
- data/lib/license_finder/packages/gradle_package.rb +4 -0
- data/lib/license_finder/packages/maven_package.rb +6 -1
- data/lib/license_finder/packages/merged_package.rb +1 -1
- data/lib/license_finder/packages/mix_package.rb +4 -0
- data/lib/license_finder/packages/npm_package.rb +4 -0
- data/lib/license_finder/packages/nuget_package.rb +4 -0
- data/lib/license_finder/packages/pip_package.rb +4 -0
- data/lib/license_finder/packages/rebar_package.rb +4 -0
- data/lib/license_finder/packages/yarn_package.rb +4 -0
- data/lib/license_finder/reports/csv_report.rb +7 -3
- data/lib/license_finder/reports/json_report.rb +2 -0
- data/license_finder.gemspec +5 -5
- metadata +20 -22
@@ -8,12 +8,16 @@ module LicenseFinder
|
|
8
8
|
'Go'
|
9
9
|
end
|
10
10
|
|
11
|
+
def package_url
|
12
|
+
"https://pkg.go.dev/#{CGI.escape(name)}@#{CGI.escape(version)}"
|
13
|
+
end
|
14
|
+
|
11
15
|
class << self
|
12
16
|
def from_dependency(hash, prefix, full_version)
|
13
17
|
name = hash['ImportPath']
|
14
18
|
install_path = hash['InstallPath']
|
15
19
|
install_path ||= install_path(prefix.join(name))
|
16
|
-
version = full_version ? hash['Rev'] : hash['Rev'][0..6]
|
20
|
+
version = full_version ? hash['Rev'].gsub('+incompatible', '') : hash['Rev'][0..6]
|
17
21
|
homepage = hash['Homepage']
|
18
22
|
new(name, version, install_path: install_path, package_manager: 'Go', homepage: homepage)
|
19
23
|
end
|
@@ -10,7 +10,8 @@ module LicenseFinder
|
|
10
10
|
name,
|
11
11
|
spec['version'],
|
12
12
|
options.merge(
|
13
|
-
spec_licenses: Array(spec['licenses']).map { |l| l['name'] }
|
13
|
+
spec_licenses: Array(spec['licenses']).map { |l| l['name'] },
|
14
|
+
groups: Array(spec['groupId'])
|
14
15
|
)
|
15
16
|
)
|
16
17
|
end
|
@@ -18,5 +19,9 @@ module LicenseFinder
|
|
18
19
|
def package_manager
|
19
20
|
'Maven'
|
20
21
|
end
|
22
|
+
|
23
|
+
def package_url
|
24
|
+
"https://search.maven.org/artifact/#{CGI.escape(groups.first)}/#{CGI.escape(name.split(':').last)}/#{CGI.escape(version)}/jar"
|
25
|
+
end
|
21
26
|
end
|
22
27
|
end
|
@@ -11,7 +11,7 @@ module LicenseFinder
|
|
11
11
|
super(package.name, package.version)
|
12
12
|
end
|
13
13
|
|
14
|
-
def_delegators :@dependency, :name, :version, :authors, :summary, :description, :homepage, :children, :parents,
|
14
|
+
def_delegators :@dependency, :name, :version, :authors, :summary, :description, :homepage, :package_url, :children, :parents,
|
15
15
|
:groups, :permitted, :restricted, :manual_approval, :install_path, :licenses, :approved_manually?,
|
16
16
|
:approved_manually!, :approved?, :permitted!, :permitted?, :restricted!, :restricted?, :hash,
|
17
17
|
:activations, :missing, :license_names_from_spec, :decided_licenses, :licensing, :decide_on_license,
|
@@ -3,6 +3,7 @@ require 'csv'
|
|
3
3
|
module LicenseFinder
|
4
4
|
class CsvReport < Report
|
5
5
|
COMMA_SEP = ','.freeze
|
6
|
+
NEWLINE_SEP = '\@NL'.freeze
|
6
7
|
AVAILABLE_COLUMNS = %w[name version authors licenses license_links approved summary description homepage install_path package_manager groups texts notice].freeze
|
7
8
|
MISSING_DEPENDENCY_TEXT = 'This package is not installed. Please install to determine licenses.'.freeze
|
8
9
|
|
@@ -10,10 +11,11 @@ module LicenseFinder
|
|
10
11
|
super
|
11
12
|
options[:columns] ||= %w[name version licenses]
|
12
13
|
@columns = Array(options[:columns]) & self.class::AVAILABLE_COLUMNS
|
14
|
+
@write_headers = options[:write_headers] || false
|
13
15
|
end
|
14
16
|
|
15
17
|
def to_s
|
16
|
-
CSV.generate(col_sep: self.class::COMMA_SEP) do |csv|
|
18
|
+
CSV.generate(col_sep: self.class::COMMA_SEP, headers: @columns, write_headers: @write_headers) do |csv|
|
17
19
|
sorted_dependencies.each do |s|
|
18
20
|
csv << format_dependency(s)
|
19
21
|
end
|
@@ -29,11 +31,13 @@ module LicenseFinder
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def format_texts(dep)
|
32
|
-
dep.license_files.map { |file| file.text.split(/[\n\r]+/).join(
|
34
|
+
dep.license_files.map { |file| file.text.split(/[\n\r]+/).join(self.class::NEWLINE_SEP) }
|
35
|
+
.join(self.class::NEWLINE_SEP).force_encoding("ISO-8859-1").encode("UTF-8")
|
33
36
|
end
|
34
37
|
|
35
38
|
def format_notice(dep)
|
36
|
-
dep.notice_files.map { |file| file.text.split(/[\n\r]+/).join(
|
39
|
+
dep.notice_files.map { |file| file.text.split(/[\n\r]+/).join(self.class::NEWLINE_SEP) }
|
40
|
+
.join(self.class::NEWLINE_SEP).force_encoding("ISO-8859-1").encode("UTF-8")
|
37
41
|
end
|
38
42
|
|
39
43
|
def format_name(dep)
|
data/license_finder.gemspec
CHANGED
@@ -46,24 +46,24 @@ Gem::Specification.new do |s|
|
|
46
46
|
s.add_dependency 'bundler'
|
47
47
|
s.add_dependency 'rubyzip', '>=1', '<3'
|
48
48
|
s.add_dependency 'thor', '~> 1.0.1'
|
49
|
-
s.add_dependency '
|
49
|
+
s.add_dependency 'tomlrb', '~> 1.3.0'
|
50
50
|
s.add_dependency 'with_env', '1.1.0'
|
51
51
|
s.add_dependency 'xml-simple', '~> 1.1.5'
|
52
52
|
|
53
53
|
s.add_development_dependency 'addressable', '2.7.0'
|
54
54
|
s.add_development_dependency 'capybara', '~> 3.15.0'
|
55
55
|
s.add_development_dependency 'cocoapods', '>= 1.0.0' if RUBY_PLATFORM =~ /darwin/
|
56
|
-
s.add_development_dependency 'fakefs', '~> 1.
|
56
|
+
s.add_development_dependency 'fakefs', '~> 1.2.0'
|
57
57
|
s.add_development_dependency 'mime-types', '3.3.1'
|
58
|
-
s.add_development_dependency 'pry', '~> 0.
|
58
|
+
s.add_development_dependency 'pry', '~> 0.13.0'
|
59
59
|
s.add_development_dependency 'rake', '~> 13.0.1'
|
60
60
|
s.add_development_dependency 'rspec', '~> 3'
|
61
61
|
s.add_development_dependency 'rspec-its', '~> 1.3.0'
|
62
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
62
|
+
s.add_development_dependency 'rubocop', '~> 0.81.0'
|
63
63
|
s.add_development_dependency 'rubocop-performance', '~> 1.5.0'
|
64
64
|
s.add_development_dependency 'webmock', '~> 3.5'
|
65
65
|
|
66
|
-
s.add_development_dependency 'rack', '~> 2.
|
66
|
+
s.add_development_dependency 'rack', '~> 2.2.2'
|
67
67
|
s.add_development_dependency 'rack-test', '~> 1.1.0', '> 0.7'
|
68
68
|
|
69
69
|
s.files = `git ls-files`.split("\n").reject { |f| f.start_with?('spec', 'features') }
|
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: 6.
|
4
|
+
version: 6.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Collins
|
@@ -27,7 +27,7 @@ authors:
|
|
27
27
|
autorequire:
|
28
28
|
bindir: bin
|
29
29
|
cert_chain: []
|
30
|
-
date: 2020-
|
30
|
+
date: 2020-06-22 00:00:00.000000000 Z
|
31
31
|
dependencies:
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: bundler
|
@@ -78,19 +78,19 @@ dependencies:
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: 1.0.1
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
81
|
+
name: tomlrb
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - "~>"
|
85
85
|
- !ruby/object:Gem::Version
|
86
|
-
version:
|
86
|
+
version: 1.3.0
|
87
87
|
type: :runtime
|
88
88
|
prerelease: false
|
89
89
|
version_requirements: !ruby/object:Gem::Requirement
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - "~>"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
93
|
+
version: 1.3.0
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: with_env
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,14 +153,14 @@ dependencies:
|
|
153
153
|
requirements:
|
154
154
|
- - "~>"
|
155
155
|
- !ruby/object:Gem::Version
|
156
|
-
version: 1.
|
156
|
+
version: 1.2.0
|
157
157
|
type: :development
|
158
158
|
prerelease: false
|
159
159
|
version_requirements: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
161
|
- - "~>"
|
162
162
|
- !ruby/object:Gem::Version
|
163
|
-
version: 1.
|
163
|
+
version: 1.2.0
|
164
164
|
- !ruby/object:Gem::Dependency
|
165
165
|
name: mime-types
|
166
166
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,14 +181,14 @@ dependencies:
|
|
181
181
|
requirements:
|
182
182
|
- - "~>"
|
183
183
|
- !ruby/object:Gem::Version
|
184
|
-
version: 0.
|
184
|
+
version: 0.13.0
|
185
185
|
type: :development
|
186
186
|
prerelease: false
|
187
187
|
version_requirements: !ruby/object:Gem::Requirement
|
188
188
|
requirements:
|
189
189
|
- - "~>"
|
190
190
|
- !ruby/object:Gem::Version
|
191
|
-
version: 0.
|
191
|
+
version: 0.13.0
|
192
192
|
- !ruby/object:Gem::Dependency
|
193
193
|
name: rake
|
194
194
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,14 +237,14 @@ dependencies:
|
|
237
237
|
requirements:
|
238
238
|
- - "~>"
|
239
239
|
- !ruby/object:Gem::Version
|
240
|
-
version: 0.
|
240
|
+
version: 0.81.0
|
241
241
|
type: :development
|
242
242
|
prerelease: false
|
243
243
|
version_requirements: !ruby/object:Gem::Requirement
|
244
244
|
requirements:
|
245
245
|
- - "~>"
|
246
246
|
- !ruby/object:Gem::Version
|
247
|
-
version: 0.
|
247
|
+
version: 0.81.0
|
248
248
|
- !ruby/object:Gem::Dependency
|
249
249
|
name: rubocop-performance
|
250
250
|
requirement: !ruby/object:Gem::Requirement
|
@@ -279,20 +279,14 @@ dependencies:
|
|
279
279
|
requirements:
|
280
280
|
- - "~>"
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version: 2.
|
283
|
-
- - ">"
|
284
|
-
- !ruby/object:Gem::Version
|
285
|
-
version: '1.6'
|
282
|
+
version: 2.2.2
|
286
283
|
type: :development
|
287
284
|
prerelease: false
|
288
285
|
version_requirements: !ruby/object:Gem::Requirement
|
289
286
|
requirements:
|
290
287
|
- - "~>"
|
291
288
|
- !ruby/object:Gem::Version
|
292
|
-
version: 2.
|
293
|
-
- - ">"
|
294
|
-
- !ruby/object:Gem::Version
|
295
|
-
version: '1.6'
|
289
|
+
version: 2.2.2
|
296
290
|
- !ruby/object:Gem::Dependency
|
297
291
|
name: rack-test
|
298
292
|
requirement: !ruby/object:Gem::Requirement
|
@@ -364,6 +358,7 @@ files:
|
|
364
358
|
- lib/license_finder/cli/dependencies.rb
|
365
359
|
- lib/license_finder/cli/ignored_dependencies.rb
|
366
360
|
- lib/license_finder/cli/ignored_groups.rb
|
361
|
+
- lib/license_finder/cli/inherited_decisions.rb
|
367
362
|
- lib/license_finder/cli/licenses.rb
|
368
363
|
- lib/license_finder/cli/main.rb
|
369
364
|
- lib/license_finder/cli/makes_decisions.rb
|
@@ -384,6 +379,7 @@ files:
|
|
384
379
|
- lib/license_finder/license/matcher.rb
|
385
380
|
- lib/license_finder/license/none_matcher.rb
|
386
381
|
- lib/license_finder/license/template.rb
|
382
|
+
- lib/license_finder/license/templates/0BSD.txt
|
387
383
|
- lib/license_finder/license/templates/Apache1_1.txt
|
388
384
|
- lib/license_finder/license/templates/Apache2.txt
|
389
385
|
- lib/license_finder/license/templates/BSD.txt
|
@@ -398,9 +394,11 @@ files:
|
|
398
394
|
- lib/license_finder/license/templates/MIT.txt
|
399
395
|
- lib/license_finder/license/templates/MPL2.txt
|
400
396
|
- lib/license_finder/license/templates/NewBSD.txt
|
397
|
+
- lib/license_finder/license/templates/OFL.txt
|
401
398
|
- lib/license_finder/license/templates/Python.txt
|
402
399
|
- lib/license_finder/license/templates/Ruby.txt
|
403
400
|
- lib/license_finder/license/templates/SimplifiedBSD.txt
|
401
|
+
- lib/license_finder/license/templates/WTFPL.txt
|
404
402
|
- lib/license_finder/license/text.rb
|
405
403
|
- lib/license_finder/license_aggregator.rb
|
406
404
|
- lib/license_finder/logger.rb
|
@@ -504,7 +502,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
504
502
|
- !ruby/object:Gem::Version
|
505
503
|
version: '0'
|
506
504
|
requirements: []
|
507
|
-
rubygems_version: 3.1.
|
505
|
+
rubygems_version: 3.1.4
|
508
506
|
signing_key:
|
509
507
|
specification_version: 4
|
510
508
|
summary: Audit the OSS licenses of your application's dependencies.
|