license_scout 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/.rubocop.yml +4 -0
- data/.travis.yml +11 -0
- data/Gemfile +24 -0
- data/LICENSE +201 -0
- data/README.md +26 -0
- data/Rakefile +39 -0
- data/bin/license_scout +39 -0
- data/lib/license_scout/collector.rb +137 -0
- data/lib/license_scout/dependency.rb +20 -0
- data/lib/license_scout/dependency_manager/base.rb +55 -0
- data/lib/license_scout/dependency_manager/bundler/LICENSE.md +23 -0
- data/lib/license_scout/dependency_manager/bundler/_bundler_script.rb +47 -0
- data/lib/license_scout/dependency_manager/bundler.rb +159 -0
- data/lib/license_scout/dependency_manager/rebar.rb +92 -0
- data/lib/license_scout/dependency_manager.rb +27 -0
- data/lib/license_scout/exceptions.rb +74 -0
- data/lib/license_scout/license_file_analyzer/any_matcher.rb +37 -0
- data/lib/license_scout/license_file_analyzer/definitions.rb +212 -0
- data/lib/license_scout/license_file_analyzer/header_matcher.rb +34 -0
- data/lib/license_scout/license_file_analyzer/matcher.rb +46 -0
- data/lib/license_scout/license_file_analyzer/template.rb +45 -0
- data/lib/license_scout/license_file_analyzer/templates/Apache2-short.txt +11 -0
- data/lib/license_scout/license_file_analyzer/templates/Apache2.txt +172 -0
- data/lib/license_scout/license_file_analyzer/templates/BSD-2-Clause-bullets.txt +18 -0
- data/lib/license_scout/license_file_analyzer/templates/BSD-2-Clause.txt +19 -0
- data/lib/license_scout/license_file_analyzer/templates/BSD-3-Clause-alt-format.txt +24 -0
- data/lib/license_scout/license_file_analyzer/templates/BSD-3-Clause.txt +21 -0
- data/lib/license_scout/license_file_analyzer/templates/BSD.txt +24 -0
- data/lib/license_scout/license_file_analyzer/templates/EPLICENSE.txt +286 -0
- data/lib/license_scout/license_file_analyzer/templates/GPL-2.0.txt +339 -0
- data/lib/license_scout/license_file_analyzer/templates/GPL-3.0.txt +674 -0
- data/lib/license_scout/license_file_analyzer/templates/ISC.txt +2 -0
- data/lib/license_scout/license_file_analyzer/templates/LGPL-3.0.txt +165 -0
- data/lib/license_scout/license_file_analyzer/templates/MIT.txt +9 -0
- data/lib/license_scout/license_file_analyzer/templates/MPL2.txt +373 -0
- data/lib/license_scout/license_file_analyzer/templates/Python-2.0.txt +47 -0
- data/lib/license_scout/license_file_analyzer/templates/Ruby.txt +52 -0
- data/lib/license_scout/license_file_analyzer/text.rb +46 -0
- data/lib/license_scout/license_file_analyzer.rb +26 -0
- data/lib/license_scout/net_fetcher.rb +104 -0
- data/lib/license_scout/options.rb +45 -0
- data/lib/license_scout/overrides.rb +149 -0
- data/lib/license_scout/version.rb +20 -0
- data/lib/license_scout.rb +19 -0
- data/license_scout.gemspec +46 -0
- metadata +190 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
# Copied from https://github.com/pivotal/LicenseFinder
|
2
|
+
#
|
3
|
+
# The MIT License
|
4
|
+
#
|
5
|
+
# Copyright (c) 2012 Pivotal Labs
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
# THE SOFTWARE.
|
24
|
+
|
25
|
+
module LicenseScout
|
26
|
+
module LicenseFileAnalyzer
|
27
|
+
module Text
|
28
|
+
SPACES = /[[:space:]]+/
|
29
|
+
QUOTES = /['`"]{1,2}/
|
30
|
+
PLACEHOLDERS = /<[^<>]+>/
|
31
|
+
|
32
|
+
def self.normalize_punctuation(text)
|
33
|
+
text.gsub(SPACES, " ")
|
34
|
+
.gsub(QUOTES, '"')
|
35
|
+
.strip
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.compile_to_regex(text)
|
39
|
+
text = normalize_punctuation(text)
|
40
|
+
regex_source = Regexp.escape(text)
|
41
|
+
regex_source = regex_source.gsub(PLACEHOLDERS, "(.*)")
|
42
|
+
Regexp.new(regex_source, Regexp::IGNORECASE)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
require "license_scout/license_file_analyzer/definitions"
|
19
|
+
|
20
|
+
module LicenseScout
|
21
|
+
module LicenseFileAnalyzer
|
22
|
+
def self.find_by_text(text)
|
23
|
+
Definitions.all.detect { |l| l.matches_text? text }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
require "open-uri"
|
19
|
+
require "tmpdir"
|
20
|
+
require "digest"
|
21
|
+
|
22
|
+
require "license_scout/exceptions"
|
23
|
+
|
24
|
+
module LicenseScout
|
25
|
+
class NetFetcher
|
26
|
+
|
27
|
+
def self.remote?(uri_or_path)
|
28
|
+
!URI(uri_or_path).scheme.nil?
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.cache(uri)
|
32
|
+
fetcher = new(uri)
|
33
|
+
fetcher.fetch!
|
34
|
+
fetcher.cache_path
|
35
|
+
end
|
36
|
+
|
37
|
+
attr_reader :from_url
|
38
|
+
|
39
|
+
def initialize(from_url)
|
40
|
+
@from_url = from_url
|
41
|
+
end
|
42
|
+
|
43
|
+
def fetch!
|
44
|
+
download_file! unless exists_in_cache?
|
45
|
+
end
|
46
|
+
|
47
|
+
def cache_dir
|
48
|
+
File.join(Dir.tmpdir, "license_scout_cache")
|
49
|
+
end
|
50
|
+
|
51
|
+
def cache_path
|
52
|
+
File.join(cache_dir, url_cache_key, File.basename(from_url))
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def exists_in_cache?
|
58
|
+
File.exist?(cache_path)
|
59
|
+
end
|
60
|
+
|
61
|
+
def url_cache_key
|
62
|
+
d = Digest::SHA256.new
|
63
|
+
d.update(from_url)
|
64
|
+
d.hexdigest
|
65
|
+
end
|
66
|
+
|
67
|
+
def save_to_cache(file)
|
68
|
+
cache_directory = File.dirname(cache_path)
|
69
|
+
FileUtils.mkdir_p(cache_directory) unless File.exist?(cache_directory)
|
70
|
+
|
71
|
+
File.open(cache_path, "w+") do |output_file|
|
72
|
+
output_file.print(file.read)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# This method is highly inspired from:
|
77
|
+
# https://github.com/chef/omnibus/blob/master/lib/omnibus/download_helpers.rb
|
78
|
+
def download_file!
|
79
|
+
retries = 3
|
80
|
+
|
81
|
+
begin
|
82
|
+
options = {
|
83
|
+
:read_timeout => 60,
|
84
|
+
}
|
85
|
+
|
86
|
+
open(from_url, options) do |f|
|
87
|
+
save_to_cache(f)
|
88
|
+
end
|
89
|
+
rescue SocketError,
|
90
|
+
Errno::ECONNREFUSED,
|
91
|
+
Errno::ECONNRESET,
|
92
|
+
Errno::ENETUNREACH,
|
93
|
+
Timeout::Error,
|
94
|
+
OpenURI::HTTPError => e
|
95
|
+
if retries != 0
|
96
|
+
retries -= 1
|
97
|
+
retry
|
98
|
+
else
|
99
|
+
raise Exceptions::NetworkError.new(from_url, e)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
require "license_scout/overrides"
|
19
|
+
|
20
|
+
module LicenseScout
|
21
|
+
class Options
|
22
|
+
SUPPORTED_OPTIONS = [:overrides, :environment, :ruby_bin]
|
23
|
+
|
24
|
+
SUPPORTED_OPTIONS.each do |o|
|
25
|
+
self.send(:attr_reader, o)
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(options = {})
|
29
|
+
SUPPORTED_OPTIONS.each do |o|
|
30
|
+
data = options[o] || defaults[o]
|
31
|
+
instance_variable_set("@#{o}".to_sym, data)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def defaults
|
38
|
+
{
|
39
|
+
overrides: Overrides.new,
|
40
|
+
environment: {},
|
41
|
+
ruby_bin: nil,
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
require "license_scout/net_fetcher"
|
19
|
+
|
20
|
+
require "pathname"
|
21
|
+
|
22
|
+
module LicenseScout
|
23
|
+
class Overrides
|
24
|
+
|
25
|
+
class OverrideLicenseSet
|
26
|
+
|
27
|
+
attr_reader :license_locations
|
28
|
+
|
29
|
+
def initialize(license_locations)
|
30
|
+
@license_locations = license_locations || []
|
31
|
+
end
|
32
|
+
|
33
|
+
def empty?
|
34
|
+
license_locations.empty?
|
35
|
+
end
|
36
|
+
|
37
|
+
def resolve_locations(dependency_root_dir)
|
38
|
+
license_locations.map do |license_location|
|
39
|
+
if NetFetcher.remote?(license_location)
|
40
|
+
NetFetcher.cache(license_location)
|
41
|
+
else
|
42
|
+
normalize_and_verify_path(license_location, dependency_root_dir)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def normalize_and_verify_path(license_location, dependency_root_dir)
|
48
|
+
full_path = File.expand_path(license_location, dependency_root_dir)
|
49
|
+
if File.exists?(full_path)
|
50
|
+
full_path
|
51
|
+
else
|
52
|
+
raise Exceptions::InvalidOverride, "Provided license file path '#{license_location}' can not be found under detected dependency path '#{dependency_root_dir}'."
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
attr_reader :override_rules
|
59
|
+
|
60
|
+
def initialize(&rules)
|
61
|
+
@override_rules = {}
|
62
|
+
instance_eval(&rules) if block_given?
|
63
|
+
|
64
|
+
default_overrides
|
65
|
+
end
|
66
|
+
|
67
|
+
def override_license(dependency_manager, dependency_name, &rule)
|
68
|
+
override_rules[dependency_manager] ||= {}
|
69
|
+
override_rules[dependency_manager][dependency_name] = rule
|
70
|
+
end
|
71
|
+
|
72
|
+
def license_for(dependency_manager, dependency_name, dependency_version)
|
73
|
+
license_data = license_data_for(dependency_manager, dependency_name, dependency_version)
|
74
|
+
license_data && license_data[:license]
|
75
|
+
end
|
76
|
+
|
77
|
+
def license_files_for(dependency_manager, dependency_name, dependency_version)
|
78
|
+
license_data = license_data_for(dependency_manager, dependency_name, dependency_version)
|
79
|
+
OverrideLicenseSet.new(license_data && license_data[:license_files])
|
80
|
+
end
|
81
|
+
|
82
|
+
def have_override_for?(dependency_manager, dependency_name, dependency_version)
|
83
|
+
override_rules.key?(dependency_manager) && override_rules[dependency_manager].key?(dependency_name)
|
84
|
+
end
|
85
|
+
|
86
|
+
private
|
87
|
+
|
88
|
+
def license_data_for(dependency_manager, dependency_name, dependency_version)
|
89
|
+
return nil unless have_override_for?(dependency_manager, dependency_name, dependency_version)
|
90
|
+
override_rules[dependency_manager][dependency_name].call(dependency_version)
|
91
|
+
end
|
92
|
+
|
93
|
+
def default_overrides
|
94
|
+
# Default overrides for ruby_bundler dependency manager.
|
95
|
+
[
|
96
|
+
["debug_inspector", "MIT", ["README.md"]],
|
97
|
+
["inifile", "MIT", ["README.md"]],
|
98
|
+
["syslog-logger", "MIT", ["README.rdoc"]],
|
99
|
+
["httpclient", "Ruby", ["README.md"]],
|
100
|
+
["little-plugger", "MIT", ["README.rdoc"]],
|
101
|
+
["logging", "MIT", ["README.md"]],
|
102
|
+
["coderay", nil, ["README_INDEX.rdoc"]],
|
103
|
+
["multipart-post", "MIT", ["README.md"]],
|
104
|
+
["erubis", "MIT", nil],
|
105
|
+
["binding_of_caller", "MIT", nil],
|
106
|
+
["method_source", "MIT", nil],
|
107
|
+
["pry-remote", "MIT", nil],
|
108
|
+
["pry-stack_explorer", "MIT", nil],
|
109
|
+
["plist", "MIT", nil],
|
110
|
+
["proxifier", "MIT", nil],
|
111
|
+
["mixlib-shellout", "Apache-2.0", nil],
|
112
|
+
["mixlib-log", "Apache-2.0", nil],
|
113
|
+
["uuidtools", "Apache-2.0", nil],
|
114
|
+
["cheffish", "Apache-2.0", nil],
|
115
|
+
["chef-provisioning", "Apache-2.0", nil],
|
116
|
+
["chef-provisioning-aws", "Apache-2.0", nil],
|
117
|
+
["chef-rewind", "MIT", nil],
|
118
|
+
["ubuntu_ami", "Apache-2.0", nil],
|
119
|
+
["net-telnet", "Ruby", nil],
|
120
|
+
# Overrides that require file fetching from internet
|
121
|
+
["sfl", "Ruby", ["https://raw.githubusercontent.com/ujihisa/spawn-for-legacy/master/LICENCE.md"]],
|
122
|
+
["json_pure", nil, ["https://raw.githubusercontent.com/flori/json/master/README.md"]],
|
123
|
+
["aws-sdk-core", nil, ["https://raw.githubusercontent.com/aws/aws-sdk-ruby/master/README.md"]],
|
124
|
+
["aws-sdk-resources", nil, ["https://raw.githubusercontent.com/aws/aws-sdk-ruby/master/README.md"]],
|
125
|
+
["aws-sdk", nil, ["https://raw.githubusercontent.com/aws/aws-sdk-ruby/master/README.md"]],
|
126
|
+
["fuzzyurl", nil, ["https://raw.githubusercontent.com/gamache/fuzzyurl/master/LICENSE.txt"]],
|
127
|
+
["jwt", nil, ["https://github.com/jwt/ruby-jwt/blob/master/LICENSE"]],
|
128
|
+
["win32-process", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
129
|
+
["win32-api", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
130
|
+
["win32-dir", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
131
|
+
["win32-ipc", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
132
|
+
["win32-event", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
133
|
+
["win32-eventlog", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
134
|
+
["win32-mmap", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
135
|
+
["win32-mutex", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
136
|
+
["win32-service", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
137
|
+
["windows-api", nil, ["http://www.perlfoundation.org/attachment/legal/artistic-2_0.txt"]],
|
138
|
+
].each do |override_data|
|
139
|
+
override_license "ruby_bundler", override_data[0] do |version|
|
140
|
+
{}.tap do |d|
|
141
|
+
d[:license] = override_data[1] if override_data[1]
|
142
|
+
d[:license_files] = override_data[2] if override_data[2]
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
module LicenseScout
|
19
|
+
VERSION = "0.1.0"
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
module LicenseScout
|
19
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2016, Chef Software Inc.
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
lib = File.expand_path("../lib", __FILE__)
|
19
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
20
|
+
require "license_scout/version"
|
21
|
+
|
22
|
+
Gem::Specification.new do |spec|
|
23
|
+
spec.name = "license_scout"
|
24
|
+
spec.version = LicenseScout::VERSION
|
25
|
+
spec.authors = [ "Serdar Sutay" ]
|
26
|
+
spec.email = [ "serdar@chef.io" ]
|
27
|
+
spec.license = "Apache-2.0"
|
28
|
+
|
29
|
+
spec.summary = "Discovers license files of a project's dependencies."
|
30
|
+
spec.description = "Discovers license files of a project's dependencies."
|
31
|
+
spec.homepage = "https://github.com/chef/license_scout"
|
32
|
+
|
33
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
spec.bindir = "bin"
|
35
|
+
spec.executables = %w{license_scout}
|
36
|
+
spec.require_paths = %w{lib}
|
37
|
+
|
38
|
+
spec.add_dependency "ffi-yajl", "~> 2.2"
|
39
|
+
spec.add_dependency "mixlib-shellout", "~> 2.2"
|
40
|
+
|
41
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
42
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
43
|
+
spec.add_development_dependency "rspec"
|
44
|
+
spec.add_development_dependency "pry"
|
45
|
+
spec.add_development_dependency "rb-readline"
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: license_scout
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Serdar Sutay
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: ffi-yajl
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mixlib-shellout
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rb-readline
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Discovers license files of a project's dependencies.
|
112
|
+
email:
|
113
|
+
- serdar@chef.io
|
114
|
+
executables:
|
115
|
+
- license_scout
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- ".travis.yml"
|
123
|
+
- Gemfile
|
124
|
+
- LICENSE
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/license_scout
|
128
|
+
- lib/license_scout.rb
|
129
|
+
- lib/license_scout/collector.rb
|
130
|
+
- lib/license_scout/dependency.rb
|
131
|
+
- lib/license_scout/dependency_manager.rb
|
132
|
+
- lib/license_scout/dependency_manager/base.rb
|
133
|
+
- lib/license_scout/dependency_manager/bundler.rb
|
134
|
+
- lib/license_scout/dependency_manager/bundler/LICENSE.md
|
135
|
+
- lib/license_scout/dependency_manager/bundler/_bundler_script.rb
|
136
|
+
- lib/license_scout/dependency_manager/rebar.rb
|
137
|
+
- lib/license_scout/exceptions.rb
|
138
|
+
- lib/license_scout/license_file_analyzer.rb
|
139
|
+
- lib/license_scout/license_file_analyzer/any_matcher.rb
|
140
|
+
- lib/license_scout/license_file_analyzer/definitions.rb
|
141
|
+
- lib/license_scout/license_file_analyzer/header_matcher.rb
|
142
|
+
- lib/license_scout/license_file_analyzer/matcher.rb
|
143
|
+
- lib/license_scout/license_file_analyzer/template.rb
|
144
|
+
- lib/license_scout/license_file_analyzer/templates/Apache2-short.txt
|
145
|
+
- lib/license_scout/license_file_analyzer/templates/Apache2.txt
|
146
|
+
- lib/license_scout/license_file_analyzer/templates/BSD-2-Clause-bullets.txt
|
147
|
+
- lib/license_scout/license_file_analyzer/templates/BSD-2-Clause.txt
|
148
|
+
- lib/license_scout/license_file_analyzer/templates/BSD-3-Clause-alt-format.txt
|
149
|
+
- lib/license_scout/license_file_analyzer/templates/BSD-3-Clause.txt
|
150
|
+
- lib/license_scout/license_file_analyzer/templates/BSD.txt
|
151
|
+
- lib/license_scout/license_file_analyzer/templates/EPLICENSE.txt
|
152
|
+
- lib/license_scout/license_file_analyzer/templates/GPL-2.0.txt
|
153
|
+
- lib/license_scout/license_file_analyzer/templates/GPL-3.0.txt
|
154
|
+
- lib/license_scout/license_file_analyzer/templates/ISC.txt
|
155
|
+
- lib/license_scout/license_file_analyzer/templates/LGPL-3.0.txt
|
156
|
+
- lib/license_scout/license_file_analyzer/templates/MIT.txt
|
157
|
+
- lib/license_scout/license_file_analyzer/templates/MPL2.txt
|
158
|
+
- lib/license_scout/license_file_analyzer/templates/Python-2.0.txt
|
159
|
+
- lib/license_scout/license_file_analyzer/templates/Ruby.txt
|
160
|
+
- lib/license_scout/license_file_analyzer/text.rb
|
161
|
+
- lib/license_scout/net_fetcher.rb
|
162
|
+
- lib/license_scout/options.rb
|
163
|
+
- lib/license_scout/overrides.rb
|
164
|
+
- lib/license_scout/version.rb
|
165
|
+
- license_scout.gemspec
|
166
|
+
homepage: https://github.com/chef/license_scout
|
167
|
+
licenses:
|
168
|
+
- Apache-2.0
|
169
|
+
metadata: {}
|
170
|
+
post_install_message:
|
171
|
+
rdoc_options: []
|
172
|
+
require_paths:
|
173
|
+
- lib
|
174
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubyforge_project:
|
186
|
+
rubygems_version: 2.6.6
|
187
|
+
signing_key:
|
188
|
+
specification_version: 4
|
189
|
+
summary: Discovers license files of a project's dependencies.
|
190
|
+
test_files: []
|