license_finder 1.2 → 2.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/CHANGELOG.rdoc +27 -0
  4. data/CONTRIBUTING.md +38 -0
  5. data/README.md +139 -159
  6. data/Rakefile +17 -13
  7. data/features/features/cli_spec.rb +43 -0
  8. data/features/features/configure/add_dependencies_spec.rb +37 -0
  9. data/features/features/configure/approve_dependencies_spec.rb +30 -0
  10. data/features/features/configure/assign_licenses_spec.rb +20 -0
  11. data/features/features/configure/ignore_dependencies_spec.rb +35 -0
  12. data/features/features/configure/ignore_groups_spec.rb +31 -0
  13. data/features/features/configure/name_project_spec.rb +32 -0
  14. data/features/features/configure/whitelist_licenses_spec.rb +40 -0
  15. data/features/features/package_managers/bower_spec.rb +14 -0
  16. data/features/features/package_managers/cocoapods_spec.rb +14 -0
  17. data/features/features/package_managers/gradle_spec.rb +14 -0
  18. data/features/features/package_managers/maven_spec.rb +14 -0
  19. data/features/features/package_managers/npm_spec.rb +14 -0
  20. data/features/features/package_managers/pip_spec.rb +14 -0
  21. data/features/features/report/csv_spec.rb +17 -0
  22. data/features/features/report/html_spec.rb +50 -0
  23. data/{spec → features}/fixtures/Podfile +0 -0
  24. data/{spec → features}/fixtures/build.gradle +0 -0
  25. data/{spec → features}/fixtures/pom.xml +0 -0
  26. data/features/support/testing_dsl.rb +295 -0
  27. data/lib/license_finder.rb +16 -50
  28. data/lib/license_finder/cli.rb +13 -253
  29. data/lib/license_finder/cli/approvals.rb +26 -0
  30. data/lib/license_finder/cli/base.rb +20 -0
  31. data/lib/license_finder/cli/dependencies.rb +39 -0
  32. data/lib/license_finder/cli/ignored_dependencies.rb +30 -0
  33. data/lib/license_finder/cli/ignored_groups.rb +30 -0
  34. data/lib/license_finder/cli/licenses.rb +24 -0
  35. data/lib/license_finder/cli/main.rb +82 -0
  36. data/lib/license_finder/cli/makes_decisions.rb +48 -0
  37. data/lib/license_finder/cli/patched_thor.rb +34 -0
  38. data/lib/license_finder/cli/project_name.rb +31 -0
  39. data/lib/license_finder/cli/whitelist.rb +32 -0
  40. data/lib/license_finder/configuration.rb +14 -145
  41. data/lib/license_finder/decision_applier.rb +46 -0
  42. data/lib/license_finder/decisions.rb +174 -0
  43. data/lib/license_finder/license.rb +13 -32
  44. data/lib/license_finder/license/definitions.rb +15 -13
  45. data/lib/license_finder/license/template.rb +1 -1
  46. data/lib/{data/licenses → license_finder/license/templates}/Apache2.txt +0 -0
  47. data/lib/{data/licenses → license_finder/license/templates}/BSD.txt +0 -0
  48. data/lib/{data/licenses → license_finder/license/templates}/GPLv2.txt +0 -0
  49. data/lib/{data/licenses → license_finder/license/templates}/ISC.txt +0 -0
  50. data/lib/{data/licenses → license_finder/license/templates}/LGPL.txt +0 -0
  51. data/lib/{data/licenses → license_finder/license/templates}/MIT.txt +0 -0
  52. data/lib/{data/licenses → license_finder/license/templates}/NewBSD.txt +0 -0
  53. data/lib/{data/licenses → license_finder/license/templates}/Python.txt +0 -0
  54. data/lib/{data/licenses → license_finder/license/templates}/Ruby.txt +0 -0
  55. data/lib/{data/licenses → license_finder/license/templates}/SimplifiedBSD.txt +0 -0
  56. data/lib/license_finder/package.rb +77 -7
  57. data/lib/license_finder/package_manager.rb +43 -0
  58. data/lib/license_finder/package_managers/bower.rb +1 -1
  59. data/lib/license_finder/package_managers/bower_package.rb +23 -44
  60. data/lib/license_finder/package_managers/bundler.rb +4 -7
  61. data/lib/license_finder/package_managers/bundler_package.rb +14 -31
  62. data/lib/license_finder/package_managers/cocoa_pods.rb +1 -1
  63. data/lib/license_finder/package_managers/cocoa_pods_package.rb +2 -10
  64. data/lib/license_finder/package_managers/gradle.rb +6 -2
  65. data/lib/license_finder/package_managers/gradle_package.rb +6 -30
  66. data/lib/license_finder/package_managers/manual_package.rb +25 -0
  67. data/lib/license_finder/package_managers/maven_package.rb +8 -37
  68. data/lib/license_finder/package_managers/npm.rb +16 -4
  69. data/lib/license_finder/package_managers/npm_package.rb +12 -43
  70. data/lib/license_finder/package_managers/pip_package.rb +17 -37
  71. data/lib/license_finder/platform.rb +0 -16
  72. data/lib/license_finder/possible_license_file.rb +9 -14
  73. data/lib/license_finder/possible_license_files.rb +1 -5
  74. data/lib/license_finder/report.rb +26 -0
  75. data/lib/license_finder/reports/csv_report.rb +58 -0
  76. data/lib/license_finder/reports/erb_report.rb +61 -0
  77. data/lib/license_finder/reports/html_report.rb +10 -1
  78. data/lib/license_finder/reports/markdown_report.rb +7 -1
  79. data/lib/license_finder/reports/templates/bootstrap.css +9 -0
  80. data/lib/license_finder/reports/templates/html_report.erb +105 -0
  81. data/lib/{templates → license_finder/reports/templates}/markdown_report.erb +7 -7
  82. data/lib/license_finder/reports/text_report.rb +5 -3
  83. data/lib/license_finder/version.rb +3 -0
  84. data/license_finder.gemspec +2 -6
  85. data/release/instructions.md +8 -0
  86. data/spec/feature_helper.rb +11 -0
  87. data/spec/fixtures/config/license_finder.yml +3 -0
  88. data/spec/fixtures/{nested_readme/vendor/README → license_directory/LICENSE/Apache.txt} +0 -0
  89. data/spec/lib/license_finder/cli/approvals_spec.rb +63 -0
  90. data/spec/lib/license_finder/cli/dependencies_spec.rb +59 -0
  91. data/spec/lib/license_finder/cli/ignored_dependencies_spec.rb +47 -0
  92. data/spec/lib/license_finder/cli/ignored_groups_spec.rb +40 -0
  93. data/spec/lib/license_finder/cli/licenses_spec.rb +60 -0
  94. data/spec/lib/license_finder/cli/main_spec.rb +110 -0
  95. data/spec/lib/license_finder/cli/project_name_spec.rb +40 -0
  96. data/spec/lib/license_finder/cli/whitelist_spec.rb +58 -0
  97. data/spec/lib/license_finder/configuration_spec.rb +46 -191
  98. data/spec/lib/license_finder/decision_applier_spec.rb +65 -0
  99. data/spec/lib/license_finder/decisions_spec.rb +347 -0
  100. data/spec/lib/license_finder/license/definitions_spec.rb +1 -7
  101. data/spec/lib/license_finder/license_spec.rb +2 -30
  102. data/spec/lib/license_finder/package_manager_spec.rb +22 -0
  103. data/spec/lib/license_finder/package_managers/bower_package_spec.rb +33 -66
  104. data/spec/lib/license_finder/package_managers/bundler_package_spec.rb +7 -71
  105. data/spec/lib/license_finder/package_managers/cocoa_pods_package_spec.rb +8 -11
  106. data/spec/lib/license_finder/package_managers/gradle_package_spec.rb +28 -32
  107. data/spec/lib/license_finder/package_managers/gradle_spec.rb +18 -23
  108. data/spec/lib/license_finder/package_managers/maven_package_spec.rb +20 -43
  109. data/spec/lib/license_finder/package_managers/npm_package_spec.rb +22 -73
  110. data/spec/lib/license_finder/package_managers/npm_spec.rb +18 -21
  111. data/spec/lib/license_finder/package_managers/pip_package_spec.rb +24 -63
  112. data/spec/lib/license_finder/package_spec.rb +121 -0
  113. data/spec/lib/license_finder/possible_license_file_spec.rb +2 -3
  114. data/spec/lib/license_finder/possible_license_files_spec.rb +18 -22
  115. data/spec/lib/license_finder/reports/csv_report_spec.rb +26 -0
  116. data/spec/lib/license_finder/reports/html_report_spec.rb +39 -22
  117. data/spec/lib/license_finder/reports/markdown_report_spec.rb +8 -16
  118. data/spec/lib/license_finder/reports/text_report_spec.rb +21 -12
  119. data/spec/spec_helper.rb +1 -4
  120. data/spec/support/shared_examples_for_package.rb +0 -11
  121. data/spec/support/shared_examples_for_package_manager.rb +1 -0
  122. data/spec/support/stdout_helpers.rb +4 -11
  123. metadata +73 -158
  124. data/db/migrate/201303290935_create_dependencies.rb +0 -14
  125. data/db/migrate/201303291155_create_licenses.rb +0 -13
  126. data/db/migrate/201303291402_create_approvals.rb +0 -13
  127. data/db/migrate/201303291456_create_ancestries.rb +0 -9
  128. data/db/migrate/201303291519_create_bundler_groups.rb +0 -13
  129. data/db/migrate/201303291720_move_manual_from_approvals_to_licenses.rb +0 -11
  130. data/db/migrate/201303291753_allow_null_license_names.rb +0 -7
  131. data/db/migrate/201304011027_allow_null_dependency_version.rb +0 -7
  132. data/db/migrate/201304020947_change_table_name_licenses_to_license_aliases.rb +0 -5
  133. data/db/migrate/201304181524_add_manual_to_dependencies.rb +0 -7
  134. data/db/migrate/201307250917_add_license_manual_to_dependencies.rb +0 -7
  135. data/db/migrate/201307251004_data_fix_manual_licenses.rb +0 -15
  136. data/db/migrate/201307251107_reassociate_license.rb +0 -23
  137. data/db/migrate/201307251340_remove_manual_from_license_aliases.rb +0 -7
  138. data/db/migrate/201311192002_add_manually_approved_to_dependencies.rb +0 -7
  139. data/db/migrate/201311192003_reassociate_manual_approval.rb +0 -13
  140. data/db/migrate/201311192010_drop_approvals.rb +0 -5
  141. data/db/migrate/201401302113_re_reassociate_license.rb +0 -23
  142. data/db/migrate/201403181732_rename_manual_fields.rb +0 -10
  143. data/db/migrate/201403190028_add_manual_approvals.rb +0 -22
  144. data/db/migrate/201403191419_add_timestamps_to_manual_approvals.rb +0 -15
  145. data/db/migrate/201403191645_remove_license_aliases.rb +0 -23
  146. data/db/migrate/201410031451_rename_dependency_license_name.rb +0 -6
  147. data/features/cli.feature +0 -37
  148. data/features/cocoapods_dependencies.feature +0 -10
  149. data/features/configure_bundler_groups.feature +0 -23
  150. data/features/configure_ignore_dependencies.feature +0 -16
  151. data/features/configure_project_name.feature +0 -10
  152. data/features/configure_whitelist.feature +0 -27
  153. data/features/gradle_dependencies.feature +0 -9
  154. data/features/manually_added.feature +0 -19
  155. data/features/manually_approved.feature +0 -10
  156. data/features/manually_assigned_license.feature +0 -16
  157. data/features/maven_dependencies.feature +0 -9
  158. data/features/multiple_licenses.feature +0 -9
  159. data/features/node_dependencies.feature +0 -9
  160. data/features/python_dependencies.feature +0 -9
  161. data/features/report_csv.feature +0 -15
  162. data/features/report_html.feature +0 -24
  163. data/features/step_definitions/cli_steps.rb +0 -51
  164. data/features/step_definitions/cocoapod_steps.rb +0 -8
  165. data/features/step_definitions/configure_bundler_groups_steps.rb +0 -30
  166. data/features/step_definitions/configure_ignore_dependencies.rb +0 -35
  167. data/features/step_definitions/configure_project_name_steps.rb +0 -3
  168. data/features/step_definitions/configure_whitelist_steps.rb +0 -45
  169. data/features/step_definitions/gradle_steps.rb +0 -8
  170. data/features/step_definitions/manually_added_steps.rb +0 -28
  171. data/features/step_definitions/manually_approved_steps.rb +0 -24
  172. data/features/step_definitions/manually_assigned_license_steps.rb +0 -34
  173. data/features/step_definitions/maven_steps.rb +0 -8
  174. data/features/step_definitions/multiple_licenses_steps.rb +0 -14
  175. data/features/step_definitions/node_steps.rb +0 -8
  176. data/features/step_definitions/python_steps.rb +0 -8
  177. data/features/step_definitions/report_csv_steps.rb +0 -20
  178. data/features/step_definitions/report_html_steps.rb +0 -60
  179. data/features/step_definitions/shared_steps.rb +0 -307
  180. data/lib/data/license_finder.example.yml +0 -12
  181. data/lib/license_finder/dependency_manager.rb +0 -92
  182. data/lib/license_finder/package_saver.rb +0 -44
  183. data/lib/license_finder/reports/dependency_report.rb +0 -34
  184. data/lib/license_finder/reports/detailed_text_report.rb +0 -19
  185. data/lib/license_finder/reports/formatted_report.rb +0 -40
  186. data/lib/license_finder/reports/reporter.rb +0 -27
  187. data/lib/license_finder/tables.rb +0 -9
  188. data/lib/license_finder/tables/bundler_group.rb +0 -7
  189. data/lib/license_finder/tables/dependency.rb +0 -113
  190. data/lib/license_finder/tables/manual_approval.rb +0 -13
  191. data/lib/license_finder/yml_to_sql.rb +0 -117
  192. data/lib/templates/html_report.erb +0 -117
  193. data/lib/templates/text_report.erb +0 -3
  194. data/release/gem_version.rb +0 -3
  195. data/release/manual_instructions.md +0 -29
  196. data/release/publish.sh +0 -32
  197. data/spec/fixtures/APACHE-2-LICENSE +0 -202
  198. data/spec/fixtures/GPLv2 +0 -339
  199. data/spec/fixtures/ISC-LICENSE +0 -10
  200. data/spec/fixtures/MIT-LICENSE +0 -22
  201. data/spec/fixtures/MIT-LICENSE-with-varied-disclaimer +0 -22
  202. data/spec/fixtures/README-with-MIT-LICENSE +0 -222
  203. data/spec/fixtures/license_directory/LICENSE/BSD-2-Clause.txt +0 -25
  204. data/spec/fixtures/license_directory/LICENSE/GPL-2.0.txt +0 -339
  205. data/spec/fixtures/license_directory/LICENSE/LICENSE +0 -191
  206. data/spec/fixtures/license_directory/LICENSE/MIT.txt +0 -21
  207. data/spec/fixtures/license_directory/LICENSE/RUBY.txt +0 -60
  208. data/spec/fixtures/mit_licensed_gem/LICENSE +0 -22
  209. data/spec/fixtures/other_licensed_gem/LICENSE +0 -3
  210. data/spec/fixtures/readme/Project ReadMe b/data/spec/fixtures/readme/Project → ReadMe +0 -0
  211. data/spec/fixtures/readme/README +0 -0
  212. data/spec/fixtures/readme/Readme.markdown +0 -0
  213. data/spec/lib/license_finder/cli_spec.rb +0 -298
  214. data/spec/lib/license_finder/dependency_manager_spec.rb +0 -198
  215. data/spec/lib/license_finder/package_saver_spec.rb +0 -82
  216. data/spec/lib/license_finder/reports/detailed_text_report_spec.rb +0 -33
  217. data/spec/lib/license_finder/reports/reporter_spec.rb +0 -33
  218. data/spec/lib/license_finder/tables/dependency_spec.rb +0 -196
  219. data/spec/lib/license_finder/yml_to_sql_spec.rb +0 -123
  220. data/spec/lib/license_finder_spec.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2049a25200cf6a0cdad954f85359676042c62338
4
- data.tar.gz: d5addeb14c9dd87defafcec6345212959e8a4603
3
+ metadata.gz: 272a63170ce7ba95ee485b5810c3d9bf525a0326
4
+ data.tar.gz: f6e7364050de7afec4d9ffb95f3e1d20cadb780f
5
5
  SHA512:
6
- metadata.gz: ef837a059b9fb88d1cc0daa2cd64ed70c6e774579946b23dd056f88b44769ff5a6d3dc3736b9cd974b7868f0af9fbd1049522a0dce8a1b0276cf49f69333f7e7
7
- data.tar.gz: eb1273739818c2d900079e7a7c2f1d0187f5a8651f23e92ba293e09541d865fbfbac4c22d3e99d7774c9fcc15ac4e390fd5031b81f2820717b8593d3894a7d6b
6
+ metadata.gz: 3207fee7de7b192aac50c45208931002322a0dbc8fb24e30adb072a28dbacc6e11567c210895bd88163f65de2df0095db2ba7d39a75966b9ad636ae2d0b3c1d6
7
+ data.tar.gz: 5dd187332ae0d7d61ebde94a3610c43b8a81ac60332bf963b3dab5518950f2ae7e6036c58d6570cd864d7bb038f2e3e96b70eb457686748eb31db33f0892e98a
data/.travis.yml CHANGED
@@ -28,4 +28,5 @@ before_install:
28
28
  - unzip -q gradle*
29
29
  - rm gradle*.zip
30
30
  - mv gradle* ~/gradle
31
- - cd -
31
+ - npm install -g bower
32
+ - cd -
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,30 @@
1
+ === 2.0.0 / unreleased
2
+
3
+ * Features
4
+
5
+ * Stores (in an append-only YAML file) every decision that has been made
6
+ about a project's dependencies, even if a decision was later reverted.
7
+ * Stores timestamps and other metadata (who, why) about each decision.
8
+ * When needed, applies those decisions to the list of packages currently
9
+ reported by the package managers.
10
+ * The CLI never writes HTML or CSV reports to the file system, only to
11
+ STDOUT. So, users have more choice over which reports to generate, when to
12
+ generate them, and where to put them. See `license_finder report`.
13
+ * Removed dependencies on sqlite and sequel.
14
+ * Minimized the responsibilities of the configuration YAML file. The CLI
15
+ never updates the config file, which means less futzing with the file
16
+ system. Makes room for replacing the config file with command line options.
17
+
18
+ * Bugfixes
19
+
20
+ * `license_finder` does not write anything to the file system, #94, #114, #117
21
+
22
+ === 1.2.1 / unreleased
23
+
24
+ * Features
25
+
26
+ * Can list dependencies that were added manually
27
+
1
28
  === 1.2 / 2014-11-10
2
29
 
3
30
  * Features
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,38 @@
1
+ # Contributing
2
+
3
+ ## TL;DR
4
+
5
+ * Fork the project from https://github.com/pivotal/LicenseFinder
6
+ * Create a feature branch.
7
+ * Make your feature addition or bug fix. Please make sure there is appropriate test coverage.
8
+ * Rebase on top of master.
9
+ * Send a pull request.
10
+
11
+
12
+ ## Development Dependencies
13
+
14
+ To successfully run the test suite, you will need node.js, python, pip
15
+ and gradle installed. If you run `rake check_dependencies`, you'll see
16
+ exactly what you're missing.
17
+
18
+ ### Python
19
+
20
+ For the python dependency tests you will want to have virtualenv
21
+ installed, to allow pip to work without sudo. For more details, see
22
+ this [post on virtualenv][].
23
+
24
+ [post on virtualenv]: http://hackercodex.com/guide/python-development-environment-on-mac-osx/#virtualenv
25
+
26
+
27
+ ### JRuby
28
+
29
+ If you're running the test suite with jruby, you're probably going to
30
+ want to set up some environment variables:
31
+
32
+ ```
33
+ JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true'
34
+ ```
35
+
36
+ ### Gradle
37
+
38
+ You'll need a gradle version >= 1.8.
data/README.md CHANGED
@@ -21,7 +21,7 @@ report.
21
21
  * Node.js (via `npm`)
22
22
  * Bower
23
23
 
24
- ### Experimental project types
24
+ ### Experimental project types
25
25
 
26
26
  * Java (via `maven`)
27
27
  * Java (via `gradle`)
@@ -46,13 +46,12 @@ gem 'license_finder', :group => :development
46
46
 
47
47
  This approach helps you remember to install `license_finder`, but can
48
48
  pull in unwanted dependencies, including `bundler`. To mitigate this
49
- problem, see ignored_groups in [Configuration](#configuration).
49
+ problem, see [Excluding Dependencies](#excluding-dependencies).
50
50
 
51
51
 
52
52
  ## Usage
53
53
 
54
- `license_finder` will generate reports of action items; i.e.,
55
- dependencies that do not fall within your license "whitelist".
54
+ The first time you run `license_finder` it will output a report of all your project's packages.
56
55
 
57
56
  ```sh
58
57
  $ license_finder
@@ -64,6 +63,12 @@ Or, if you installed with bundler:
64
63
  $ bundle exec license_finder
65
64
  ```
66
65
 
66
+ The output will report that none of your packages have been
67
+ approved. Over time you will tell `license_finder` which packages
68
+ are approved, so when you run this command in the future, it will
69
+ report current action items; i.e., packages that are new or have
70
+ never been approved.
71
+
67
72
  If you don't wish to see progressive output "dots", use the `--quiet`
68
73
  option.
69
74
 
@@ -94,19 +99,80 @@ languages, as long as that language has a package definition in the project dire
94
99
 
95
100
  ### Continuous Integration
96
101
 
97
- `license_finder` will also return a non-zero exit status if there are
98
- unapproved dependencies. This can be useful for inclusion in a CI
99
- environment to alert you if someone adds an unapproved dependency to
100
- the project.
102
+ `license_finder` will return a non-zero exit status if there are unapproved
103
+ dependencies. This can be useful for inclusion in a CI environment to alert you
104
+ if someone adds an unapproved dependency to the project.
105
+
106
+
107
+ ## Approving Dependencies
108
+
109
+ `license_finder` will inform you whenever you have an unapproved dependency.
110
+ If your business decides this is an acceptable risk, the easiest way to approve
111
+ the dependency is by running `license_finder approval add`.
112
+
113
+ For example, let's assume you've added the `awesome_gpl_gem`
114
+ to your Gemfile, which `license_finder` reports is unapproved:
115
+
116
+ ```sh
117
+ $ license_finder
118
+ Dependencies that need approval:
119
+ awesome_gpl_gem, 1.0.0, GPL
120
+ ```
121
+
122
+ Your business tells you that in this case, it's acceptable to use this
123
+ gem. You now run:
124
+
125
+ ```sh
126
+ $ license_finder approval add awesome_gpl_gem
127
+ ```
128
+
129
+ If you rerun `license_finder`, you should no longer see
130
+ `awesome_gpl_gem` in the output.
131
+
132
+ To record who approved the dependency and why:
133
+
134
+ ```sh
135
+ $ license_finder approval add awesome_gpl_gem --who CTO --why "Go ahead"
136
+ ```
137
+
138
+ ### Whitelisting
139
+
140
+ Approving packages one-by-one can be tedious. Usually your business has
141
+ blanket policies about which packages are approved. To tell `license_finder`
142
+ that any package with the MIT license should be approved, run:
143
+
144
+ ``` sh
145
+ $ license_finder whitelist add MIT
146
+ ```
147
+
148
+ Any current or future packages with the MIT license will be excluded from the
149
+ output of `license_finder`.
150
+
151
+ You can also record `--who` and `--why` when changing the whitelist, or making
152
+ any other decision about your project.
101
153
 
102
154
 
103
155
  ## Output and Artifacts
104
156
 
105
- ### STDOUT
157
+ ### Decisions file
158
+
159
+ Any decisions you make about approvals will be recorded in a YAML file. Be
160
+ default, `license_finder` expects it to be named
161
+ `doc/dependency_decisions.yml`. All commands can be passed `--decisions_file`
162
+ to override this location. See [Configuration](#configuration) for other
163
+ options.
164
+
165
+ This file must be committed to version control. Rarely, you will have to
166
+ manually resolve conflicts in it. In this situation, keep in mind that each
167
+ decision has an associated timestamp, and the decisions are processed
168
+ top-to-bottom, with later decisions overwriting or appending to earlier
169
+ decisions.
170
+
171
+ ### Output from `action_items`
106
172
 
107
- On a Rails project, you could expect `license_finder` to output
108
- something like the following (assuming you whitelisted the MIT license
109
- -- see [Configuration](#configuration)):
173
+ You could expect `license_finder`, which is an alias for `license_finder
174
+ action_items` to output something like the following on a Rails project where
175
+ MIT had been whitelisted:
110
176
 
111
177
  ```
112
178
  Dependencies that need approval:
@@ -114,77 +180,46 @@ Dependencies that need approval:
114
180
  highline, 1.6.14, ruby
115
181
  json, 1.7.5, ruby
116
182
  mime-types, 1.19, ruby
117
- rails, 3.2.8, other
118
- rdoc, 3.12, other
183
+ rails, 3.2.8, unknown
184
+ rdoc, 3.12, unknown
119
185
  rubyzip, 0.9.9, ruby
120
- xml-simple, 1.1.1, other
186
+ xml-simple, 1.1.1, unknown
121
187
  ```
122
188
 
123
- ### Files and Reports
189
+ You can customize the format of the output in the same way that you customize
190
+ [output from `report`](#output-from-report).
124
191
 
125
- The executable task will also write out a `dependencies.db`,
126
- `dependencies.csv`, and `dependencies.html` file (in the `doc/`
127
- directory by default -- see [Configuration](#configuration)).
192
+ ### Output from `report`
128
193
 
129
- The latter two files are human-readable reports that you could send to
130
- your non-technical business partners, lawyers, etc.
194
+ The `license_finder report` command will output human-readable reports that you
195
+ could send to your non-technical business partners, lawyers, etc. You can
196
+ choose the format of the report (text, csv, html or markdown); see
197
+ `license_finder --help report` for details. The output is sent to STDOUT, so
198
+ you can save the reports wherever you want them. You can commit them to
199
+ version control if you like.
131
200
 
132
- The HTML report generated by `license_finder` shows a summary of the
133
- project's dependencies and dependencies which need to be approved. The
134
- project name at the top of the report can be set in
135
- `config/license_finder.yml`.
201
+ The HTML report generated by `license_finder report --format html` summarizes
202
+ all of your project's dependencies and includes information about which need to
203
+ be approved. The project name at the top of the report can be set with
204
+ `license_finder project_name add`.
136
205
 
137
206
 
138
207
  ## Manual Intervention
139
208
 
140
209
  ### Setting Licenses
141
210
 
142
- When `license_finder` reports that a dependency's license is 'other',
211
+ When `license_finder` reports that a dependency's license is 'unknown',
143
212
  you should manually research what the actual license is. When you
144
213
  have established the real license, you can record it with:
145
214
 
146
215
  ```sh
147
- $ license_finder license MIT my_unknown_dependency
216
+ $ license_finder licenses add my_unknown_dependency MIT
148
217
  ```
149
218
 
150
219
  This command would assign the MIT license to the dependency
151
220
  `my_unknown_dependency`.
152
221
 
153
222
 
154
- ### Approving Dependencies
155
-
156
- Whenever you have a dependency that falls outside of your whitelist,
157
- `license_finder` will tell you. If your business decides that this is
158
- an acceptable risk, you can manually approve the dependency by using
159
- the `license_finder approve` command.
160
-
161
- For example, let's assume you've only whitelisted the "MIT" license in
162
- your `config/license_finder.yml`. You then add the `awesome_gpl_gem`
163
- to your Gemfile, which we'll assume is licensed with the `GPL`
164
- license. You then run `license_finder` and see the gem listed in the
165
- output:
166
-
167
- ```sh
168
- awesome_gpl_gem, 1.0.0, GPL
169
- ```
170
-
171
- Your business tells you that in this case, it's acceptable to use this
172
- gem. You now run:
173
-
174
- ```sh
175
- $ license_finder approve awesome_gpl_gem
176
- ```
177
-
178
- If you rerun `license_finder`, you should no longer see
179
- `awesome_gpl_gem` in the output.
180
-
181
- To record who approved the dependency and why:
182
-
183
- ```sh
184
- $ license_finder approve awesome_gpl_gem --approver CTO --message "Go ahead"
185
- ```
186
-
187
-
188
223
  ### Adding Hidden Dependencies
189
224
 
190
225
  `license_finder` can track dependencies that your package managers
@@ -192,22 +227,10 @@ don't know about (JS libraries that don't appear in your
192
227
  Gemfile/requirements.txt/package.json, etc.)
193
228
 
194
229
  ```sh
195
- $ license_finder dependencies add MIT my_js_dep 0.1.2
230
+ $ license_finder dependencies add my_js_dep MIT 0.1.2
196
231
  ```
197
232
 
198
- To automatically approve an unmanaged dependency when you add it, use:
199
-
200
- ```sh
201
- $ license_finder dependencies add MIT my_js_dep 0.1.2 --approve
202
- ```
203
-
204
- To record who approved the dependency when you add it, use:
205
-
206
- ```sh
207
- $ license_finder dependencies add MIT my_js_dep 0.1.2 --approve --approver CTO --message "Go ahead"
208
- ```
209
-
210
- The version is optional. Run `license_finder dependencies help` for
233
+ Run `license_finder dependencies help` for
211
234
  additional documentation about managing these dependencies.
212
235
 
213
236
  `license_finder` cannot automatically detect when one of these
@@ -217,71 +240,55 @@ dependencies has been removed from your project, so you can use:
217
240
  $ license_finder dependencies remove my_js_dep
218
241
  ```
219
242
 
243
+ ### Excluding Dependencies
244
+
245
+ Sometimes a project will have development or test dependencies which
246
+ you don't want to track. You can exclude theses dependencies by running
247
+ `license_finder ignored_groups`. (Currently this only works for packages
248
+ managed by Bundler.)
249
+
250
+ On rare occasions a package manager will report an individual dependency
251
+ that you want to exclude from all reports, even though it is approved.
252
+ You can exclude an individual dependency by running
253
+ `license_finder ignored_dependencies`. Think carefully before adding
254
+ dependencies to this list. A likely item to exclude is `bundler`,
255
+ since it is a common dependency whose version changes from machine to
256
+ machine. Adding it to the `ignored_dependencies` would prevent it
257
+ (and its oscillating versions) from appearing in reports.
258
+
220
259
 
221
260
  ## Configuration
222
261
 
223
- The first time you run `license_finder` it will create a default
224
- configuration file `./config/license_finder.yml`, which will look
225
- something like this:
262
+ It may be difficult to remember to pass command line options to every command.
263
+ In some of these cases you can store default values in a YAML formatted config
264
+ file. `license_finder` looks for this file in `config/license_finder.yml`.
265
+
266
+ As an example, the file might look like this:
226
267
 
227
268
  ```yaml
228
269
  ---
229
- whitelist:
230
- #- MIT
231
- #- Apache 2.0
232
- ignore_groups:
233
- #- test
234
- #- development
235
- ignore_dependencies:
236
- #- bundler
237
- dependencies_file_dir: './doc/'
238
- project_name: My Project Name
239
- gradle_command: # only meaningful if used with a Java/gradle project. Defaults to "gradle".
270
+ decisions_file: './some_path/decisions.yml'
271
+ gradle_command: './gradlew'
240
272
  ```
241
273
 
242
- By modifying this file, you can configure `license_finder`'s behavior:
243
-
244
- * Automatically approve licenses in the `whitelist`
245
- * Exclude test or development dependencies by setting `ignore_groups`.
246
- (Currently this only works for Bundler.)
247
- * Exclude specific dependencies by setting `ignore_dependencies`.
248
- (Think carefully before adding dependencies to this list. A likely
249
- item to exclude is bundler itself, to avoid noisy changes to the doc
250
- files when different people run `license_finder` with different
251
- versions of bundler.)
252
- * Store the license database and text files in another directory by
253
- changing `dependencies_file_dir`.
254
- * Set the HTML report title wih `project_name`, which defaults to the
255
- name of the working directory.
256
- * See below for explanation of "gradle_command".
257
-
258
- You can also configure `license_finder` through the command line. See
259
- `license_finder whitelist help`, `license_finder ignored_bundler_groups help`
260
- and `license_finder project_name help` for more details.
274
+ If you set `decisions_file`, you won't have to pass it to every CLI command.
261
275
 
276
+ Read on to learn about how `gradle_command` is used on gradle projects.
262
277
 
263
278
  ### Gradle Projects
264
279
 
265
280
  You need to install the license gradle plugin:
266
281
  [https://github.com/hierynomus/license-gradle-plugin](https://github.com/hierynomus/license-gradle-plugin)
267
282
 
268
- LicenseFinder assumes that gradle is in your shell's command path and
269
- can be invoked by just calling `gradle`.
283
+ LicenseFinder assumes that gradle is in your shell's command path and can be
284
+ invoked by just calling `gradle`. If you must invoke gradle some other way
285
+ (e.g., with a custom `gradlew` script), pass `--gradle_command` to
286
+ `license_finder` or `license_finder report`.
270
287
 
271
- If you must invoke gradle some other way (e.g., with a custom
272
- `gradlew` script), set the `gradle_command` option in your project's
273
- `license_finder.yml`:
274
-
275
- ```yaml
276
- # ... other configuration ...
277
- gradle_command: ./gradlew
278
- ```
279
-
280
- By default, `license_finder` will report on gradle's "runtime"
281
- dependencies. If you want to generate a report for some other
282
- dependency configuration (e.g. Android projects will sometimes specify
283
- their meaningful dependencies in the "compile" group), you can specify
284
- it in your project's `build.gradle`:
288
+ By default, `license_finder` will report on gradle's "runtime" dependencies. If
289
+ you want to generate a report for some other dependency configuration (e.g.
290
+ Android projects will sometimes specify their meaningful dependencies in the
291
+ "compile" group), you can specify it in your project's `build.gradle`:
285
292
 
286
293
  ```
287
294
  // Must come *after* the 'apply plugin: license' line
@@ -292,20 +299,15 @@ downloadLicenses {
292
299
  ```
293
300
 
294
301
 
295
- ## Upgrade for pre-0.8.0 users
296
-
297
- If you wish to cleanup your root directory you can run:
298
-
299
- ```sh
300
- $ license_finder move
301
- ```
302
+ ## Requirements
302
303
 
303
- This will move your `dependencies.*` files to the doc/ directory and update the config.
304
+ `license_finder` requires ruby >= 1.9, or jruby.
304
305
 
305
306
 
306
- ## Requirements
307
+ ## Upgrading
307
308
 
308
- `license_finder` requires ruby >= 1.9, or jruby.
309
+ To upgrade from `license_finder` version ~1.2 to 2.0, see
310
+ [`license_finder_upgrade`](https://github.com/mainej/license_finder_upgrade).
309
311
 
310
312
 
311
313
  ## A Plea to Package Authors and Maintainers
@@ -313,7 +315,7 @@ This will move your `dependencies.*` files to the doc/ directory and update the
313
315
  Please add a license to your package specs! Most packaging systems
314
316
  allow for the specification of one or more licenses.
315
317
 
316
- For example, Ruby Gems may have a license specified by name:
318
+ For example, Ruby Gems can specify a license by name:
317
319
 
318
320
  ```ruby
319
321
  Gem::Specification.new do |s|
@@ -322,7 +324,7 @@ Gem::Specification.new do |s|
322
324
  end
323
325
  ```
324
326
 
325
- And add a `LICENSE` file to your package that contains your license text.
327
+ And save a `LICENSE` file which contains your license text in your repo.
326
328
 
327
329
 
328
330
  ## Support
@@ -333,30 +335,8 @@ And add a `LICENSE` file to your package that contains your license text.
333
335
 
334
336
  ## Contributing
335
337
 
336
- * Fork the project from https://github.com/pivotal/LicenseFinder
337
- * Create a feature branch.
338
- * Make your feature addition or bug fix. Please make sure there is appropriate test coverage.
339
- * Rebase on top of master.
340
- * Send a pull request.
341
-
342
- To successfully run the test suite, you will need node.js, python, pip
343
- and gradle installed. If you run `rake check_dependencies`, you'll see
344
- exactly what you're missing.
345
-
346
- You'll need a gradle version >= 1.8.
338
+ See [CONTRIBUTING.md](https://github.com/pivotal/LicenseFinder/blob/master/CONTRIBUTING.md).
347
339
 
348
- For the python dependency tests you will want to have virtualenv
349
- installed, to allow pip to work without sudo. For more details, see
350
- this [post on virtualenv][].
351
-
352
- [post on virtualenv]: http://hackercodex.com/guide/python-development-environment-on-mac-osx/#virtualenv
353
-
354
- If you're running the test suite with jruby, you're probably going to
355
- want to set up some environment variables:
356
-
357
- ```
358
- JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' JRUBY_OPTS='-J-Djruby.launch.inproc=true'
359
- ```
360
340
 
361
341
  ## License
362
342