organization_license_audit 1.0.4 → 1.0.5
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/organization_license_audit.rb +12 -5
- data/lib/organization_license_audit/version.rb +1 -1
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a89c9fdc93f0edd11c07091733e8da1d0ea842fd
|
|
4
|
+
data.tar.gz: 569e59dfc0e12564943ce11bb1c62811bc28bdf1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 936067f7327b52ecd4c3c138b7799c6a9ec31879a4beec9e8fe24b3a5c8f2f1b58f4779799ec10adbe6190e3ea80f309cfd2b3248646d184f599d252b0b427b7
|
|
7
|
+
data.tar.gz: 963a1c534f30508d42b0f85e4115ed488cb3937419a5dcb5e5bea843c8e0dc36d7d6f3ada99a8ec3a4d8760853c2881ee8aad25b1b167787e4a87911bb31f9fa
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
require "organization_license_audit/version"
|
|
2
2
|
require "tmpdir"
|
|
3
3
|
require "organization_audit"
|
|
4
|
+
require "shellwords"
|
|
4
5
|
|
|
5
6
|
module OrganizationLicenseAudit
|
|
6
7
|
BUNDLE_PATH = "vendor/bundle"
|
|
7
8
|
RESULT_LINE = /(^[a-z_\d\.-]+), ([^,]+), (.+)/i
|
|
8
9
|
APPROVAL_HEADING = "Dependencies that need approval"
|
|
9
10
|
NPM_PACKAGE_FILE = "package.json"
|
|
11
|
+
BOWER_PACKAGE_FILE = "bower.json"
|
|
10
12
|
BUNDLER_PACKAGE_FILE = "Gemfile"
|
|
11
13
|
|
|
12
14
|
class << self
|
|
@@ -107,6 +109,7 @@ module OrganizationLicenseAudit
|
|
|
107
109
|
with_clean_env do
|
|
108
110
|
bundled = prepare_bundler bundle_cache_dir, options
|
|
109
111
|
prepare_npm options
|
|
112
|
+
prepare_bower options
|
|
110
113
|
whitelist_licences options[:whitelist]
|
|
111
114
|
|
|
112
115
|
sh "#{combined_gem_path if bundled}license_finder --quiet"
|
|
@@ -114,10 +117,10 @@ module OrganizationLicenseAudit
|
|
|
114
117
|
end
|
|
115
118
|
|
|
116
119
|
def whitelist_licences(licenses)
|
|
117
|
-
licenses.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
return if licenses.none?
|
|
121
|
+
licenses = licenses.map { |l| Shellwords.escape(l) }.join(" ")
|
|
122
|
+
unless system("license_finder whitelist add #{licenses} >/dev/null")
|
|
123
|
+
raise "failed to approve #{licenses}"
|
|
121
124
|
end
|
|
122
125
|
end
|
|
123
126
|
|
|
@@ -135,6 +138,10 @@ module OrganizationLicenseAudit
|
|
|
135
138
|
end
|
|
136
139
|
end
|
|
137
140
|
|
|
141
|
+
def prepare_bower(options)
|
|
142
|
+
with_or_without "bower", BOWER_PACKAGE_FILE, options
|
|
143
|
+
end
|
|
144
|
+
|
|
138
145
|
def use_cache_dir_to_bundle(cache_dir)
|
|
139
146
|
cache_dir = File.join(cache_dir, ruby_cache)
|
|
140
147
|
FileUtils.mkdir_p cache_dir
|
|
@@ -187,7 +194,7 @@ module OrganizationLicenseAudit
|
|
|
187
194
|
if (options[:without] || []).include?(thing)
|
|
188
195
|
File.unlink(file)
|
|
189
196
|
else
|
|
190
|
-
yield
|
|
197
|
+
yield if block_given?
|
|
191
198
|
end
|
|
192
199
|
end
|
|
193
200
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: organization_license_audit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Grosser
|
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
|
29
29
|
y0kCSWmK6D+x/SbfS6r7Ke07MRqziJdB9GuE1+0cIRuFh8EQ+LN6HXCKM5pon/GU
|
|
30
30
|
ycwMXfl0
|
|
31
31
|
-----END CERTIFICATE-----
|
|
32
|
-
date: 2014-01-
|
|
32
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
|
33
33
|
dependencies:
|
|
34
34
|
- !ruby/object:Gem::Dependency
|
|
35
35
|
name: organization_audit
|
|
@@ -51,14 +51,14 @@ dependencies:
|
|
|
51
51
|
requirements:
|
|
52
52
|
- - '>='
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: 0.9.4
|
|
55
55
|
type: :runtime
|
|
56
56
|
prerelease: false
|
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - '>='
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 0.9.4
|
|
62
62
|
description:
|
|
63
63
|
email: michael@grosser.it
|
|
64
64
|
executables:
|
metadata.gz.sig
CHANGED
|
Binary file
|