license_finder 2.0.0.rc2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/CHANGELOG.rdoc +16 -9
- data/CONTRIBUTING.md +3 -3
- data/README.md +4 -1
- data/TODO.md +6 -19
- data/bin/license_finder_pip.py +2 -2
- data/features/features/cli_spec.rb +18 -18
- data/features/features/configure/add_dependencies_spec.rb +16 -16
- data/features/features/configure/approve_dependencies_spec.rb +10 -9
- data/features/features/configure/assign_licenses_spec.rb +8 -8
- data/features/features/configure/ignore_dependencies_spec.rb +15 -15
- data/features/features/configure/ignore_groups_spec.rb +15 -15
- data/features/features/configure/name_project_spec.rb +15 -14
- data/features/features/configure/whitelist_licenses_spec.rb +21 -21
- data/features/features/package_managers/bower_spec.rb +3 -3
- data/features/features/package_managers/cocoapods_spec.rb +4 -4
- data/features/features/package_managers/gradle_spec.rb +3 -3
- data/features/features/package_managers/maven_spec.rb +3 -3
- data/features/features/package_managers/npm_spec.rb +3 -3
- data/features/features/package_managers/pip_spec.rb +3 -3
- data/features/features/report/csv_spec.rb +9 -8
- data/features/features/report/html_spec.rb +13 -12
- data/features/support/testing_dsl.rb +1 -1
- data/lib/license_finder.rb +1 -16
- data/lib/license_finder/cli/approvals.rb +3 -4
- data/lib/license_finder/cli/base.rb +40 -3
- data/lib/license_finder/cli/dependencies.rb +3 -3
- data/lib/license_finder/cli/main.rb +7 -25
- data/lib/license_finder/cli/makes_decisions.rb +2 -20
- data/lib/license_finder/cli/patched_thor.rb +0 -2
- data/lib/license_finder/cli/whitelist.rb +6 -8
- data/lib/license_finder/configuration.rb +1 -1
- data/lib/license_finder/core.rb +68 -0
- data/lib/license_finder/decision_applier.rb +10 -7
- data/lib/license_finder/license.rb +10 -10
- data/lib/license_finder/license/template.rb +3 -2
- data/lib/license_finder/logger.rb +2 -6
- data/lib/license_finder/package.rb +25 -44
- data/lib/license_finder/package_manager.rb +11 -13
- data/lib/license_finder/package_managers/bower.rb +1 -1
- data/lib/license_finder/package_managers/bundler.rb +1 -1
- data/lib/license_finder/package_managers/cocoa_pods.rb +3 -3
- data/lib/license_finder/package_managers/cocoa_pods_package.rb +3 -3
- data/lib/license_finder/package_managers/gradle.rb +2 -2
- data/lib/license_finder/package_managers/maven.rb +2 -2
- data/lib/license_finder/package_managers/npm.rb +1 -1
- data/lib/license_finder/package_managers/pip.rb +1 -1
- data/lib/license_finder/package_managers/pip_package.rb +6 -4
- data/lib/license_finder/packages/activation.rb +54 -0
- data/lib/license_finder/{possible_license_files.rb → packages/license_files.rb} +9 -7
- data/lib/license_finder/packages/licensing.rb +43 -0
- data/lib/license_finder/{package_managers → packages}/manual_package.rb +0 -0
- data/lib/license_finder/{possible_license_file.rb → packages/possible_license_file.rb} +0 -2
- data/lib/license_finder/version.rb +1 -1
- data/spec/fixtures/{license_directory/LICENSE/Apache.txt → all_pms/Gemfile} +0 -0
- data/spec/fixtures/all_pms/Podfile +0 -0
- data/spec/fixtures/all_pms/bower.json +0 -0
- data/spec/fixtures/all_pms/build.gradle +0 -0
- data/spec/fixtures/all_pms/package.json +0 -0
- data/spec/fixtures/all_pms/pom.xml +0 -0
- data/spec/fixtures/all_pms/requirements.txt +0 -0
- data/spec/fixtures/license_directory/COPYING +1 -0
- data/spec/fixtures/license_directory/LICENSE/MIT.txt +1 -0
- data/spec/fixtures/license_names/COPYING.txt +1 -0
- data/spec/fixtures/license_names/LICENSE +1 -0
- data/spec/fixtures/license_names/Licence.rdoc +1 -0
- data/spec/fixtures/license_names/Mit-License +1 -0
- data/spec/fixtures/license_names/README.rdoc +1 -0
- data/spec/fixtures/nested_gem/vendor/LICENSE +1 -0
- data/spec/lib/license_finder/cli/approvals_spec.rb +9 -3
- data/spec/lib/license_finder/cli/dependencies_spec.rb +5 -2
- data/spec/lib/license_finder/cli/main_spec.rb +20 -27
- data/spec/lib/license_finder/configuration_spec.rb +1 -3
- data/spec/lib/license_finder/decision_applier_spec.rb +15 -15
- data/spec/lib/license_finder/decisions_spec.rb +94 -95
- data/spec/lib/license_finder/license_spec.rb +5 -5
- data/spec/lib/license_finder/package_managers/bower_package_spec.rb +0 -4
- data/spec/lib/license_finder/package_managers/bower_spec.rb +6 -27
- data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +0 -2
- data/spec/lib/license_finder/package_managers/bundler_spec.rb +0 -15
- data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +5 -2
- data/spec/lib/license_finder/package_managers/cocoa_pods_spec.rb +13 -31
- data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +0 -2
- data/spec/lib/license_finder/package_managers/gradle_spec.rb +11 -35
- data/spec/lib/license_finder/package_managers/maven_package_spec.rb +0 -2
- data/spec/lib/license_finder/package_managers/maven_spec.rb +18 -56
- data/spec/lib/license_finder/package_managers/npm_package_spec.rb +0 -2
- data/spec/lib/license_finder/package_managers/npm_spec.rb +0 -17
- data/spec/lib/license_finder/package_managers/pip_package_spec.rb +0 -2
- data/spec/lib/license_finder/package_managers/pip_spec.rb +8 -25
- data/spec/lib/license_finder/package_spec.rb +2 -4
- data/spec/lib/license_finder/packages/activation_spec.rb +47 -0
- data/spec/lib/license_finder/{possible_license_files_spec.rb → packages/license_files_spec.rb} +2 -6
- data/spec/lib/license_finder/packages/licensing_spec.rb +1 -0
- data/spec/lib/license_finder/{possible_license_file_spec.rb → packages/possible_license_file_spec.rb} +0 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/shared_examples_for_package_manager.rb +14 -1
- data/spec/support/test_fixtures.rb +7 -0
- metadata +117 -12
- data/spec/support/shared_examples_for_package.rb +0 -35
@@ -11,8 +11,8 @@ module LicenseFinder
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def stub_pypi(name, version, response)
|
14
|
-
stub_request(:get, "https://pypi.python.org/pypi/#{name}/#{version}/json")
|
15
|
-
to_return(response)
|
14
|
+
stub_request(:get, "https://pypi.python.org/pypi/#{name}/#{version}/json")
|
15
|
+
.to_return(response)
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'fetches data from pip' do
|
@@ -23,41 +23,24 @@ module LicenseFinder
|
|
23
23
|
stub_pypi("jasmine", "1.3.1", status: 200, body: '{}')
|
24
24
|
stub_pypi("jasmine-core", "1.3.1", status: 200, body: '{}')
|
25
25
|
|
26
|
-
current_packages
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
expect(pip.current_packages.map { |p| [p.name, p.version, p.install_path] }).to eq [
|
27
|
+
["jasmine", "1.3.1", "jasmine/path/jasmine"],
|
28
|
+
["jasmine-core", "1.3.1", "jasmine-core/path/jasmine-core"]
|
29
|
+
]
|
30
30
|
end
|
31
31
|
|
32
32
|
it "fetches data from pypi" do
|
33
33
|
stub_pip [{"name" => "jasmine", "version" => "1.3.1", "location" => "jasmine/path"}].to_json
|
34
34
|
stub_pypi("jasmine", "1.3.1", status: 200, body: JSON.generate(info: {summary: "A summary"}))
|
35
35
|
|
36
|
-
expect(
|
37
|
-
pip.current_packages
|
36
|
+
expect(pip.current_packages.first.summary).to eq "A summary"
|
38
37
|
end
|
39
38
|
|
40
39
|
it "ignores pypi if it can't find useful info" do
|
41
40
|
stub_pip [{"name" => "jasmine", "version" => "1.3.1", "location" => "jasmine/path"}].to_json
|
42
41
|
stub_pypi("jasmine", "1.3.1", status: 404, body: '')
|
43
42
|
|
44
|
-
expect(
|
45
|
-
pip.current_packages
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe '.active?' do
|
50
|
-
let(:package_path) { double(:requirements_file) }
|
51
|
-
let(:pip) { Pip.new package_path: package_path }
|
52
|
-
|
53
|
-
it 'is true with a requirements.txt file' do
|
54
|
-
allow(package_path).to receive_messages(:exist? => true)
|
55
|
-
expect(pip).to be_active
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'is false without a requirements.txt file' do
|
59
|
-
allow(package_path).to receive_messages(:exist? => false)
|
60
|
-
expect(pip).to_not be_active
|
43
|
+
expect(pip.current_packages.first.summary).to eq ""
|
61
44
|
end
|
62
45
|
end
|
63
46
|
end
|
@@ -16,8 +16,6 @@ module LicenseFinder
|
|
16
16
|
)
|
17
17
|
end
|
18
18
|
|
19
|
-
it_behaves_like "a Package"
|
20
|
-
|
21
19
|
its(:name) { should == "a package" }
|
22
20
|
its(:version) { should == "1.3.1" }
|
23
21
|
its(:summary) { should == "a summary" }
|
@@ -46,8 +44,8 @@ module LicenseFinder
|
|
46
44
|
license_files = license_names.map do |license_name|
|
47
45
|
double(:file, license: License.find_by_name(license_name), path: "some/path")
|
48
46
|
end
|
49
|
-
allow(
|
50
|
-
|
47
|
+
allow(LicenseFiles).to receive(:find).with("some/package/path")
|
48
|
+
.and_return(license_files)
|
51
49
|
end
|
52
50
|
|
53
51
|
it "are not required" do
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module LicenseFinder
|
4
|
+
describe Activation do
|
5
|
+
let(:package) { Package.new("p", nil) }
|
6
|
+
let(:license) { License.find_by_name("l") }
|
7
|
+
|
8
|
+
it "reports that a license has been activated for a package" do
|
9
|
+
subject = Activation::Basic.new(package, license)
|
10
|
+
expect(subject.package).to eq package
|
11
|
+
expect(subject.license).to eq license
|
12
|
+
end
|
13
|
+
|
14
|
+
describe Activation::FromDecision do
|
15
|
+
it "logs that it came from a decision" do
|
16
|
+
activation = described_class.new(package, license)
|
17
|
+
subject = capture_stdout { activation.log(Logger::Verbose.new) }
|
18
|
+
expect(subject).to eq "LicenseFinder::Package: package p: found license 'l' from decision\n"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe Activation::FromSpec do
|
23
|
+
it "logs that it came from a spec" do
|
24
|
+
activation = described_class.new(package, license)
|
25
|
+
subject = capture_stdout { activation.log(Logger::Verbose.new) }
|
26
|
+
expect(subject).to eq "LicenseFinder::Package: package p: found license 'l' from spec\n"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe Activation::FromFiles do
|
31
|
+
it "logs that it came from some files" do
|
32
|
+
files = [double(:file, path: "x"), double(:file, path: "y")]
|
33
|
+
activation = described_class.new(package, license, files)
|
34
|
+
subject = capture_stdout { activation.log(Logger::Verbose.new) }
|
35
|
+
expect(subject).to eq "LicenseFinder::Package: package p: found license 'l' from file 'x'\nLicenseFinder::Package: package p: found license 'l' from file 'y'\n"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe Activation::None do
|
40
|
+
it "logs that no licenses could be found" do
|
41
|
+
activation = described_class.new(package, license)
|
42
|
+
subject = capture_stdout { activation.log(Logger::Verbose.new) }
|
43
|
+
expect(subject).to eq "LicenseFinder::Package: package p: no licenses found\n"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/lib/license_finder/{possible_license_files_spec.rb → packages/license_files_spec.rb}
RENAMED
@@ -1,11 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module LicenseFinder
|
4
|
-
describe
|
5
|
-
def fixture_path(fixture)
|
6
|
-
Pathname.new(__FILE__).dirname.join('..', '..', 'fixtures', fixture)
|
7
|
-
end
|
8
|
-
|
4
|
+
describe LicenseFiles do
|
9
5
|
describe "#find" do
|
10
6
|
def files_in(fixture)
|
11
7
|
root_path = fixture_path(fixture)
|
@@ -38,7 +34,7 @@ module LicenseFinder
|
|
38
34
|
it "includes files nested inside LICENSE directory" do
|
39
35
|
expect(files_in('license_directory')).to match_array(%w[
|
40
36
|
COPYING
|
41
|
-
LICENSE/
|
37
|
+
LICENSE/MIT.txt
|
42
38
|
])
|
43
39
|
end
|
44
40
|
|
@@ -0,0 +1 @@
|
|
1
|
+
# tested via Package#licenses
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module LicenseFinder
|
2
2
|
shared_examples "a PackageManager" do
|
3
|
+
let(:all_pms) { fixture_path("all_pms") }
|
4
|
+
|
3
5
|
it { expect(described_class.ancestors).to include PackageManager }
|
4
6
|
it { expect(PackageManager.package_managers).to include described_class }
|
5
7
|
|
@@ -8,9 +10,20 @@ module LicenseFinder
|
|
8
10
|
logger = double(:logger)
|
9
11
|
expect(logger).to receive(:active)
|
10
12
|
|
11
|
-
subject = described_class.new logger: logger
|
13
|
+
subject = described_class.new logger: logger, project_path: all_pms
|
12
14
|
subject.active?
|
13
15
|
end
|
14
16
|
end
|
17
|
+
|
18
|
+
describe '.active?' do
|
19
|
+
it 'is true when package manager file exists' do
|
20
|
+
expect(described_class.new(project_path: all_pms)).to be_active
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'is false without a package manager file' do
|
24
|
+
no_pms = fixture_path("not/a/path")
|
25
|
+
expect(described_class.new(project_path: no_pms)).to_not be_active
|
26
|
+
end
|
27
|
+
end
|
15
28
|
end
|
16
29
|
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: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Maine
|
@@ -20,7 +20,7 @@ authors:
|
|
20
20
|
autorequire:
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
|
-
date: 2015-
|
23
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
@@ -176,6 +176,20 @@ dependencies:
|
|
176
176
|
- - "~>"
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '1.13'
|
179
|
+
- !ruby/object:Gem::Dependency
|
180
|
+
name: cocoapods
|
181
|
+
requirement: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
type: :development
|
187
|
+
prerelease: false
|
188
|
+
version_requirements: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
179
193
|
description: |2
|
180
194
|
LicenseFinder works with your package managers to find
|
181
195
|
dependencies, detect the licenses of the packages in them, compare
|
@@ -236,6 +250,7 @@ files:
|
|
236
250
|
- lib/license_finder/cli/project_name.rb
|
237
251
|
- lib/license_finder/cli/whitelist.rb
|
238
252
|
- lib/license_finder/configuration.rb
|
253
|
+
- lib/license_finder/core.rb
|
239
254
|
- lib/license_finder/decision_applier.rb
|
240
255
|
- lib/license_finder/decisions.rb
|
241
256
|
- lib/license_finder/license.rb
|
@@ -267,16 +282,18 @@ files:
|
|
267
282
|
- lib/license_finder/package_managers/cocoa_pods_package.rb
|
268
283
|
- lib/license_finder/package_managers/gradle.rb
|
269
284
|
- lib/license_finder/package_managers/gradle_package.rb
|
270
|
-
- lib/license_finder/package_managers/manual_package.rb
|
271
285
|
- lib/license_finder/package_managers/maven.rb
|
272
286
|
- lib/license_finder/package_managers/maven_package.rb
|
273
287
|
- lib/license_finder/package_managers/npm.rb
|
274
288
|
- lib/license_finder/package_managers/npm_package.rb
|
275
289
|
- lib/license_finder/package_managers/pip.rb
|
276
290
|
- lib/license_finder/package_managers/pip_package.rb
|
291
|
+
- lib/license_finder/packages/activation.rb
|
292
|
+
- lib/license_finder/packages/license_files.rb
|
293
|
+
- lib/license_finder/packages/licensing.rb
|
294
|
+
- lib/license_finder/packages/manual_package.rb
|
295
|
+
- lib/license_finder/packages/possible_license_file.rb
|
277
296
|
- lib/license_finder/platform.rb
|
278
|
-
- lib/license_finder/possible_license_file.rb
|
279
|
-
- lib/license_finder/possible_license_files.rb
|
280
297
|
- lib/license_finder/report.rb
|
281
298
|
- lib/license_finder/reports/csv_report.rb
|
282
299
|
- lib/license_finder/reports/erb_report.rb
|
@@ -290,9 +307,16 @@ files:
|
|
290
307
|
- license_finder.gemspec
|
291
308
|
- release/instructions.md
|
292
309
|
- spec/feature_helper.rb
|
310
|
+
- spec/fixtures/all_pms/Gemfile
|
311
|
+
- spec/fixtures/all_pms/Podfile
|
312
|
+
- spec/fixtures/all_pms/bower.json
|
313
|
+
- spec/fixtures/all_pms/build.gradle
|
314
|
+
- spec/fixtures/all_pms/package.json
|
315
|
+
- spec/fixtures/all_pms/pom.xml
|
316
|
+
- spec/fixtures/all_pms/requirements.txt
|
293
317
|
- spec/fixtures/config/license_finder.yml
|
294
318
|
- spec/fixtures/license_directory/COPYING
|
295
|
-
- spec/fixtures/license_directory/LICENSE/
|
319
|
+
- spec/fixtures/license_directory/LICENSE/MIT.txt
|
296
320
|
- spec/fixtures/license_names/COPYING.txt
|
297
321
|
- spec/fixtures/license_names/LICENSE
|
298
322
|
- spec/fixtures/license_names/Licence.rdoc
|
@@ -329,16 +353,18 @@ files:
|
|
329
353
|
- spec/lib/license_finder/package_managers/pip_package_spec.rb
|
330
354
|
- spec/lib/license_finder/package_managers/pip_spec.rb
|
331
355
|
- spec/lib/license_finder/package_spec.rb
|
332
|
-
- spec/lib/license_finder/
|
333
|
-
- spec/lib/license_finder/
|
356
|
+
- spec/lib/license_finder/packages/activation_spec.rb
|
357
|
+
- spec/lib/license_finder/packages/license_files_spec.rb
|
358
|
+
- spec/lib/license_finder/packages/licensing_spec.rb
|
359
|
+
- spec/lib/license_finder/packages/possible_license_file_spec.rb
|
334
360
|
- spec/lib/license_finder/reports/csv_report_spec.rb
|
335
361
|
- spec/lib/license_finder/reports/html_report_spec.rb
|
336
362
|
- spec/lib/license_finder/reports/markdown_report_spec.rb
|
337
363
|
- spec/lib/license_finder/reports/text_report_spec.rb
|
338
364
|
- spec/spec_helper.rb
|
339
|
-
- spec/support/shared_examples_for_package.rb
|
340
365
|
- spec/support/shared_examples_for_package_manager.rb
|
341
366
|
- spec/support/stdout_helpers.rb
|
367
|
+
- spec/support/test_fixtures.rb
|
342
368
|
homepage: https://github.com/pivotal/LicenseFinder
|
343
369
|
licenses:
|
344
370
|
- MIT
|
@@ -354,13 +380,92 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
354
380
|
version: 1.9.3
|
355
381
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
356
382
|
requirements:
|
357
|
-
- - "
|
383
|
+
- - ">="
|
358
384
|
- !ruby/object:Gem::Version
|
359
|
-
version:
|
385
|
+
version: '0'
|
360
386
|
requirements: []
|
361
387
|
rubyforge_project:
|
362
388
|
rubygems_version: 2.2.2
|
363
389
|
signing_key:
|
364
390
|
specification_version: 4
|
365
391
|
summary: Audit the OSS licenses of your application's dependencies.
|
366
|
-
test_files:
|
392
|
+
test_files:
|
393
|
+
- features/features/cli_spec.rb
|
394
|
+
- features/features/configure/add_dependencies_spec.rb
|
395
|
+
- features/features/configure/approve_dependencies_spec.rb
|
396
|
+
- features/features/configure/assign_licenses_spec.rb
|
397
|
+
- features/features/configure/ignore_dependencies_spec.rb
|
398
|
+
- features/features/configure/ignore_groups_spec.rb
|
399
|
+
- features/features/configure/name_project_spec.rb
|
400
|
+
- features/features/configure/whitelist_licenses_spec.rb
|
401
|
+
- features/features/package_managers/bower_spec.rb
|
402
|
+
- features/features/package_managers/cocoapods_spec.rb
|
403
|
+
- features/features/package_managers/gradle_spec.rb
|
404
|
+
- features/features/package_managers/maven_spec.rb
|
405
|
+
- features/features/package_managers/npm_spec.rb
|
406
|
+
- features/features/package_managers/pip_spec.rb
|
407
|
+
- features/features/report/csv_spec.rb
|
408
|
+
- features/features/report/html_spec.rb
|
409
|
+
- features/fixtures/Podfile
|
410
|
+
- features/fixtures/build.gradle
|
411
|
+
- features/fixtures/pom.xml
|
412
|
+
- features/support/testing_dsl.rb
|
413
|
+
- spec/feature_helper.rb
|
414
|
+
- spec/fixtures/all_pms/Gemfile
|
415
|
+
- spec/fixtures/all_pms/Podfile
|
416
|
+
- spec/fixtures/all_pms/bower.json
|
417
|
+
- spec/fixtures/all_pms/build.gradle
|
418
|
+
- spec/fixtures/all_pms/package.json
|
419
|
+
- spec/fixtures/all_pms/pom.xml
|
420
|
+
- spec/fixtures/all_pms/requirements.txt
|
421
|
+
- spec/fixtures/config/license_finder.yml
|
422
|
+
- spec/fixtures/license_directory/COPYING
|
423
|
+
- spec/fixtures/license_directory/LICENSE/MIT.txt
|
424
|
+
- spec/fixtures/license_names/COPYING.txt
|
425
|
+
- spec/fixtures/license_names/LICENSE
|
426
|
+
- spec/fixtures/license_names/Licence.rdoc
|
427
|
+
- spec/fixtures/license_names/Mit-License
|
428
|
+
- spec/fixtures/license_names/README.rdoc
|
429
|
+
- spec/fixtures/nested_gem/vendor/LICENSE
|
430
|
+
- spec/fixtures/utf8_gem/README
|
431
|
+
- spec/lib/license_finder/cli/approvals_spec.rb
|
432
|
+
- spec/lib/license_finder/cli/dependencies_spec.rb
|
433
|
+
- spec/lib/license_finder/cli/ignored_dependencies_spec.rb
|
434
|
+
- spec/lib/license_finder/cli/ignored_groups_spec.rb
|
435
|
+
- spec/lib/license_finder/cli/licenses_spec.rb
|
436
|
+
- spec/lib/license_finder/cli/main_spec.rb
|
437
|
+
- spec/lib/license_finder/cli/project_name_spec.rb
|
438
|
+
- spec/lib/license_finder/cli/whitelist_spec.rb
|
439
|
+
- spec/lib/license_finder/configuration_spec.rb
|
440
|
+
- spec/lib/license_finder/decision_applier_spec.rb
|
441
|
+
- spec/lib/license_finder/decisions_spec.rb
|
442
|
+
- spec/lib/license_finder/license/definitions_spec.rb
|
443
|
+
- spec/lib/license_finder/license_spec.rb
|
444
|
+
- spec/lib/license_finder/package_manager_spec.rb
|
445
|
+
- spec/lib/license_finder/package_managers/bower_package_spec.rb
|
446
|
+
- spec/lib/license_finder/package_managers/bower_spec.rb
|
447
|
+
- spec/lib/license_finder/package_managers/bundler_package_spec.rb
|
448
|
+
- spec/lib/license_finder/package_managers/bundler_spec.rb
|
449
|
+
- spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb
|
450
|
+
- spec/lib/license_finder/package_managers/cocoa_pods_spec.rb
|
451
|
+
- spec/lib/license_finder/package_managers/gradle_package_spec.rb
|
452
|
+
- spec/lib/license_finder/package_managers/gradle_spec.rb
|
453
|
+
- spec/lib/license_finder/package_managers/maven_package_spec.rb
|
454
|
+
- spec/lib/license_finder/package_managers/maven_spec.rb
|
455
|
+
- spec/lib/license_finder/package_managers/npm_package_spec.rb
|
456
|
+
- spec/lib/license_finder/package_managers/npm_spec.rb
|
457
|
+
- spec/lib/license_finder/package_managers/pip_package_spec.rb
|
458
|
+
- spec/lib/license_finder/package_managers/pip_spec.rb
|
459
|
+
- spec/lib/license_finder/package_spec.rb
|
460
|
+
- spec/lib/license_finder/packages/activation_spec.rb
|
461
|
+
- spec/lib/license_finder/packages/license_files_spec.rb
|
462
|
+
- spec/lib/license_finder/packages/licensing_spec.rb
|
463
|
+
- spec/lib/license_finder/packages/possible_license_file_spec.rb
|
464
|
+
- spec/lib/license_finder/reports/csv_report_spec.rb
|
465
|
+
- spec/lib/license_finder/reports/html_report_spec.rb
|
466
|
+
- spec/lib/license_finder/reports/markdown_report_spec.rb
|
467
|
+
- spec/lib/license_finder/reports/text_report_spec.rb
|
468
|
+
- spec/spec_helper.rb
|
469
|
+
- spec/support/shared_examples_for_package_manager.rb
|
470
|
+
- spec/support/stdout_helpers.rb
|
471
|
+
- spec/support/test_fixtures.rb
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module LicenseFinder
|
2
|
-
shared_examples "a Package" do
|
3
|
-
context "logging" do
|
4
|
-
let!(:logger) { Logger::Quiet.new }
|
5
|
-
before { allow(Logger::Default).to receive(:new) { logger } }
|
6
|
-
|
7
|
-
it "logs licenses found in specs" do
|
8
|
-
license_short_name = "foo"
|
9
|
-
license_pretty_name = "pretty foo"
|
10
|
-
license = double(:license, name: license_pretty_name)
|
11
|
-
|
12
|
-
allow(subject).to receive(:license_names_from_spec).and_return([license_short_name])
|
13
|
-
allow(License).to receive(:find_by_name).with(license_short_name) { license }
|
14
|
-
|
15
|
-
expect(logger).to receive(:license).with(anything, subject.name, license_pretty_name, "from spec")
|
16
|
-
|
17
|
-
subject.licenses_from_spec
|
18
|
-
end
|
19
|
-
|
20
|
-
it "logs licenses found in files" do
|
21
|
-
license_short_name = "foo"
|
22
|
-
license_pretty_name = "pretty foo"
|
23
|
-
license_path = "/path/to/license"
|
24
|
-
license = double(:license, name: license_pretty_name)
|
25
|
-
license_file = double(:license_file, license: license, path: license_path)
|
26
|
-
|
27
|
-
allow(subject).to receive(:license_files) { [license_file] }
|
28
|
-
|
29
|
-
expect(logger).to receive(:license).with(anything, subject.name, license_pretty_name, "from file '#{license_path}'")
|
30
|
-
|
31
|
-
subject.licenses_from_files
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|