license_finder 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +8 -0
- data/features/cli.feature +11 -1
- data/features/html_report.feature +1 -1
- data/features/ignore_bundle_groups.feature +15 -2
- data/features/step_definitions/approve_dependencies_steps.rb +1 -1
- data/features/step_definitions/cli_steps.rb +17 -1
- data/features/step_definitions/html_report_steps.rb +1 -1
- data/features/step_definitions/ignore_bundle_groups_steps.rb +18 -2
- data/features/step_definitions/non_bundler_steps.rb +4 -4
- data/features/step_definitions/rails_rake_steps.rb +1 -1
- data/features/step_definitions/set_license_steps.rb +2 -2
- data/features/step_definitions/shared_steps.rb +4 -12
- data/features/step_definitions/whitelist_steps.rb +33 -2
- data/features/whitelist.feature +19 -1
- data/lib/license_finder.rb +4 -0
- data/lib/license_finder/bundle.rb +3 -1
- data/lib/license_finder/bundled_gem.rb +1 -1
- data/lib/license_finder/bundled_gem_saver.rb +35 -12
- data/lib/license_finder/cli.rb +75 -4
- data/lib/license_finder/configuration.rb +12 -5
- data/lib/license_finder/dependency_manager.rb +1 -2
- data/lib/license_finder/license/new_bsd.rb +19 -0
- data/license_finder.gemspec +3 -2
- data/readme.md +47 -1
- data/release.md +7 -2
- data/spec/lib/license_finder/bundled_gem_saver_spec.rb +131 -84
- data/spec/lib/license_finder/cli_spec.rb +78 -6
- data/spec/lib/license_finder/configuration_spec.rb +38 -6
- data/spec/lib/license_finder/dependency_manager_spec.rb +1 -1
- data/spec/lib/license_finder/license/new_bsd_spec.rb +28 -0
- data/spec/lib/license_finder_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +6 -6
@@ -59,14 +59,46 @@ module LicenseFinder
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
describe "#
|
63
|
-
|
64
|
-
|
62
|
+
describe "#save" do
|
63
|
+
let(:tmp_yml) { '.tmp.configuration_spec.yml' }
|
64
|
+
|
65
|
+
before do
|
66
|
+
Configuration.stub(:config_file_path).and_return(tmp_yml)
|
67
|
+
config.whitelist = ['my_gem']
|
68
|
+
config.ignore_groups = ['other_group', 'test']
|
69
|
+
end
|
70
|
+
|
71
|
+
after do
|
72
|
+
File.delete(tmp_yml)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "writes the whitelist to the yaml file" do
|
76
|
+
config.save
|
77
|
+
|
78
|
+
yaml = YAML.load(File.read(tmp_yml))
|
79
|
+
|
80
|
+
yaml["whitelist"].should include("my_gem")
|
65
81
|
end
|
66
82
|
|
67
|
-
it "
|
68
|
-
config.
|
69
|
-
|
83
|
+
it "writes the ignored bundler groups to the yaml file" do
|
84
|
+
config.save
|
85
|
+
|
86
|
+
yaml = YAML.load(File.read(tmp_yml))
|
87
|
+
|
88
|
+
yaml["ignore_groups"].should include("other_group")
|
89
|
+
yaml["ignore_groups"].should include("test")
|
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
|
70
102
|
end
|
71
103
|
end
|
72
104
|
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
|
-
|
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 == [
|
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
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: license_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Maine
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2013-07-
|
18
|
+
date: 2013-07-16 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bundler
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: rake
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '>='
|
@@ -74,13 +74,13 @@ dependencies:
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
77
|
+
name: sqlite3
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
type: :
|
83
|
+
type: :runtime
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
@@ -88,7 +88,7 @@ dependencies:
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
|
-
name:
|
91
|
+
name: rspec
|
92
92
|
requirement: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '>='
|