license_finder 0.8.2-java → 0.9.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/CHANGELOG.rdoc +7 -0
  2. data/features/cli.feature +11 -1
  3. data/features/html_report.feature +1 -1
  4. data/features/ignore_bundle_groups.feature +8 -8
  5. data/features/step_definitions/approve_dependencies_steps.rb +1 -1
  6. data/features/step_definitions/cli_steps.rb +17 -1
  7. data/features/step_definitions/html_report_steps.rb +1 -1
  8. data/features/step_definitions/ignore_bundle_groups_steps.rb +6 -6
  9. data/features/step_definitions/non_bundler_steps.rb +4 -4
  10. data/features/step_definitions/rails_rake_steps.rb +1 -1
  11. data/features/step_definitions/set_license_steps.rb +2 -2
  12. data/features/step_definitions/shared_steps.rb +4 -4
  13. data/features/step_definitions/whitelist_steps.rb +33 -2
  14. data/features/whitelist.feature +19 -1
  15. data/lib/license_finder.rb +4 -1
  16. data/lib/license_finder/bundle.rb +3 -1
  17. data/lib/license_finder/bundled_gem.rb +1 -1
  18. data/lib/license_finder/bundled_gem_saver.rb +35 -12
  19. data/lib/license_finder/cli.rb +50 -8
  20. data/lib/license_finder/configuration.rb +6 -4
  21. data/lib/license_finder/dependency_manager.rb +1 -2
  22. data/lib/license_finder/license/new_bsd.rb +19 -0
  23. data/license_finder.gemspec +3 -2
  24. data/readme.md +24 -1
  25. data/spec/lib/license_finder/bundled_gem_saver_spec.rb +131 -84
  26. data/spec/lib/license_finder/cli_spec.rb +44 -4
  27. data/spec/lib/license_finder/configuration_spec.rb +15 -3
  28. data/spec/lib/license_finder/dependency_manager_spec.rb +1 -1
  29. data/spec/lib/license_finder/license/new_bsd_spec.rb +28 -0
  30. data/spec/lib/license_finder_spec.rb +1 -1
  31. metadata +67 -52
  32. data/lib/license_finder/bundler_group_manager.rb +0 -22
  33. data/spec/lib/license_finder/bundler_group_manager_spec.rb +0 -60
@@ -59,7 +59,7 @@ module LicenseFinder
59
59
  end
60
60
  end
61
61
 
62
- describe "#save_to_yaml" do
62
+ describe "#save" do
63
63
  let(:tmp_yml) { '.tmp.configuration_spec.yml' }
64
64
 
65
65
  before do
@@ -73,7 +73,7 @@ module LicenseFinder
73
73
  end
74
74
 
75
75
  it "writes the whitelist to the yaml file" do
76
- config.save_to_yaml
76
+ config.save
77
77
 
78
78
  yaml = YAML.load(File.read(tmp_yml))
79
79
 
@@ -81,13 +81,25 @@ module LicenseFinder
81
81
  end
82
82
 
83
83
  it "writes the ignored bundler groups to the yaml file" do
84
- config.save_to_yaml
84
+ config.save
85
85
 
86
86
  yaml = YAML.load(File.read(tmp_yml))
87
87
 
88
88
  yaml["ignore_groups"].should include("other_group")
89
89
  yaml["ignore_groups"].should include("test")
90
90
  end
91
+
92
+ it "doesn't write duplicate entries" do
93
+ config.whitelist << 'my_gem'
94
+ config.ignore_groups << 'test'
95
+
96
+ config.save
97
+
98
+ yaml = YAML.load(File.read(tmp_yml))
99
+
100
+ yaml["whitelist"].count("my_gem").should == 1
101
+ yaml["ignore_groups"].count("test").should == 1
102
+ end
91
103
  end
92
104
  end
93
105
  end
@@ -22,7 +22,7 @@ module LicenseFinder
22
22
  double(:gem1, save_as_dependency: cur1),
23
23
  double(:gem2, save_as_dependency: cur2)
24
24
  ]
25
- Bundle.stub(:current_gems) { current_gems }
25
+ LicenseFinder.stub(:current_gems) { current_gems }
26
26
 
27
27
  described_class.sync_with_bundler
28
28
  Dependency.all.map(&:name).should =~ [cur1, cur2, man1].map(&:name)
@@ -18,6 +18,34 @@ modification, are permitted provided that the following conditions are met:
18
18
  names of its contributors may be used to endorse or promote products
19
19
  derived from this software without specific prior written permission.
20
20
 
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24
+ DISCLAIMED. IN NO EVENT SHALL Johnny %$#!.43298432, Guitar BE LIABLE FOR ANY
25
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ LICENSE
32
+
33
+ license.should be_matches
34
+ end
35
+
36
+ it "should match with the alternate wording of third clause" do
37
+ license = LicenseFinder::License::NewBSD.new <<-LICENSE
38
+ Redistribution and use in source and binary forms, with or without
39
+ modification, are permitted provided that the following conditions are met:
40
+ * Redistributions of source code must retain the above copyright
41
+ notice, this list of conditions and the following disclaimer.
42
+ * Redistributions in binary form must reproduce the above copyright
43
+ notice, this list of conditions and the following disclaimer in the
44
+ documentation and/or other materials provided with the distribution.
45
+ * The names of its contributors may not be used to endorse or promote
46
+ products derived from this software without specific prior written
47
+ permission.
48
+
21
49
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22
50
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23
51
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -49,7 +49,7 @@ describe LicenseFinder do
49
49
 
50
50
  describe "#ignore_groups" do
51
51
  it "should load a ignore_groups list from license_finder.yml" do
52
- LicenseFinder.config.ignore_groups.should == [:test, :development]
52
+ LicenseFinder.config.ignore_groups.should == ["test", "development"]
53
53
  end
54
54
 
55
55
  it "should load an empty ignore_groups list from license_finder.yml when there are no ignore groups" do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: license_finder
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.2
5
+ version: 0.9.0
6
6
  platform: java
7
7
  authors:
8
8
  - Jacob Maine
@@ -16,21 +16,23 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2013-07-10 00:00:00.000000000 Z
19
+ date: 2013-07-16 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: bundler
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: !binary |-
28
+ MA==
28
29
  none: false
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - '>='
32
+ - - ">="
32
33
  - !ruby/object:Gem::Version
33
- version: '0'
34
+ version: !binary |-
35
+ MA==
34
36
  none: false
35
37
  prerelease: false
36
38
  type: :runtime
@@ -38,15 +40,17 @@ dependencies:
38
40
  name: sequel
39
41
  version_requirements: !ruby/object:Gem::Requirement
40
42
  requirements:
41
- - - '>='
43
+ - - ">="
42
44
  - !ruby/object:Gem::Version
43
- version: '0'
45
+ version: !binary |-
46
+ MA==
44
47
  none: false
45
48
  requirement: !ruby/object:Gem::Requirement
46
49
  requirements:
47
- - - '>='
50
+ - - ">="
48
51
  - !ruby/object:Gem::Version
49
- version: '0'
52
+ version: !binary |-
53
+ MA==
50
54
  none: false
51
55
  prerelease: false
52
56
  type: :runtime
@@ -54,63 +58,71 @@ dependencies:
54
58
  name: thor
55
59
  version_requirements: !ruby/object:Gem::Requirement
56
60
  requirements:
57
- - - '>='
61
+ - - ">="
58
62
  - !ruby/object:Gem::Version
59
- version: '0'
63
+ version: !binary |-
64
+ MA==
60
65
  none: false
61
66
  requirement: !ruby/object:Gem::Requirement
62
67
  requirements:
63
- - - '>='
68
+ - - ">="
64
69
  - !ruby/object:Gem::Version
65
- version: '0'
70
+ version: !binary |-
71
+ MA==
66
72
  none: false
67
73
  prerelease: false
68
74
  type: :runtime
69
75
  - !ruby/object:Gem::Dependency
70
- name: jdbc-sqlite3
76
+ name: rake
71
77
  version_requirements: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - '>='
79
+ - - ">="
74
80
  - !ruby/object:Gem::Version
75
- version: '0'
81
+ version: !binary |-
82
+ MA==
76
83
  none: false
77
84
  requirement: !ruby/object:Gem::Requirement
78
85
  requirements:
79
- - - '>='
86
+ - - ">="
80
87
  - !ruby/object:Gem::Version
81
- version: '0'
88
+ version: !binary |-
89
+ MA==
82
90
  none: false
83
91
  prerelease: false
84
92
  type: :runtime
85
93
  - !ruby/object:Gem::Dependency
86
- name: rspec
94
+ name: jdbc-sqlite3
87
95
  version_requirements: !ruby/object:Gem::Requirement
88
96
  requirements:
89
- - - '>='
97
+ - - ">="
90
98
  - !ruby/object:Gem::Version
91
- version: '0'
99
+ version: !binary |-
100
+ MA==
92
101
  none: false
93
102
  requirement: !ruby/object:Gem::Requirement
94
103
  requirements:
95
- - - '>='
104
+ - - ">="
96
105
  - !ruby/object:Gem::Version
97
- version: '0'
106
+ version: !binary |-
107
+ MA==
98
108
  none: false
99
109
  prerelease: false
100
- type: :development
110
+ type: :runtime
101
111
  - !ruby/object:Gem::Dependency
102
- name: rake
112
+ name: rspec
103
113
  version_requirements: !ruby/object:Gem::Requirement
104
114
  requirements:
105
- - - '>='
115
+ - - ">="
106
116
  - !ruby/object:Gem::Version
107
- version: '0'
117
+ version: !binary |-
118
+ MA==
108
119
  none: false
109
120
  requirement: !ruby/object:Gem::Requirement
110
121
  requirements:
111
- - - '>='
122
+ - - ">="
112
123
  - !ruby/object:Gem::Version
113
- version: '0'
124
+ version: !binary |-
125
+ MA==
114
126
  none: false
115
127
  prerelease: false
116
128
  type: :development
@@ -118,15 +130,17 @@ dependencies:
118
130
  name: xpath
119
131
  version_requirements: !ruby/object:Gem::Requirement
120
132
  requirements:
121
- - - '>='
133
+ - - ">="
122
134
  - !ruby/object:Gem::Version
123
- version: '0'
135
+ version: !binary |-
136
+ MA==
124
137
  none: false
125
138
  requirement: !ruby/object:Gem::Requirement
126
139
  requirements:
127
- - - '>='
140
+ - - ">="
128
141
  - !ruby/object:Gem::Version
129
- version: '0'
142
+ version: !binary |-
143
+ MA==
130
144
  none: false
131
145
  prerelease: false
132
146
  type: :development
@@ -134,15 +148,17 @@ dependencies:
134
148
  name: cucumber
135
149
  version_requirements: !ruby/object:Gem::Requirement
136
150
  requirements:
137
- - - '>='
151
+ - - ">="
138
152
  - !ruby/object:Gem::Version
139
- version: '0'
153
+ version: !binary |-
154
+ MA==
140
155
  none: false
141
156
  requirement: !ruby/object:Gem::Requirement
142
157
  requirements:
143
- - - '>='
158
+ - - ">="
144
159
  - !ruby/object:Gem::Version
145
- version: '0'
160
+ version: !binary |-
161
+ MA==
146
162
  none: false
147
163
  prerelease: false
148
164
  type: :development
@@ -166,13 +182,13 @@ dependencies:
166
182
  name: capybara
167
183
  version_requirements: !ruby/object:Gem::Requirement
168
184
  requirements:
169
- - - ~>
185
+ - - "~>"
170
186
  - !ruby/object:Gem::Version
171
187
  version: 2.0.0
172
188
  none: false
173
189
  requirement: !ruby/object:Gem::Requirement
174
190
  requirements:
175
- - - ~>
191
+ - - "~>"
176
192
  - !ruby/object:Gem::Version
177
193
  version: 2.0.0
178
194
  none: false
@@ -182,13 +198,13 @@ dependencies:
182
198
  name: rails
183
199
  version_requirements: !ruby/object:Gem::Requirement
184
200
  requirements:
185
- - - ~>
201
+ - - "~>"
186
202
  - !ruby/object:Gem::Version
187
203
  version: 3.2.0
188
204
  none: false
189
205
  requirement: !ruby/object:Gem::Requirement
190
206
  requirements:
191
- - - ~>
207
+ - - "~>"
192
208
  - !ruby/object:Gem::Version
193
209
  version: 3.2.0
194
210
  none: false
@@ -207,9 +223,9 @@ executables:
207
223
  extensions: []
208
224
  extra_rdoc_files: []
209
225
  files:
210
- - .gitignore
211
- - .rspec
212
- - .travis.yml
226
+ - ".gitignore"
227
+ - ".rspec"
228
+ - ".travis.yml"
213
229
  - CHANGELOG.rdoc
214
230
  - Gemfile
215
231
  - LICENSE
@@ -258,7 +274,6 @@ files:
258
274
  - lib/license_finder/bundle.rb
259
275
  - lib/license_finder/bundled_gem.rb
260
276
  - lib/license_finder/bundled_gem_saver.rb
261
- - lib/license_finder/bundler_group_manager.rb
262
277
  - lib/license_finder/cli.rb
263
278
  - lib/license_finder/configuration.rb
264
279
  - lib/license_finder/dependency_manager.rb
@@ -321,7 +336,6 @@ files:
321
336
  - spec/lib/license_finder/bundle_spec.rb
322
337
  - spec/lib/license_finder/bundled_gem_saver_spec.rb
323
338
  - spec/lib/license_finder/bundled_gem_spec.rb
324
- - spec/lib/license_finder/bundler_group_manager_spec.rb
325
339
  - spec/lib/license_finder/cli_spec.rb
326
340
  - spec/lib/license_finder/configuration_spec.rb
327
341
  - spec/lib/license_finder/dependency_manager_spec.rb
@@ -357,21 +371,23 @@ require_paths:
357
371
  - lib
358
372
  required_ruby_version: !ruby/object:Gem::Requirement
359
373
  requirements:
360
- - - '>='
374
+ - - ">="
361
375
  - !ruby/object:Gem::Version
362
376
  segments:
363
377
  - 0
364
378
  hash: 2
365
- version: '0'
379
+ version: !binary |-
380
+ MA==
366
381
  none: false
367
382
  required_rubygems_version: !ruby/object:Gem::Requirement
368
383
  requirements:
369
- - - '>='
384
+ - - ">="
370
385
  - !ruby/object:Gem::Version
371
386
  segments:
372
387
  - 0
373
388
  hash: 2
374
- version: '0'
389
+ version: !binary |-
390
+ MA==
375
391
  none: false
376
392
  requirements: []
377
393
  rubyforge_project:
@@ -427,7 +443,6 @@ test_files:
427
443
  - spec/lib/license_finder/bundle_spec.rb
428
444
  - spec/lib/license_finder/bundled_gem_saver_spec.rb
429
445
  - spec/lib/license_finder/bundled_gem_spec.rb
430
- - spec/lib/license_finder/bundler_group_manager_spec.rb
431
446
  - spec/lib/license_finder/cli_spec.rb
432
447
  - spec/lib/license_finder/configuration_spec.rb
433
448
  - spec/lib/license_finder/dependency_manager_spec.rb
@@ -1,22 +0,0 @@
1
- module LicenseFinder
2
- module BundlerGroupManager
3
- def self.add_ignored_group(group)
4
- config = LicenseFinder.config
5
- ignored_groups = config.ignore_groups.map(&:to_s)
6
- return if ignored_groups.include?(group)
7
-
8
- config.ignore_groups << group.to_sym
9
- config.save_to_yaml
10
- end
11
-
12
- def self.remove_ignored_group(group)
13
- config = LicenseFinder.config
14
- ignored_groups = config.ignore_groups.map(&:to_s)
15
- return unless ignored_groups.include?(group)
16
-
17
- config.ignore_groups.delete(group.to_sym)
18
- config.save_to_yaml
19
- end
20
- end
21
- end
22
-
@@ -1,60 +0,0 @@
1
- require "spec_helper"
2
-
3
- module LicenseFinder
4
- describe BundlerGroupManager do
5
- let(:config) { Configuration.new }
6
-
7
- before do
8
- LicenseFinder.stub(:config).and_return config
9
- config.ignore_groups = ignore_groups
10
- end
11
-
12
- describe ".add_ignored_group" do
13
- describe "when the group is already ignored" do
14
- let(:ignore_groups) { ["test", "other_group"] }
15
-
16
- it "does not create a duplicate entry" do
17
- config.should_not_receive(:save_to_yaml)
18
-
19
- described_class.add_ignored_group("test")
20
- end
21
- end
22
-
23
- describe "when the group is not ignored" do
24
- let(:ignore_groups) { [] }
25
-
26
- it "adds the group to the ignored bundler groups" do
27
- config.should_receive(:save_to_yaml)
28
-
29
- described_class.add_ignored_group("test")
30
-
31
- config.ignore_groups.should include(:test)
32
- end
33
- end
34
- end
35
-
36
- describe ".remove_ignored_group" do
37
- describe "when the group is not ignored" do
38
- let(:ignore_groups) { [] }
39
-
40
- it "does not call save_to_yaml on config" do
41
- config.should_not_receive(:save_to_yaml)
42
-
43
- described_class.remove_ignored_group("test")
44
- end
45
- end
46
-
47
- describe "when the group is already ignored" do
48
- let(:ignore_groups) { ["test", "other_group"] }
49
-
50
- it "removes the group from the ignored bundler group list" do
51
- config.should_receive(:save_to_yaml)
52
-
53
- described_class.remove_ignored_group("test")
54
-
55
- config.ignore_groups.should_not include(:test)
56
- end
57
- end
58
- end
59
- end
60
- end