license_finder 4.0.2 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -2
  3. data/CHANGELOG.md +16 -1
  4. data/CONTRIBUTING.md +23 -5
  5. data/Gemfile +0 -1
  6. data/README.md +6 -1
  7. data/Rakefile +2 -2
  8. data/ci/pipelines/pipeline.yml.erb +1 -1
  9. data/ci/pipelines/release.yml +14 -23
  10. data/ci/scripts/pushscript.sh +1 -2
  11. data/ci/scripts/run-rubocop.sh +1 -1
  12. data/ci/scripts/updateChangelog.sh +77 -0
  13. data/ci/tasks/build.yml +1 -1
  14. data/ci/tasks/update-changelog.yml +15 -0
  15. data/lib/license_finder/cli/base.rb +19 -13
  16. data/lib/license_finder/cli/main.rb +54 -37
  17. data/lib/license_finder/cli/makes_decisions.rb +3 -2
  18. data/lib/license_finder/configuration.rb +68 -15
  19. data/lib/license_finder/core.rb +17 -7
  20. data/lib/license_finder/decisions_factory.rb +11 -0
  21. data/lib/license_finder/license/templates/SimplifiedBSD.txt +1 -1
  22. data/lib/license_finder/license_aggregator.rb +11 -6
  23. data/lib/license_finder/logger.rb +2 -2
  24. data/lib/license_finder/package.rb +18 -16
  25. data/lib/license_finder/package_manager.rb +40 -47
  26. data/lib/license_finder/package_managers/bower.rb +8 -4
  27. data/lib/license_finder/package_managers/bundler.rb +8 -5
  28. data/lib/license_finder/package_managers/carthage.rb +4 -4
  29. data/lib/license_finder/package_managers/cocoa_pods.rb +2 -2
  30. data/lib/license_finder/package_managers/conan.rb +1 -1
  31. data/lib/license_finder/package_managers/gradle.rb +1 -1
  32. data/lib/license_finder/package_managers/maven.rb +1 -3
  33. data/lib/license_finder/package_managers/mix.rb +8 -4
  34. data/lib/license_finder/package_managers/npm.rb +5 -1
  35. data/lib/license_finder/package_managers/pip.rb +2 -2
  36. data/lib/license_finder/package_managers/rebar.rb +4 -4
  37. data/lib/license_finder/package_managers/yarn.rb +2 -2
  38. data/lib/license_finder/{packages → package_utils}/activation.rb +0 -0
  39. data/lib/license_finder/{package_managers → package_utils}/conan_info_parser.rb +1 -1
  40. data/lib/license_finder/{package_managers → package_utils}/gradle_dependency_finder.rb +0 -0
  41. data/lib/license_finder/{packages → package_utils}/license_files.rb +1 -1
  42. data/lib/license_finder/{packages → package_utils}/licensing.rb +1 -1
  43. data/lib/license_finder/{package_managers → package_utils}/maven_dependency_finder.rb +0 -0
  44. data/lib/license_finder/{packages → package_utils}/possible_license_file.rb +0 -0
  45. data/lib/license_finder/{package_managers → packages}/bower_package.rb +0 -0
  46. data/lib/license_finder/{package_managers → packages}/bundler_package.rb +0 -0
  47. data/lib/license_finder/{package_managers → packages}/carthage_package.rb +0 -0
  48. data/lib/license_finder/{package_managers → packages}/cocoa_pods_package.rb +0 -0
  49. data/lib/license_finder/{package_managers → packages}/conan_package.rb +0 -0
  50. data/lib/license_finder/{package_managers → packages}/go_package.rb +0 -0
  51. data/lib/license_finder/{package_managers → packages}/gradle_package.rb +0 -0
  52. data/lib/license_finder/{package_managers → packages}/maven_package.rb +0 -0
  53. data/lib/license_finder/packages/merged_package.rb +42 -0
  54. data/lib/license_finder/{package_managers → packages}/mix_package.rb +0 -0
  55. data/lib/license_finder/{package_managers → packages}/npm_package.rb +0 -0
  56. data/lib/license_finder/{package_managers → packages}/nuget_package.rb +0 -0
  57. data/lib/license_finder/{package_managers → packages}/pip_package.rb +0 -0
  58. data/lib/license_finder/{package_managers → packages}/rebar_package.rb +0 -0
  59. data/lib/license_finder/packages/yarn_package.rb +7 -0
  60. data/lib/license_finder/project_finder.rb +1 -1
  61. data/lib/license_finder/reports/csv_report.rb +1 -0
  62. data/lib/license_finder/reports/merged_report.rb +2 -0
  63. data/lib/license_finder/reports/templates/html_report.erb +8 -0
  64. data/lib/license_finder/reports/templates/markdown_report.erb +7 -0
  65. data/lib/license_finder/scanner.rb +38 -0
  66. data/lib/license_finder/version.rb +1 -1
  67. data/license_finder.gemspec +9 -2
  68. metadata +37 -101
  69. data/ci/tasks/get-version-and-tag.yml +0 -20
  70. data/features/features/cli/cli_spec.rb +0 -63
  71. data/features/features/configure/add_dependencies_spec.rb +0 -54
  72. data/features/features/configure/approve_dependencies_spec.rb +0 -61
  73. data/features/features/configure/assign_licenses_spec.rb +0 -35
  74. data/features/features/configure/blacklist_licenses_spec.rb +0 -30
  75. data/features/features/configure/ignore_dependencies_spec.rb +0 -35
  76. data/features/features/configure/ignore_groups_spec.rb +0 -46
  77. data/features/features/configure/name_project_spec.rb +0 -33
  78. data/features/features/configure/set_project_path_spec.rb +0 -17
  79. data/features/features/configure/whitelist_licenses_spec.rb +0 -38
  80. data/features/features/package_managers/bower_spec.rb +0 -14
  81. data/features/features/package_managers/carthage_spec.rb +0 -14
  82. data/features/features/package_managers/cocoapods_spec.rb +0 -14
  83. data/features/features/package_managers/conan_spec.rb +0 -11
  84. data/features/features/package_managers/dep_spec.rb +0 -15
  85. data/features/features/package_managers/glide_spec.rb +0 -26
  86. data/features/features/package_managers/godep_spec.rb +0 -17
  87. data/features/features/package_managers/govendor_spec.rb +0 -15
  88. data/features/features/package_managers/gradle_spec.rb +0 -34
  89. data/features/features/package_managers/gvt_spec.rb +0 -14
  90. data/features/features/package_managers/maven_spec.rb +0 -22
  91. data/features/features/package_managers/mix_spec.rb +0 -16
  92. data/features/features/package_managers/npm_spec.rb +0 -14
  93. data/features/features/package_managers/nuget_spec.rb +0 -14
  94. data/features/features/package_managers/pip_spec.rb +0 -14
  95. data/features/features/package_managers/rebar_spec.rb +0 -14
  96. data/features/features/package_managers/yarn_spec.rb +0 -14
  97. data/features/features/report/composite_spec.rb +0 -28
  98. data/features/features/report/csv_spec.rb +0 -18
  99. data/features/features/report/diff_spec.rb +0 -203
  100. data/features/features/report/html_spec.rb +0 -51
  101. data/features/features/report/java_groups_spec.rb +0 -11
  102. data/features/features/report/subproject_spec.rb +0 -63
  103. data/features/fixtures/Cartfile +0 -1
  104. data/features/fixtures/Podfile +0 -3
  105. data/features/fixtures/alternate-build-file-gradle/build-alt.gradle +0 -16
  106. data/features/fixtures/alternate-build-file-gradle/settings.gradle +0 -1
  107. data/features/fixtures/build.gradle +0 -16
  108. data/features/fixtures/conanfile.txt +0 -11
  109. data/features/fixtures/file-based-libs-gradle/build.gradle +0 -16
  110. data/features/fixtures/file-based-libs-gradle/libs/data.json-0.2.3.jar +0 -0
  111. data/features/fixtures/gopath/src/github.com/pivotal/foo/Godeps/Godeps.json +0 -16
  112. data/features/fixtures/gopath/src/github.com/pivotal/foo/Godeps/Readme +0 -5
  113. data/features/fixtures/gopath/src/github.com/pivotal/foo/foo.go +0 -6
  114. data/features/fixtures/gopath_dep/src/foo-dep/Gopkg.lock +0 -14
  115. data/features/fixtures/gopath_dep/src/foo-dep/Gopkg.toml +0 -7
  116. data/features/fixtures/gopath_dep/src/foo-dep/bar/bar.go +0 -10
  117. data/features/fixtures/gopath_dep/src/foo-dep/foo.go +0 -7
  118. data/features/fixtures/gopath_dep/src/foo-dep/vendor/a/b/LICENSE +0 -1
  119. data/features/fixtures/gopath_glide/src/glide.lock +0 -9
  120. data/features/fixtures/gopath_glide/src/glide.yaml +0 -6
  121. data/features/fixtures/gopath_glide_without_src/glide.lock +0 -9
  122. data/features/fixtures/gopath_glide_without_src/glide.yaml +0 -6
  123. data/features/fixtures/gopath_govendor/src/vendor/vendor.json +0 -19
  124. data/features/fixtures/gopath_gvt/src/vendor/manifest +0 -22
  125. data/features/fixtures/gradle-wrapper/build.gradle +0 -16
  126. data/features/fixtures/gradle-wrapper/gradlew +0 -8
  127. data/features/fixtures/gradle-wrapper/gradlew.bat +0 -9
  128. data/features/fixtures/maven-wrapper/mvnw +0 -3
  129. data/features/fixtures/maven-wrapper/mvnw.cmd +0 -7
  130. data/features/fixtures/maven-wrapper/pom.xml +0 -37
  131. data/features/fixtures/mix.exs +0 -22
  132. data/features/fixtures/multi-module-gradle/build.gradle +0 -12
  133. data/features/fixtures/multi-module-gradle/module1/build.gradle +0 -3
  134. data/features/fixtures/multi-module-gradle/module2/build.gradle +0 -3
  135. data/features/fixtures/multi-module-gradle/settings.gradle +0 -1
  136. data/features/fixtures/nuget/.nuget/.keep +0 -0
  137. data/features/fixtures/nuget/Fun.Test/packages.config +0 -4
  138. data/features/fixtures/nuget/Fun/packages.config +0 -5
  139. data/features/fixtures/pom.xml +0 -19
  140. data/features/fixtures/rebar.config +0 -12
  141. data/features/fixtures/single-module-gradle/build.gradle +0 -16
  142. data/features/support/feature_helper.rb +0 -15
  143. data/features/support/testing_dsl.rb +0 -564
  144. data/lib/license_finder/package_managers/merged_package.rb +0 -95
  145. data/license_finder-2.1.2.gem +0 -0
@@ -1,16 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Mix Dependencies' do
4
- # As an Elixir developer
5
- # I want to be able to manage Mix dependencies
6
-
7
- let(:elixir_developer) { LicenseFinder::TestingDSL::User.new }
8
-
9
- specify 'are shown in reports' do
10
- LicenseFinder::TestingDSL::MixProject.create
11
- puts 'mix project created'
12
- elixir_developer.run_license_finder
13
- expect(elixir_developer).to be_seeing_line 'fs, 0.9.1, ISC'
14
- expect(elixir_developer).to be_seeing_line 'uuid, 1.1.5, "Apache 2.0"'
15
- end
16
- end
@@ -1,14 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'NPM Dependencies' do
4
- # As a Node developer
5
- # I want to be able to manage NPM dependencies
6
-
7
- let(:node_developer) { LicenseFinder::TestingDSL::User.new }
8
-
9
- specify 'are shown in reports' do
10
- LicenseFinder::TestingDSL::NpmProject.create
11
- node_developer.run_license_finder
12
- expect(node_developer).to be_seeing_line 'http-server, 0.6.1, MIT'
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Nuget Dependencies' do
4
- # As a .NET developer
5
- # I want to be able to manage Nuget dependencies
6
-
7
- let(:dotnet_developer) { LicenseFinder::TestingDSL::User.new }
8
-
9
- specify 'are shown in reports' do
10
- LicenseFinder::TestingDSL::NugetProject.create
11
- dotnet_developer.run_license_finder 'nuget'
12
- expect(dotnet_developer).to be_seeing_line 'NUnit, 2.6.4, unknown'
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Pip Dependencies' do
4
- # As a Python developer
5
- # I want to be able to manage Pip dependencies
6
-
7
- let(:python_developer) { LicenseFinder::TestingDSL::User.new }
8
-
9
- specify 'are shown in reports' do
10
- LicenseFinder::TestingDSL::PipProject.create
11
- python_developer.run_license_finder
12
- expect(python_developer).to be_seeing_line 'rsa, 3.1.4, "ASL 2"'
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Rebar Dependencies' do
4
- # As an Erlang developer
5
- # I want to be able to manage rebar dependencies
6
-
7
- let(:erlang_developer) { LicenseFinder::TestingDSL::User.new }
8
-
9
- specify 'are shown in reports' do
10
- LicenseFinder::TestingDSL::RebarProject.create
11
- erlang_developer.run_license_finder
12
- expect(erlang_developer).to be_seeing_line 'envy, "BRANCH: master", "Apache 2.0"'
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Yarn Dependencies' do
4
- # As a Javascript developer
5
- # I want to be able to manage Yarn dependencies
6
-
7
- let(:yarn_developer) { LicenseFinder::TestingDSL::User.new }
8
-
9
- specify 'are shown in reports' do
10
- LicenseFinder::TestingDSL::YarnProject.create
11
- yarn_developer.run_license_finder
12
- expect(yarn_developer).to be_seeing_line 'http-server, 0.6.1, MIT'
13
- end
14
- end
@@ -1,28 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Composite project' do
4
- # As a non-technical product owner
5
- # I want to run license finder on a composite project
6
- # So that I can easily review all licenses used by sub-projects
7
-
8
- let(:developer) { LicenseFinder::TestingDSL::User.new }
9
-
10
- specify 'shows dependencies for all active projects' do
11
- LicenseFinder::TestingDSL::CompositeProject.create
12
- developer.execute_command('license_finder report --recursive')
13
- expect(developer).to be_seeing('junit,4.11,Common Public License Version 1.0')
14
- end
15
-
16
- specify 'shows csv report columns in the right order' do
17
- LicenseFinder::TestingDSL::CompositeProject.create
18
- developer.execute_command('license_finder report --recursive --format csv --columns name version install_path licenses')
19
- expect(developer).to be_seeing('junit,4.11,,Common Public License Version 1.0')
20
- end
21
-
22
- specify 'shows install path column when scanning recursively' do
23
- project = LicenseFinder::TestingDSL::BundlerProject.create
24
- project.install
25
- developer.execute_command('license_finder report --recursive --format csv --columns name version install_path licenses')
26
- expect(developer).to be_seeing_something_like(%r{multi_xml,0.\d+.\d+,.*\/gems\/multi_xml-0.\d+.\d+,MIT})
27
- end
28
- end
@@ -1,18 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'CSV report' do
4
- # As a non-technical product owner
5
- # I want a csv report
6
- # So that I can easily review my application's dependencies and licenses
7
-
8
- let(:developer) { LicenseFinder::TestingDSL::User.new }
9
- let(:product_owner) { LicenseFinder::TestingDSL::User.new }
10
-
11
- specify 'shows dependency data in CSV form' do
12
- developer.create_empty_project
13
- developer.execute_command 'license_finder dependencies add info_gem BSD 1.1.1'
14
-
15
- product_owner.execute_command('license_finder report --format csv --columns approved name version licenses')
16
- expect(product_owner).to be_seeing 'Not approved,info_gem,1.1.1,BSD'
17
- end
18
- end
@@ -1,203 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Diff report' do
4
- # As a non-technical product owner
5
- # I want to see the differences between two reports
6
- # So that I can easily review what changed between versions
7
-
8
- let(:developer) { LicenseFinder::TestingDSL::User.new }
9
-
10
- context 'single project reports' do
11
- specify 'shows differences between two csv reports' do
12
- project = developer.create_ruby_app
13
- project.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
14
- developer.execute_command('license_finder report --save=report-1.csv --format=csv')
15
-
16
- project.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
17
- developer.execute_command('license_finder report --save=report-2.csv --format=csv')
18
-
19
- developer.execute_command('license_finder diff report-1.csv report-2.csv')
20
-
21
- expect(developer).to be_seeing('added,bar,2.0.0,GPLv2')
22
- expect(developer).to be_seeing('unchanged,foo,1.0.0,MIT')
23
- end
24
-
25
- specify 'shows version changes between two csv reports' do
26
- project = developer.create_ruby_app
27
- project.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
28
- developer.execute_command('license_finder report --save=report-1.csv --format=csv')
29
-
30
- project.depend_on(developer.create_gem('foo', version: '2.0.0', license: 'MIT'))
31
- developer.execute_command('license_finder report --save=report-2.csv --format=csv')
32
-
33
- developer.execute_command('license_finder diff report-1.csv report-2.csv')
34
- expect(developer).to be_seeing('added,foo,2.0.0,MIT')
35
- expect(developer).to be_seeing('removed,foo,1.0.0,MIT')
36
- end
37
-
38
- specify 'shows license changes between two csv reports' do
39
- project = developer.create_ruby_app
40
- project.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
41
- developer.execute_command('license_finder report --save=report-1.csv --format=csv')
42
-
43
- project.depend_on(developer.create_gem('foo', version: '2.0.0', license: 'GPLv2'))
44
- developer.execute_command('license_finder report --save=report-2.csv --format=csv')
45
-
46
- developer.execute_command('license_finder diff report-1.csv report-2.csv')
47
- expect(developer).to be_seeing('removed,foo,1.0.0,MIT')
48
- expect(developer).to be_seeing('added,foo,2.0.0,GPLv2')
49
- end
50
- end
51
-
52
- context 'multi-project reports' do
53
- specify 'shows differences between two csv reports' do
54
- project = developer.create_empty_project
55
-
56
- # First multi-project report
57
- project1 = developer.create_ruby_app('project_1')
58
- project1.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
59
- project1.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
60
-
61
- project2 = developer.create_ruby_app('project_2')
62
- project2.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
63
- developer
64
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-1.csv --format=csv")
65
-
66
- # Second multi-project report
67
- project2.depend_on(developer.create_gem('baz', version: '3.0.0', license: 'BSD'))
68
- developer
69
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-2.csv --format=csv")
70
-
71
- # Diff the reports
72
- developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
73
-
74
- diff = IO.read(project.project_dir.join('diff.csv'))
75
- expect(diff).to include("unchanged,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
76
- expect(diff).to include("unchanged,bar,2.0.0,GPLv2,#{project1.project_dir}")
77
- expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
78
- end
79
-
80
- context 'when change affects only one file' do
81
- specify 'show version changes' do
82
- project = developer.create_empty_project
83
- # First multi-project report
84
- project1 = developer.create_ruby_app('project_1')
85
- project1.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
86
- project1.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
87
-
88
- project2 = developer.create_ruby_app('project_2')
89
- project2.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
90
- developer
91
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-1.csv --format=csv")
92
-
93
- # Second multi-project report
94
- project2.depend_on(developer.create_gem('baz', version: '3.0.0', license: 'BSD'))
95
- project1.depend_on(developer.create_gem('bar', version: '3.0.0', license: 'GPLv2'))
96
-
97
- developer
98
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-2.csv --format=csv")
99
-
100
- # Diff the reports
101
- developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
102
-
103
- diff = IO.read(project.project_dir.join('diff.csv'))
104
- expect(diff).to include("unchanged,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
105
- expect(diff).to include("added,bar,3.0.0,GPLv2,#{project1.project_dir}")
106
- expect(diff).to include("removed,bar,2.0.0,GPLv2,#{project1.project_dir}")
107
- expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
108
- end
109
-
110
- specify 'shows license changes' do
111
- project = developer.create_empty_project
112
- # First multi-project report
113
- project1 = developer.create_ruby_app('project_1')
114
- project1.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
115
- project1.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
116
-
117
- project2 = developer.create_ruby_app('project_2')
118
- project2.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
119
- developer
120
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-1.csv --format=csv")
121
-
122
- # Second multi-project report
123
- project2.depend_on(developer.create_gem('baz', version: '3.0.0', license: 'BSD'))
124
- project1.depend_on(developer.create_gem('bar', version: '3.0.0', license: 'MIT'))
125
-
126
- developer
127
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-2.csv --format=csv")
128
-
129
- # Diff the reports
130
- developer
131
- .execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
132
-
133
- diff = IO.read(project.project_dir.join('diff.csv'))
134
- expect(diff).to include("unchanged,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
135
- expect(diff).to include("removed,bar,2.0.0,GPLv2,#{project1.project_dir}")
136
- expect(diff).to include("added,bar,3.0.0,MIT,#{project1.project_dir}")
137
- expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
138
- end
139
- end
140
-
141
- context 'when change affects both files' do
142
- specify 'show licenses change when files contain exact copies of a dep' do
143
- project = developer.create_empty_project
144
- # First multi-project report
145
- project1 = developer.create_ruby_app('project_1')
146
- project1.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
147
- project1.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
148
-
149
- project2 = developer.create_ruby_app('project_2')
150
- project2.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
151
- developer
152
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-1.csv --format=csv")
153
-
154
- # Second multi-project report
155
- project2.depend_on(developer.create_gem('baz', version: '3.0.0', license: 'BSD'))
156
- project1.depend_on(developer.create_gem('foo', version: '2.0.0', license: 'BSD'))
157
-
158
- developer
159
- .execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-2.csv --format=csv")
160
-
161
- # Diff the reports
162
- developer
163
- .execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
164
-
165
- diff = IO.read(project.project_dir.join('diff.csv'))
166
- expect(diff).to include("unchanged,bar,2.0.0,GPLv2,#{project1.project_dir}")
167
- expect(diff).to include("removed,foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
168
- expect(diff).to include("added,foo,2.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
169
- expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
170
- end
171
-
172
- xspecify 'show licenses change when files do not contain exact copies of a dep' do
173
- project = developer.create_empty_project
174
- # First multi-project report
175
- project1 = developer.create_ruby_app('project_1')
176
- project1.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
177
- project1.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
178
-
179
- project2 = developer.create_ruby_app('project_2')
180
- project2.depend_on(developer.create_gem('foo', version: '2.0.0', license: 'BSD'))
181
- developer.execute_command("license_finder report --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-1.csv --format=csv")
182
-
183
- # Second multi-project report
184
- project2.depend_on(developer.create_gem('baz', version: '3.0.0', license: 'BSD'))
185
- project1.depend_on(developer.create_gem('foo', version: '2.0.0', license: 'BSD'))
186
-
187
- developer.execute_command("license_finder report --aggregate_paths=#{project1.project_dir} #{project2.project_dir} --save=report-2.csv --format=csv")
188
-
189
- # Diff the reports
190
- developer.execute_command('license_finder diff report-1.csv report-2.csv --save=diff.csv --format=csv')
191
-
192
- diff = IO.read(project.project_dir.join('diff.csv'))
193
- expect(diff).to include("removed,foo,1.0.0,MIT,#{project1.project_dir}")
194
- # expect(diff).to include("removed,foo,,2.0.0,BSD,#{project2.project_dir}")
195
- expect(diff).to include("added,foo,2.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
196
- expect(diff).to include("removed,foo,1.0.0,BSD,\"#{project1.project_dir},#{project2.project_dir}\"")
197
-
198
- expect(diff).to include("unchanged,bar,2.0.0,GPLv2,#{project1.project_dir}")
199
- expect(diff).to include("added,baz,3.0.0,BSD,#{project2.project_dir}")
200
- end
201
- end
202
- end
203
- end
@@ -1,51 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'HTML report' do
4
- # As a non-technical product owner
5
- # I want an HTML report
6
- # So that I can easily review my application's dependencies and licenses
7
-
8
- let(:developer) { LicenseFinder::TestingDSL::User.new }
9
- let(:product_owner) { LicenseFinder::TestingDSL::User.new }
10
-
11
- specify 'shows basic dependency data' do
12
- gem_name = 'a_gem'
13
- gem_group = 'test'
14
- gem_attributes = {
15
- license: 'MIT',
16
- summary: 'gem is cool',
17
- description: 'seriously',
18
- version: '0.0.1',
19
- homepage: 'http://a_gem.github.com'
20
- }
21
-
22
- project = developer.create_ruby_app
23
- gem = developer.create_gem gem_name, gem_attributes
24
- project.depend_on gem, groups: [gem_group]
25
-
26
- product_owner.view_html.in_dep(gem_name) do |section|
27
- expect(section.find("a[href='#{gem_attributes[:homepage]}']", text: gem_name)).to be
28
- expect(section).to have_content gem_attributes[:license]
29
- expect(section).to have_content gem_attributes[:summary]
30
- expect(section).to have_content gem_attributes[:description]
31
- expect(section).to have_content gem_attributes[:version]
32
- expect(section).to have_content gem_group
33
- end
34
- end
35
-
36
- specify 'shows approval status of dependencies' do
37
- developer.create_empty_project
38
- developer.execute_command 'license_finder dependencies add gpl_dep GPL'
39
- developer.execute_command 'license_finder dependencies add mit_dep MIT'
40
- developer.execute_command 'license_finder whitelist add MIT'
41
-
42
- html = product_owner.view_html
43
- expect(html).to be_unapproved 'gpl_dep'
44
- expect(html).to be_approved 'mit_dep'
45
-
46
- expect(html).to have_content '1 GPL'
47
- action_items = html.find('.action-items')
48
- expect(action_items).to have_content '(GPL)'
49
- expect(action_items).not_to have_content 'MIT'
50
- end
51
- end
@@ -1,11 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Composite project' do
4
- let(:developer) { LicenseFinder::TestingDSL::User.new }
5
-
6
- specify 'shows dependencies for all active projects' do
7
- LicenseFinder::TestingDSL::BareGradleProject.create
8
- developer.execute_command('license_finder report --gradle_include_groups')
9
- expect(developer).to be_seeing('junit:junit, 4.11, "Common Public License Version 1.0"')
10
- end
11
- end
@@ -1,63 +0,0 @@
1
- require_relative '../../support/feature_helper'
2
-
3
- describe 'Aggregate Paths Projects report' do
4
- # As a non-technical product owner
5
- # I want a single csv report that includes multiple sub-projects
6
- # So that I can easily review my composite application's dependencies and licenses
7
-
8
- let(:developer) { LicenseFinder::TestingDSL::User.new }
9
-
10
- specify 'shows specified columns' do
11
- foo10 = developer.create_gem_in_path('foo', 'v-10', version: '1.0.0', license: 'MIT', homepage: 'http://example.homepage.com')
12
-
13
- project1 = developer.create_ruby_app('project_1')
14
- project1.depend_on(foo10)
15
-
16
- developer.create_empty_project
17
- developer.execute_command("license_finder report --columns name homepage aggregate_paths --aggregate_paths #{project1.project_dir} --format=csv")
18
- expect(developer).to be_seeing_once("foo,http://example.homepage.com,#{project1.project_dir}")
19
- end
20
-
21
- specify 'shows dependencies for multiple projects' do
22
- project1 = developer.create_ruby_app('project_1')
23
- project1.depend_on(developer.create_gem('foo', version: '1.0.0', license: 'MIT'))
24
-
25
- project2 = developer.create_ruby_app('project_2')
26
- project2.depend_on(developer.create_gem('bar', version: '2.0.0', license: 'GPLv2'))
27
-
28
- developer.create_empty_project
29
- developer.execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths #{project1.project_dir} #{project2.project_dir} --format=csv")
30
- expect(developer).to be_seeing("foo,1.0.0,MIT,#{project1.project_dir}")
31
- expect(developer).to be_seeing("bar,2.0.0,GPLv2,#{project2.project_dir}")
32
- end
33
-
34
- specify 'shows duplicate dependencies only once, with list of project_paths' do
35
- foo = developer.create_gem('foo', version: '1.0.0', license: 'MIT')
36
-
37
- project1 = developer.create_ruby_app('project_1')
38
- project1.depend_on(foo)
39
-
40
- project2 = developer.create_ruby_app('project_2')
41
- project2.depend_on(foo)
42
-
43
- developer.create_empty_project
44
- developer.execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths #{project1.project_dir} #{project2.project_dir} --format=csv")
45
- expect(developer).to be_seeing_once("foo,1.0.0,MIT,\"#{project1.project_dir},#{project2.project_dir}\"")
46
- end
47
-
48
- specify 'does not mark dependencies with different versions as duplicates' do
49
- foo10 = developer.create_gem_in_path('foo', 'v-10', version: '1.0.0', license: 'MIT')
50
- foo11 = developer.create_gem_in_path('foo', 'v-11', version: '1.1.0', license: 'MIT')
51
-
52
- project1 = developer.create_ruby_app('project_1')
53
- project1.depend_on(foo10)
54
-
55
- project2 = developer.create_ruby_app('project_2')
56
- project2.depend_on(foo11)
57
-
58
- developer.create_empty_project
59
- developer.execute_command("license_finder report --columns name version licenses aggregate_paths --aggregate_paths #{project1.project_dir} #{project2.project_dir} --format=csv")
60
- expect(developer).to be_seeing_once("foo,1.0.0,MIT,#{project1.project_dir}")
61
- expect(developer).to be_seeing_once("foo,1.1.0,MIT,#{project2.project_dir}")
62
- end
63
- end