license_finder 0.8.1 → 0.8.2

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.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.rdoc +14 -1
  4. data/bin/license_finder +1 -61
  5. data/db/migrate/201304181524_add_manual_to_dependencies.rb +7 -0
  6. data/features/non_bundler_dependencies.feature +19 -0
  7. data/features/step_definitions/approve_dependencies_steps.rb +1 -1
  8. data/features/step_definitions/cli_steps.rb +1 -1
  9. data/features/step_definitions/html_report_steps.rb +1 -6
  10. data/features/step_definitions/ignore_bundle_groups_steps.rb +1 -1
  11. data/features/step_definitions/non_bundler_steps.rb +33 -0
  12. data/features/step_definitions/set_license_steps.rb +1 -1
  13. data/features/step_definitions/shared_steps.rb +8 -3
  14. data/lib/license_finder.rb +23 -25
  15. data/lib/license_finder/bundle.rb +2 -2
  16. data/lib/license_finder/bundled_gem.rb +3 -3
  17. data/lib/license_finder/{gem_saver.rb → bundled_gem_saver.rb} +3 -5
  18. data/lib/license_finder/cli.rb +109 -32
  19. data/lib/license_finder/configuration.rb +19 -8
  20. data/lib/license_finder/dependency_manager.rb +49 -0
  21. data/lib/license_finder/license.rb +3 -3
  22. data/lib/license_finder/{license_files.rb → possible_license_files.rb} +2 -2
  23. data/lib/license_finder/{dependency_report.rb → reports/dependency_report.rb} +1 -1
  24. data/lib/license_finder/{html_report.rb → reports/html_report.rb} +0 -0
  25. data/lib/license_finder/{reporter.rb → reports/reporter.rb} +0 -0
  26. data/lib/license_finder/{text_report.rb → reports/text_report.rb} +0 -0
  27. data/lib/license_finder/tables.rb +1 -1
  28. data/lib/license_finder/tables/dependency.rb +24 -5
  29. data/lib/license_finder/yml_to_sql.rb +5 -0
  30. data/lib/tasks/license_finder.rake +1 -1
  31. data/license_finder.gemspec +5 -3
  32. data/readme.md +80 -26
  33. data/spec/lib/license_finder/bundle_spec.rb +4 -11
  34. data/spec/lib/license_finder/{gem_saver_spec.rb → bundled_gem_saver_spec.rb} +7 -4
  35. data/spec/lib/license_finder/bundled_gem_spec.rb +1 -1
  36. data/spec/lib/license_finder/cli_spec.rb +86 -18
  37. data/spec/lib/license_finder/configuration_spec.rb +5 -2
  38. data/spec/lib/license_finder/dependency_manager_spec.rb +107 -0
  39. data/spec/lib/license_finder/html_report_spec.rb +3 -3
  40. data/spec/lib/license_finder/{license_files_spec.rb → possible_license_files_spec.rb} +7 -7
  41. data/spec/lib/license_finder/tables/dependency_spec.rb +31 -44
  42. data/spec/lib/license_finder/yml_to_sql_spec.rb +24 -2
  43. data/spec/support/silence_stdout.rb +13 -0
  44. metadata +66 -72
  45. data/lib/license_finder/bundle_syncer.rb +0 -11
  46. data/spec/lib/license_finder/bundle_syncer_spec.rb +0 -16
@@ -8,19 +8,20 @@ describe LicenseFinder::YmlToSql do
8
8
  'license' => "GPLv2",
9
9
  'license_url' => "www.license_url.org",
10
10
  'approved' => true,
11
- 'manual' => true,
12
11
  'summary' => "some summary",
13
12
  'description' => "some description",
14
13
  'homepage' => 'www.homepage.com',
15
14
  'children' => ["child1_name"],
16
15
  'parents' => ["parent1_name"],
17
16
  'bundler_groups' => [:test],
17
+ 'source' => source,
18
18
 
19
19
  'notes' => 'some notes',
20
20
  'license_files' => ['/Users/pivotal/foo/lic1', '/Users/pivotal/bar/lic2'],
21
21
  }
22
22
  end
23
23
  let(:config) { LicenseFinder::Configuration.new }
24
+ let(:source) { nil }
24
25
 
25
26
  before do
26
27
  LicenseFinder.stub(:config) { config }
@@ -53,6 +54,28 @@ describe LicenseFinder::YmlToSql do
53
54
  (DB.tables - [:schema_migrations]).each { |table| DB[table].truncate }
54
55
  end
55
56
 
57
+ describe "when dependency source is set to bundle" do
58
+ let(:source) { "bundle" }
59
+
60
+ it "sets manual to be false" do
61
+ described_class.convert_all([legacy_attributes])
62
+
63
+ saved_dep = described_class::Sql::Dependency.first
64
+ saved_dep.manual.should == false
65
+ end
66
+ end
67
+
68
+ describe "when dependency source is not set to bundle" do
69
+ let(:source) { "" }
70
+
71
+ it "sets manual to be false" do
72
+ described_class.convert_all([legacy_attributes])
73
+
74
+ saved_dep = described_class::Sql::Dependency.first
75
+ saved_dep.manual.should == true
76
+ end
77
+ end
78
+
56
79
  it "persists all of the dependency's attributes" do
57
80
  described_class.convert_all([legacy_attributes])
58
81
 
@@ -71,7 +94,6 @@ describe LicenseFinder::YmlToSql do
71
94
  saved_dep = described_class::Sql::Dependency.first
72
95
  saved_dep.license.name.should == "GPLv2"
73
96
  saved_dep.license.url.should == "www.license_url.org"
74
- saved_dep.license.manual.should == true
75
97
  end
76
98
 
77
99
  it "associates bundler groups" do
@@ -0,0 +1,13 @@
1
+ module SilenceStdout
2
+ def silence_stdout
3
+ orig_stdout = $stdout
4
+ $stdout = File.open("/dev/null", "w")
5
+ yield
6
+ ensure
7
+ $stdout = orig_stdout
8
+ end
9
+ end
10
+
11
+ RSpec.configure do |c|
12
+ c.include(SilenceStdout)
13
+ end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: license_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
5
- prerelease:
4
+ version: 0.8.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jacob Maine
@@ -12,143 +11,141 @@ authors:
12
11
  - Paul Meskers
13
12
  - Brent Wheeldon
14
13
  - David Tengdin
14
+ - William Ramsey
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2013-04-14 00:00:00.000000000 Z
18
+ date: 2013-07-09 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler
22
22
  requirement: !ruby/object:Gem::Requirement
23
- none: false
24
23
  requirements:
25
- - - ! '>='
24
+ - - '>='
26
25
  - !ruby/object:Gem::Version
27
26
  version: '0'
28
27
  type: :runtime
29
28
  prerelease: false
30
29
  version_requirements: !ruby/object:Gem::Requirement
31
- none: false
32
30
  requirements:
33
- - - ! '>='
31
+ - - '>='
34
32
  - !ruby/object:Gem::Version
35
33
  version: '0'
36
34
  - !ruby/object:Gem::Dependency
37
35
  name: sequel
38
36
  requirement: !ruby/object:Gem::Requirement
39
- none: false
40
37
  requirements:
41
- - - ! '>='
38
+ - - '>='
42
39
  - !ruby/object:Gem::Version
43
40
  version: '0'
44
41
  type: :runtime
45
42
  prerelease: false
46
43
  version_requirements: !ruby/object:Gem::Requirement
47
- none: false
48
44
  requirements:
49
- - - ! '>='
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ - !ruby/object:Gem::Dependency
49
+ name: thor
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
50
60
  - !ruby/object:Gem::Version
51
61
  version: '0'
52
62
  - !ruby/object:Gem::Dependency
53
63
  name: sqlite3
54
64
  requirement: !ruby/object:Gem::Requirement
55
- none: false
56
65
  requirements:
57
- - - ! '>='
66
+ - - '>='
58
67
  - !ruby/object:Gem::Version
59
68
  version: '0'
60
69
  type: :runtime
61
70
  prerelease: false
62
71
  version_requirements: !ruby/object:Gem::Requirement
63
- none: false
64
72
  requirements:
65
- - - ! '>='
73
+ - - '>='
66
74
  - !ruby/object:Gem::Version
67
75
  version: '0'
68
76
  - !ruby/object:Gem::Dependency
69
77
  name: rspec
70
78
  requirement: !ruby/object:Gem::Requirement
71
- none: false
72
79
  requirements:
73
- - - ! '>='
80
+ - - '>='
74
81
  - !ruby/object:Gem::Version
75
82
  version: '0'
76
83
  type: :development
77
84
  prerelease: false
78
85
  version_requirements: !ruby/object:Gem::Requirement
79
- none: false
80
86
  requirements:
81
- - - ! '>='
87
+ - - '>='
82
88
  - !ruby/object:Gem::Version
83
89
  version: '0'
84
90
  - !ruby/object:Gem::Dependency
85
91
  name: rake
86
92
  requirement: !ruby/object:Gem::Requirement
87
- none: false
88
93
  requirements:
89
- - - ! '>='
94
+ - - '>='
90
95
  - !ruby/object:Gem::Version
91
96
  version: '0'
92
97
  type: :development
93
98
  prerelease: false
94
99
  version_requirements: !ruby/object:Gem::Requirement
95
- none: false
96
100
  requirements:
97
- - - ! '>='
101
+ - - '>='
98
102
  - !ruby/object:Gem::Version
99
103
  version: '0'
100
104
  - !ruby/object:Gem::Dependency
101
105
  name: xpath
102
106
  requirement: !ruby/object:Gem::Requirement
103
- none: false
104
107
  requirements:
105
- - - ! '>='
108
+ - - '>='
106
109
  - !ruby/object:Gem::Version
107
110
  version: '0'
108
111
  type: :development
109
112
  prerelease: false
110
113
  version_requirements: !ruby/object:Gem::Requirement
111
- none: false
112
114
  requirements:
113
- - - ! '>='
115
+ - - '>='
114
116
  - !ruby/object:Gem::Version
115
117
  version: '0'
116
118
  - !ruby/object:Gem::Dependency
117
119
  name: cucumber
118
120
  requirement: !ruby/object:Gem::Requirement
119
- none: false
120
121
  requirements:
121
- - - ! '>='
122
+ - - '>='
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  type: :development
125
126
  prerelease: false
126
127
  version_requirements: !ruby/object:Gem::Requirement
127
- none: false
128
128
  requirements:
129
- - - ! '>='
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: database_cleaner
134
134
  requirement: !ruby/object:Gem::Requirement
135
- none: false
136
135
  requirements:
137
- - - ! '>='
136
+ - - '='
138
137
  - !ruby/object:Gem::Version
139
- version: '0'
138
+ version: 0.9.1
140
139
  type: :development
141
140
  prerelease: false
142
141
  version_requirements: !ruby/object:Gem::Requirement
143
- none: false
144
142
  requirements:
145
- - - ! '>='
143
+ - - '='
146
144
  - !ruby/object:Gem::Version
147
- version: '0'
145
+ version: 0.9.1
148
146
  - !ruby/object:Gem::Dependency
149
147
  name: capybara
150
148
  requirement: !ruby/object:Gem::Requirement
151
- none: false
152
149
  requirements:
153
150
  - - ~>
154
151
  - !ruby/object:Gem::Version
@@ -156,7 +153,6 @@ dependencies:
156
153
  type: :development
157
154
  prerelease: false
158
155
  version_requirements: !ruby/object:Gem::Requirement
159
- none: false
160
156
  requirements:
161
157
  - - ~>
162
158
  - !ruby/object:Gem::Version
@@ -164,7 +160,6 @@ dependencies:
164
160
  - !ruby/object:Gem::Dependency
165
161
  name: rails
166
162
  requirement: !ruby/object:Gem::Requirement
167
- none: false
168
163
  requirements:
169
164
  - - ~>
170
165
  - !ruby/object:Gem::Version
@@ -172,17 +167,16 @@ dependencies:
172
167
  type: :development
173
168
  prerelease: false
174
169
  version_requirements: !ruby/object:Gem::Requirement
175
- none: false
176
170
  requirements:
177
171
  - - ~>
178
172
  - !ruby/object:Gem::Version
179
173
  version: 3.2.0
180
- description: ! " Do you know the licenses of all your application's dependencies?
181
- What open source software licenses will your business accept?\n\n LicenseFinder
182
- culls your Gemfile, detects the licenses of the gems in it, and gives you a report
183
- that you can act on. If you already know\n what licenses your business is comfortable
184
- with, you can whitelist them, leaving you with an action report of only those dependencies
185
- that have\n licenses that fall outside of the whitelist.\n"
174
+ description: |2
175
+ Do you know the licenses of all your application's dependencies? What open source software licenses will your business accept?
176
+
177
+ LicenseFinder culls your Gemfile, detects the licenses of the gems in it, and gives you a report that you can act on. If you already know
178
+ what licenses your business is comfortable with, you can whitelist them, leaving you with an action report of only those dependencies that have
179
+ licenses that fall outside of the whitelist.
186
180
  email:
187
181
  - licensefinder@pivotalabs.com
188
182
  executables:
@@ -207,16 +201,19 @@ files:
207
201
  - db/migrate/201303291753_allow_null_license_names.rb
208
202
  - db/migrate/201304011027_allow_null_dependency_version.rb
209
203
  - db/migrate/201304020947_change_table_name_licenses_to_license_aliases.rb
204
+ - db/migrate/201304181524_add_manual_to_dependencies.rb
210
205
  - features/approve_dependencies.feature
211
206
  - features/cli.feature
212
207
  - features/html_report.feature
213
208
  - features/ignore_bundle_groups.feature
209
+ - features/non_bundler_dependencies.feature
214
210
  - features/rails_rake.feature
215
211
  - features/set_license.feature
216
212
  - features/step_definitions/approve_dependencies_steps.rb
217
213
  - features/step_definitions/cli_steps.rb
218
214
  - features/step_definitions/html_report_steps.rb
219
215
  - features/step_definitions/ignore_bundle_groups_steps.rb
216
+ - features/step_definitions/non_bundler_steps.rb
220
217
  - features/step_definitions/rails_rake_steps.rb
221
218
  - features/step_definitions/set_license_steps.rb
222
219
  - features/step_definitions/shared_steps.rb
@@ -236,13 +233,11 @@ files:
236
233
  - lib/data/licenses/SimplifiedBSD.txt
237
234
  - lib/license_finder.rb
238
235
  - lib/license_finder/bundle.rb
239
- - lib/license_finder/bundle_syncer.rb
240
236
  - lib/license_finder/bundled_gem.rb
237
+ - lib/license_finder/bundled_gem_saver.rb
241
238
  - lib/license_finder/cli.rb
242
239
  - lib/license_finder/configuration.rb
243
- - lib/license_finder/dependency_report.rb
244
- - lib/license_finder/gem_saver.rb
245
- - lib/license_finder/html_report.rb
240
+ - lib/license_finder/dependency_manager.rb
246
241
  - lib/license_finder/license.rb
247
242
  - lib/license_finder/license/apache2.rb
248
243
  - lib/license_finder/license/bsd.rb
@@ -253,18 +248,20 @@ files:
253
248
  - lib/license_finder/license/new_bsd.rb
254
249
  - lib/license_finder/license/ruby.rb
255
250
  - lib/license_finder/license/simplified_bsd.rb
256
- - lib/license_finder/license_files.rb
257
251
  - lib/license_finder/license_url.rb
258
252
  - lib/license_finder/platform.rb
259
253
  - lib/license_finder/possible_license_file.rb
254
+ - lib/license_finder/possible_license_files.rb
260
255
  - lib/license_finder/railtie.rb
261
- - lib/license_finder/reporter.rb
256
+ - lib/license_finder/reports/dependency_report.rb
257
+ - lib/license_finder/reports/html_report.rb
258
+ - lib/license_finder/reports/reporter.rb
259
+ - lib/license_finder/reports/text_report.rb
262
260
  - lib/license_finder/tables.rb
263
261
  - lib/license_finder/tables/approval.rb
264
262
  - lib/license_finder/tables/bundler_group.rb
265
263
  - lib/license_finder/tables/dependency.rb
266
264
  - lib/license_finder/tables/license_alias.rb
267
- - lib/license_finder/text_report.rb
268
265
  - lib/license_finder/yml_to_sql.rb
269
266
  - lib/tasks/license_finder.rake
270
267
  - lib/templates/html_report.erb
@@ -298,11 +295,11 @@ files:
298
295
  - spec/fixtures/readme/Readme.markdown
299
296
  - spec/fixtures/utf8_gem/README
300
297
  - spec/lib/license_finder/bundle_spec.rb
301
- - spec/lib/license_finder/bundle_syncer_spec.rb
298
+ - spec/lib/license_finder/bundled_gem_saver_spec.rb
302
299
  - spec/lib/license_finder/bundled_gem_spec.rb
303
300
  - spec/lib/license_finder/cli_spec.rb
304
301
  - spec/lib/license_finder/configuration_spec.rb
305
- - spec/lib/license_finder/gem_saver_spec.rb
302
+ - spec/lib/license_finder/dependency_manager_spec.rb
306
303
  - spec/lib/license_finder/html_report_spec.rb
307
304
  - spec/lib/license_finder/license/apache_spec.rb
308
305
  - spec/lib/license_finder/license/bsd_spec.rb
@@ -313,10 +310,10 @@ files:
313
310
  - spec/lib/license_finder/license/new_bsd_spec.rb
314
311
  - spec/lib/license_finder/license/ruby_spec.rb
315
312
  - spec/lib/license_finder/license/simplified_bsd_spec.rb
316
- - spec/lib/license_finder/license_files_spec.rb
317
313
  - spec/lib/license_finder/license_spec.rb
318
314
  - spec/lib/license_finder/license_url_spec.rb
319
315
  - spec/lib/license_finder/possible_license_file_spec.rb
316
+ - spec/lib/license_finder/possible_license_files_spec.rb
320
317
  - spec/lib/license_finder/reporter_spec.rb
321
318
  - spec/lib/license_finder/tables/dependency_spec.rb
322
319
  - spec/lib/license_finder/tables/license_alias_spec.rb
@@ -325,48 +322,44 @@ files:
325
322
  - spec/lib/license_finder_spec.rb
326
323
  - spec/spec_helper.rb
327
324
  - spec/support/license_examples.rb
325
+ - spec/support/silence_stdout.rb
328
326
  homepage: https://github.com/pivotal/LicenseFinder
329
327
  licenses:
330
328
  - MIT
329
+ metadata: {}
331
330
  post_install_message:
332
331
  rdoc_options: []
333
332
  require_paths:
334
333
  - lib
335
334
  required_ruby_version: !ruby/object:Gem::Requirement
336
- none: false
337
335
  requirements:
338
- - - ! '>='
336
+ - - '>='
339
337
  - !ruby/object:Gem::Version
340
338
  version: '0'
341
- segments:
342
- - 0
343
- hash: 3257953094972143579
344
339
  required_rubygems_version: !ruby/object:Gem::Requirement
345
- none: false
346
340
  requirements:
347
- - - ! '>='
341
+ - - '>='
348
342
  - !ruby/object:Gem::Version
349
343
  version: '0'
350
- segments:
351
- - 0
352
- hash: 3257953094972143579
353
344
  requirements: []
354
345
  rubyforge_project:
355
- rubygems_version: 1.8.25
346
+ rubygems_version: 2.0.3
356
347
  signing_key:
357
- specification_version: 3
348
+ specification_version: 4
358
349
  summary: Audit the OSS licenses of your application's dependencies.
359
350
  test_files:
360
351
  - features/approve_dependencies.feature
361
352
  - features/cli.feature
362
353
  - features/html_report.feature
363
354
  - features/ignore_bundle_groups.feature
355
+ - features/non_bundler_dependencies.feature
364
356
  - features/rails_rake.feature
365
357
  - features/set_license.feature
366
358
  - features/step_definitions/approve_dependencies_steps.rb
367
359
  - features/step_definitions/cli_steps.rb
368
360
  - features/step_definitions/html_report_steps.rb
369
361
  - features/step_definitions/ignore_bundle_groups_steps.rb
362
+ - features/step_definitions/non_bundler_steps.rb
370
363
  - features/step_definitions/rails_rake_steps.rb
371
364
  - features/step_definitions/set_license_steps.rb
372
365
  - features/step_definitions/shared_steps.rb
@@ -400,11 +393,11 @@ test_files:
400
393
  - spec/fixtures/readme/Readme.markdown
401
394
  - spec/fixtures/utf8_gem/README
402
395
  - spec/lib/license_finder/bundle_spec.rb
403
- - spec/lib/license_finder/bundle_syncer_spec.rb
396
+ - spec/lib/license_finder/bundled_gem_saver_spec.rb
404
397
  - spec/lib/license_finder/bundled_gem_spec.rb
405
398
  - spec/lib/license_finder/cli_spec.rb
406
399
  - spec/lib/license_finder/configuration_spec.rb
407
- - spec/lib/license_finder/gem_saver_spec.rb
400
+ - spec/lib/license_finder/dependency_manager_spec.rb
408
401
  - spec/lib/license_finder/html_report_spec.rb
409
402
  - spec/lib/license_finder/license/apache_spec.rb
410
403
  - spec/lib/license_finder/license/bsd_spec.rb
@@ -415,10 +408,10 @@ test_files:
415
408
  - spec/lib/license_finder/license/new_bsd_spec.rb
416
409
  - spec/lib/license_finder/license/ruby_spec.rb
417
410
  - spec/lib/license_finder/license/simplified_bsd_spec.rb
418
- - spec/lib/license_finder/license_files_spec.rb
419
411
  - spec/lib/license_finder/license_spec.rb
420
412
  - spec/lib/license_finder/license_url_spec.rb
421
413
  - spec/lib/license_finder/possible_license_file_spec.rb
414
+ - spec/lib/license_finder/possible_license_files_spec.rb
422
415
  - spec/lib/license_finder/reporter_spec.rb
423
416
  - spec/lib/license_finder/tables/dependency_spec.rb
424
417
  - spec/lib/license_finder/tables/license_alias_spec.rb
@@ -427,3 +420,4 @@ test_files:
427
420
  - spec/lib/license_finder_spec.rb
428
421
  - spec/spec_helper.rb
429
422
  - spec/support/license_examples.rb
423
+ - spec/support/silence_stdout.rb