license_scout 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  #
2
+
2
3
  # Copyright:: Copyright 2016, Chef Software Inc.
3
4
  # License:: Apache License, Version 2.0
4
5
  #
@@ -117,6 +118,31 @@ module LicenseScout
117
118
  ["chef-rewind", "MIT", nil],
118
119
  ["ubuntu_ami", "Apache-2.0", nil],
119
120
  ["net-telnet", "Ruby", nil],
121
+ ["netrc", "MIT", nil],
122
+ ["oc-chef-pedant", "Apache-2.0", nil],
123
+ ["rake", "MIT", nil],
124
+ ["rspec", "MIT", nil],
125
+ ["yajl-ruby", "MIT", nil],
126
+ ["bunny", "MIT", nil],
127
+ ["em-http-request", "MIT", nil],
128
+ ["sequel", "MIT", nil],
129
+ ["reel", "MIT", nil],
130
+ ["spork", "MIT", nil],
131
+ ["rack-test", "MIT", nil],
132
+ ["moneta", "MIT", nil],
133
+ ["mixlib-authentication", "Apache-2.0", nil],
134
+ ["mixlib-cli", "Apache-2.0", nil],
135
+ ["ohai", "Apache-2.0", nil],
136
+ ["chef", "Apache-2.0", nil],
137
+ ["ipaddress", "MIT", nil],
138
+ ["systemu", "BSD-2-Clause", nil],
139
+ ["pry", "MIT", nil],
140
+ ["puma", "BSD-3-Clause", nil],
141
+ ["rb-inotify", "MIT", nil],
142
+ ["chef-web-core", "Apache-2.0", nil],
143
+ ["knife-opc", "Apache-2.0", nil],
144
+ ["highline", "Ruby", ["LICENSE"]],
145
+ ["unicorn", "Ruby", ["LICENSE"]],
120
146
  # Overrides that require file fetching from internet
121
147
  ["sfl", "Ruby", ["https://raw.githubusercontent.com/ujihisa/spawn-for-legacy/master/LICENCE.md"]],
122
148
  ["json_pure", nil, ["https://raw.githubusercontent.com/flori/json/master/README.md"]],
@@ -135,6 +161,34 @@ module LicenseScout
135
161
  ["win32-mutex", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
136
162
  ["win32-service", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
137
163
  ["windows-api", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
164
+ ["rdoc", "Ruby", ["https://raw.githubusercontent.com/rdoc/rdoc/master/LICENSE.rdoc"]],
165
+ ["rest-client", "MIT", ["https://raw.githubusercontent.com/rest-client/rest-client/master/LICENSE"]],
166
+ ["rspec-rerun", nil, ["https://raw.githubusercontent.com/dblock/rspec-rerun/master/LICENSE.md"]],
167
+ ["amqp", "Ruby", ["https://raw.githubusercontent.com/ruby-amqp/amqp/master/README.md"]],
168
+ ["fast_xs", "MIT", ["https://raw.githubusercontent.com/brianmario/fast_xs/master/LICENSE"]],
169
+ ["word-salad", "MIT", ["https://raw.githubusercontent.com/alexvollmer/word_salad/master/README.txt"]],
170
+ ["minitest", nil, ["https://raw.githubusercontent.com/seattlerb/minitest/master/README.rdoc"]],
171
+ ["cucumber-wire", nil, ["https://raw.githubusercontent.com/cucumber/cucumber-ruby-wire/master/LICENSE"]],
172
+ ["minitar", "Ruby", ["https://raw.githubusercontent.com/atoulme/minitar/master/README"]],
173
+ ["enumerable-lazy", "MIT", ["https://raw.githubusercontent.com/yhara/enumerable-lazy/master/README.md"]],
174
+ ["rack-accept", "MIT", ["https://raw.githubusercontent.com/mjackson/rack-accept/master/README.md"]],
175
+ ["net-http-spy", "Public-Domain", ["https://raw.githubusercontent.com/martinbtt/net-http-spy/master/readme.markdown"]],
176
+ ["http_parser.rb", nil, ["https://raw.githubusercontent.com/tmm1/http_parser.rb/master/LICENSE-MIT"]],
177
+ ["websocket-extensions", nil, ["https://raw.githubusercontent.com/faye/websocket-extensions-ruby/master/LICENSE.md"]],
178
+ ["websocket-driver", nil, ["https://raw.githubusercontent.com/faye/websocket-driver-ruby/master/LICENSE.md"]],
179
+ ["dep_selector", nil, ["https://raw.githubusercontent.com/chef/dep-selector/master/LICENSE"]],
180
+ ["overcommit", nil, ["https://raw.githubusercontent.com/brigade/overcommit/master/MIT-LICENSE"]],
181
+ ["github_changelog_generator", nil, ["https://raw.githubusercontent.com/skywinder/github-changelog-generator/master/LICENSE"]],
182
+ ["pbkdf2", "MIT", ["https://raw.githubusercontent.com/emerose/pbkdf2-ruby/master/LICENSE.TXT"]],
183
+ ["rails-deprecated_sanitizer", nil, ["https://raw.githubusercontent.com/rails/rails-deprecated_sanitizer/master/LICENSE"]],
184
+ ["rails-html-sanitizer", nil, ["https://raw.githubusercontent.com/rails/rails-html-sanitizer/master/MIT-LICENSE"]],
185
+ ["compass", "MIT", ["https://raw.githubusercontent.com/Compass/compass/stable/LICENSE.markdown"]],
186
+ ["railties", nil, ["https://raw.githubusercontent.com/rails/rails/master/railties/MIT-LICENSE"]],
187
+ ["coffee-script-source", nil, ["https://raw.githubusercontent.com/jessedoyle/coffee-script-source/master/LICENSE"]],
188
+ ["omniauth-chef", nil, ["https://raw.githubusercontent.com/chef/omniauth-chef/master/README.md"]],
189
+ ["rails", nil, ["https://raw.githubusercontent.com/rails/rails/master/README.md"]],
190
+ ["unicorn-rails", "MIT", ["https://raw.githubusercontent.com/samuelkadolph/unicorn-rails/master/LICENSE"]],
191
+ ["hoe", "MIT", ["https://raw.githubusercontent.com/seattlerb/hoe/master/README.rdoc"]],
138
192
  ].each do |override_data|
139
193
  override_license "ruby_bundler", override_data[0] do |version|
140
194
  {}.tap do |d|
@@ -143,6 +197,116 @@ module LicenseScout
143
197
  end
144
198
  end
145
199
  end
200
+
201
+ [
202
+ ["apt", nil, ["https://raw.githubusercontent.com/chef-cookbooks/apt/master/LICENSE"]],
203
+ ["chef-ha-drbd", nil, ["https://raw.githubusercontent.com/chef/chef-server/master/LICENSE"]],
204
+ ["private-chef", nil, ["https://raw.githubusercontent.com/chef/chef-server/master/LICENSE"]],
205
+ ["chef-sugar", nil, ["https://raw.githubusercontent.com/sethvargo/chef-sugar/master/LICENSE"]],
206
+ ["openssl", nil, ["https://raw.githubusercontent.com/chef-cookbooks/openssl/master/LICENSE"]],
207
+ ["runit", nil, ["https://raw.githubusercontent.com/chef-cookbooks/runit/master/LICENSE"]],
208
+ ["yum", nil, ["https://raw.githubusercontent.com/chef-cookbooks/yum/master/LICENSE"]],
209
+ ].each do |override_data|
210
+ override_license "chef_berkshelf", override_data[0] do |version|
211
+ {}.tap do |d|
212
+ d[:license] = override_data[1] if override_data[1]
213
+ d[:license_files] = override_data[2] if override_data[2]
214
+ end
215
+ end
216
+ end
217
+
218
+ # Most of the overrides for perl_cpan are pointing to the README files
219
+ # inside the modules we download to inspect for licensing information.
220
+ [
221
+ ["Scalar-List-Utils", nil, ["README"]],
222
+ ["perl", nil, ["README"]],
223
+ ["IO", nil, ["README"]],
224
+ ["ExtUtils-MakeMaker", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
225
+ ["PathTools", "Perl-5", ["lib/File/Spec.pm"]],
226
+ ["Exporter", nil, ["README"]],
227
+ ["Carp", nil, ["README"]],
228
+ ["lib", nil, ["Artistic"]],
229
+ ["Pod-Escapes", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
230
+ ["Pod-Usage", nil, ["README"]],
231
+ ["base", "Perl-5", ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
232
+ ["Encode", nil, ["AUTHORS"]],
233
+ ["Moo", nil, ["README"]],
234
+ ["Role-Tiny", nil, ["README"]],
235
+ ["Try-Tiny", nil, ["LICENCE"]],
236
+ ["Module-Metadata", nil, ["LICENCE"]],
237
+ ["constant", nil, ["README"]],
238
+ ["Module-Runtime", nil, ["README"]],
239
+ ["ExtUtils-Install", nil, ["README"]],
240
+ ["File-Path", nil, ["README"]],
241
+ ["Getopt-Long", "Perl-5", ["README"]],
242
+ ["ExtUtils-ParseXS", "Perl-5", ["README"]],
243
+ ["version", nil, ["README"]],
244
+ ["Data-Dumper", "Perl-5", ["Dumper.pm"]],
245
+ ["Test-Harness", nil, ["README"]],
246
+ ["Text-ParseWords", nil, ["README"]],
247
+ ["Devel-GlobalDestruction", nil, ["README"]],
248
+ ["XSLoader", nil, ["README"]],
249
+ ["IPC-Cmd", nil, ["README"]],
250
+ ["Pod-Parser", "Perl-5", ["README"]],
251
+ ["Config-GitLike", nil, ["lib/Config/GitLike.pm"]],
252
+ ["Test-Exception", nil, ["lib/Test/Exception.pm"]],
253
+ ["MooX-Types-MooseLike", nil, ["README"]],
254
+ ["String-ShellQuote", "Perl-5", ["README"]],
255
+ ["Time-HiRes", nil, ["README"]],
256
+ ["Test", "Perl-5", ["README"]],
257
+ ["parent", nil, ["lib/parent.pm"]],
258
+ ["MIME-Base64", nil, ["README"]],
259
+ ["Sub-Identify", nil, ["lib/Sub/Identify.pm"]],
260
+ ["namespace-autoclean", nil, ["README"]],
261
+ ["B-Hooks-EndOfScope", nil, ["README"]],
262
+ ["namespace-clean", nil, ["lib/namespace/clean.pm"]],
263
+ ["Test-Deep", nil, ["lib/Test/Deep.pm"]],
264
+ ["IO-Pager", "Perl-5", ["README"]],
265
+ ["libintl-perl", "GPL-3.0", ["COPYING"]],
266
+ ["Storable", "Perl-5", ["README"]],
267
+ ["Test-Warnings", "Artistic-1.0", ["LICENCE"]],
268
+ ["Test-Dir", nil, ["README"]],
269
+ ["Digest-SHA", nil, ["README"]],
270
+ ["Test-File-Contents", nil, ["README"]],
271
+ ["Digest-MD5", nil, ["README"]],
272
+ ["Algorithm-Diff", "Perl-5", ["lib/Algorithm/Diff.pm"]],
273
+ ["Encode-Locale", nil, ["README"]],
274
+ ["Hash-Merge", nil, ["README"]],
275
+ ["Clone", nil, ["README"]],
276
+ ["URI-db", nil, ["README"]],
277
+ ["URI-Nested", nil, ["README.md"]],
278
+ ["Test-utf8", nil, ["README"]],
279
+
280
+ ].each do |override_data|
281
+ override_license "perl_cpan", override_data[0] do |version|
282
+ {}.tap do |d|
283
+ d[:license] = override_data[1] if override_data[1]
284
+ d[:license_files] = override_data[2] if override_data[2]
285
+ end
286
+ end
287
+ end
288
+
289
+ [
290
+ ["sync", "MIT", ["https://raw.githubusercontent.com/rustyio/sync/11df81d196eaab2d84caa3fbe8def5d476ef79d8/src/sync.erl"]],
291
+ ["rebar_vsn_plugin", "Apache-2.0", ["https://raw.githubusercontent.com/erlware/rebar_vsn_plugin/master/src/rebar_vsn_plugin.erl"]],
292
+ ["edown", "Erlang-Public", ["https://raw.githubusercontent.com/seth/edown/master/NOTICE"]],
293
+ ["bcrypt", "Multiple", ["https://github.com/chef/erlang-bcrypt/blob/master/LICENSE"]],
294
+ ["amqp_client", "MPL-2.0", ["https://raw.githubusercontent.com/seth/amqp_client/7622ad8093a41b7288a1aa44dd16d3e92ce8f833/src/amqp_connection.erl"]],
295
+ ["erlsom", "LGPL-3.0", ["https://raw.githubusercontent.com/willemdj/erlsom/c5ca9fca1257f563d78b048e35ac60832ec80584/COPYING", "https://raw.githubusercontent.com/willemdj/erlsom/c5ca9fca1257f563d78b048e35ac60832ec80584/COPYING.LESSER"]],
296
+ ["gen_server2", "Public-Domain", ["https://raw.githubusercontent.com/mdaguete/gen_server2/master/README.md"]],
297
+ ["opscoderl_folsom", "Apache-2.0", ["https://raw.githubusercontent.com/chef/opscoderl_folsom/master/README.md"]],
298
+ ["quickrand", "BSD-2-Clause", ["https://raw.githubusercontent.com/okeuday/quickrand/master/README.markdown"]],
299
+ ["rabbit_common", "MPL-2.0", ["https://raw.githubusercontent.com/muxspace/rabbit_common/master/include/rabbit_msg_store.hrl"]],
300
+ ["uuid", "BSD-2-Clause", ["https://raw.githubusercontent.com/okeuday/uuid/master/README.markdown"]],
301
+ ["ibrowse", "BSD-2-Clause", nil],
302
+ ].each do |override_data|
303
+ override_license "erlang_rebar", override_data[0] do |version|
304
+ {}.tap do |d|
305
+ d[:license] = override_data[1] if override_data[1]
306
+ d[:license_files] = override_data[2] if override_data[2]
307
+ end
308
+ end
309
+ end
146
310
  end
147
311
 
148
312
  end
@@ -0,0 +1,90 @@
1
+ #
2
+ # Copyright:: Copyright 2016, Chef Software Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require "ffi_yajl"
19
+
20
+ require "license_scout/exceptions"
21
+
22
+ module LicenseScout
23
+ class Reporter
24
+
25
+ attr_reader :output_directory
26
+
27
+ def initialize(output_directory)
28
+ @output_directory = output_directory
29
+ end
30
+
31
+ def report
32
+ report = []
33
+
34
+ license_manifest_path = find_license_manifest!
35
+
36
+ license_report = FFI_Yajl::Parser.parse(File.read(license_manifest_path))
37
+
38
+ license_report["dependency_managers"].each do |dependency_manager, dependencies|
39
+ dependencies.each do |dependency|
40
+ if dependency["name"].nil? || dependency["name"].empty?
41
+ report << "There is a dependency with a missing name in '#{dependency_manager}'."
42
+ end
43
+
44
+ if dependency["version"].nil? || dependency["version"].empty?
45
+ report << "Dependency '#{dependency["name"]}' under '#{dependency_manager}' is missing version information."
46
+ end
47
+
48
+ if dependency["license"].nil? || dependency["license"].empty?
49
+ report << "Dependency '#{dependency["name"]}' version '#{dependency["version"]}' under '#{dependency_manager}' is missing license information."
50
+ end
51
+
52
+ if dependency["license_files"].empty?
53
+ report << "Dependency '#{dependency["name"]}' version '#{dependency["version"]}' under '#{dependency_manager}' is missing license files information."
54
+ else
55
+ dependency["license_files"].each do |license_file|
56
+ if !File.exist?(full_path_for(license_file))
57
+ report << "License file '#{license_file}' for the dependency '#{dependency["name"]}' version '#{dependency["version"]}' under '#{dependency_manager}' is missing."
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ report
65
+ end
66
+
67
+ def find_license_manifest!
68
+ if !File.exist?(output_directory)
69
+ raise LicenseScout::Exceptions::InvalidOutputReport.new("Output directory '#{output_directory}' does not exist.")
70
+ end
71
+
72
+ manifests = Dir.glob("#{output_directory}/*-dependency-licenses.json")
73
+
74
+ if manifests.empty?
75
+ raise LicenseScout::Exceptions::InvalidOutputReport.new("Can not find a dependency license manifest under '#{output_directory}'.")
76
+ end
77
+
78
+ if manifests.length != 1
79
+ raise LicenseScout::Exceptions::InvalidOutputReport.new("Found multiple manifests '#{manifests.join(", ")}' under '#{output_directory}'.")
80
+ end
81
+
82
+ manifests.first
83
+ end
84
+
85
+ def full_path_for(license_file_info)
86
+ File.join(output_directory, license_file_info)
87
+ end
88
+
89
+ end
90
+ end
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module LicenseScout
19
- VERSION = "0.1.0"
19
+ VERSION = "0.1.1"
20
20
  end
@@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.add_dependency "ffi-yajl", "~> 2.2"
39
39
  spec.add_dependency "mixlib-shellout", "~> 2.2"
40
+ spec.add_dependency "berkshelf", "~> 4.3"
40
41
 
41
42
  spec.add_development_dependency "bundler", "~> 1.12"
42
43
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license_scout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serdar Sutay
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-16 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi-yajl
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: berkshelf
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.3'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -124,15 +138,19 @@ files:
124
138
  - LICENSE
125
139
  - README.md
126
140
  - Rakefile
141
+ - bin/config_to_json
127
142
  - bin/license_scout
128
143
  - lib/license_scout.rb
129
144
  - lib/license_scout/collector.rb
130
145
  - lib/license_scout/dependency.rb
131
146
  - lib/license_scout/dependency_manager.rb
132
147
  - lib/license_scout/dependency_manager/base.rb
148
+ - lib/license_scout/dependency_manager/berkshelf.rb
133
149
  - lib/license_scout/dependency_manager/bundler.rb
134
150
  - lib/license_scout/dependency_manager/bundler/LICENSE.md
135
151
  - lib/license_scout/dependency_manager/bundler/_bundler_script.rb
152
+ - lib/license_scout/dependency_manager/cpan.rb
153
+ - lib/license_scout/dependency_manager/json/README.md
136
154
  - lib/license_scout/dependency_manager/rebar.rb
137
155
  - lib/license_scout/exceptions.rb
138
156
  - lib/license_scout/license_file_analyzer.rb
@@ -161,6 +179,7 @@ files:
161
179
  - lib/license_scout/net_fetcher.rb
162
180
  - lib/license_scout/options.rb
163
181
  - lib/license_scout/overrides.rb
182
+ - lib/license_scout/reporter.rb
164
183
  - lib/license_scout/version.rb
165
184
  - license_scout.gemspec
166
185
  homepage: https://github.com/chef/license_scout