cocoapods-whitelist 0.0.4 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/cocoapods-whitelist/command/whitelist.rb +27 -7
- data/lib/cocoapods-whitelist/gem_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 750058d7d825d9b61916a46ea50350581cfe3518
|
4
|
+
data.tar.gz: 270b1db1faf90555f31e4c43c655b1d7494ce650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a7cdc92b231d590dcc66ccbd8e41f1c167da2147c7c041f009bc3da783c76f5ce6f892300c4d90b3b918ffeca0ed63d57214da7ccf1dfd6e7cc9489ee8f418
|
7
|
+
data.tar.gz: 2b4debab422c070ed134a2eddaa366b36004eeb2c1b2354007922070bb0864aede76215580ffd7da0923dc84ca07a94929879aa464a5a1a6b3c887cf887783d7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -21,12 +21,14 @@ module Pod
|
|
21
21
|
|
22
22
|
self.arguments = [ CLAide::Argument.new('config', false),
|
23
23
|
CLAide::Argument.new('podspec', false),
|
24
|
-
CLAide::Argument.new('fail-on-error', false)
|
24
|
+
CLAide::Argument.new('fail-on-error', false),
|
25
|
+
CLAide::Argument.new('outfile', false) ]
|
25
26
|
|
26
27
|
def self.options
|
27
28
|
[ ['--config=CONFIG', 'Config file or URL for the blacklist'],
|
28
29
|
['--podspec=PODSPEC', 'Podspec file to be lint'],
|
29
|
-
['--fail-on-error', 'Raise an exception in case of error']
|
30
|
+
['--fail-on-error', 'Raise an exception in case of error'],
|
31
|
+
['--outfile=PATH', 'Output the linter results to a file']
|
30
32
|
].concat(super)
|
31
33
|
end
|
32
34
|
|
@@ -34,6 +36,7 @@ module Pod
|
|
34
36
|
@whitelist_url = argv ? argv.option('config', DEFAULT_WHITELIST_URL) : DEFAULT_WHITELIST_URL
|
35
37
|
@pospec_path = argv ? argv.option('podspec') : nil
|
36
38
|
@fail_on_error = argv ? argv.flag?('fail-on-error') : false
|
39
|
+
@outfile = argv ? argv.option('outfile') : nil
|
37
40
|
@failure = false
|
38
41
|
super
|
39
42
|
end
|
@@ -43,6 +46,7 @@ module Pod
|
|
43
46
|
end
|
44
47
|
|
45
48
|
def run
|
49
|
+
prepare_outfile
|
46
50
|
whitelist = get_whitelist
|
47
51
|
specifications = get_podspec_specifications
|
48
52
|
|
@@ -61,17 +65,16 @@ module Pod
|
|
61
65
|
def show_result_message
|
62
66
|
return unless @failure
|
63
67
|
message = "Please check your dependencies.\nYou can see the allowed dependencies at #{@whitelist_url}"
|
68
|
+
show_error_message(message)
|
64
69
|
if @fail_on_error
|
65
|
-
raise Informative.new(
|
66
|
-
else
|
67
|
-
UI.puts message.yellow
|
70
|
+
raise Informative.new()
|
68
71
|
end
|
69
72
|
end
|
70
73
|
|
71
74
|
# Checks the dependencies the project contains are in the whitelist
|
72
75
|
def validate_dependencies(podspec, whitelist, parentName = nil)
|
73
76
|
pod_name = parentName ? "#{parentName}/#{podspec['name']}" : podspec['name']
|
74
|
-
UI.puts "Verifying dependencies in #{pod_name}"
|
77
|
+
UI.puts "Verifying dependencies in #{pod_name}".green
|
75
78
|
|
76
79
|
dependencies = podspec["dependencies"] ? podspec["dependencies"] : []
|
77
80
|
not_allowed = []
|
@@ -143,13 +146,30 @@ module Pod
|
|
143
146
|
return podspecs.map { |path| Pod::Specification.from_file(path) }
|
144
147
|
end
|
145
148
|
|
146
|
-
def show_error_message(message)
|
149
|
+
def show_error_message(message)
|
150
|
+
unless @outfile == nil
|
151
|
+
IO.write(@outfile, "#{message}\n", mode: 'a')
|
152
|
+
end
|
153
|
+
|
147
154
|
if @fail_on_error
|
148
155
|
UI.puts message.red
|
149
156
|
else
|
150
157
|
UI.puts message.yellow
|
151
158
|
end
|
152
159
|
end
|
160
|
+
|
161
|
+
def prepare_outfile
|
162
|
+
if @outfile == nil
|
163
|
+
return
|
164
|
+
end
|
165
|
+
|
166
|
+
if File.exist?(@outfile)
|
167
|
+
FileUtils.rm(@outfile)
|
168
|
+
elsif File.dirname(@outfile)
|
169
|
+
FileUtils.mkdir_p(File.dirname(@outfile))
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
153
173
|
end
|
154
174
|
end
|
155
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-whitelist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mobile Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|