cocoapods-whitelist 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cocoapods-whitelist/command/whitelist.rb +10 -3
- data/lib/cocoapods-whitelist/gem_version.rb +1 -1
- data/spec/whitelist_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5d9b4ac40951e4b43fb64d48a34e478e9a1fa1d
|
4
|
+
data.tar.gz: 6b702f225f4f9f615f3407699ff63ccadef98e5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 184354b70faf57d5c2ef5409650811daafd36d36f972f2b62047f616a2e3120e83675b08b2abc40c9463b8a97a8ec530ca2a4b7dc6ee36069b7903aa974b1425
|
7
|
+
data.tar.gz: 6c13acc44416b942e6e730cf8abe77b0ca3cd9ae2cd8b0577f61ee88246b57473fd0aae59e11b0ef7a3d89364035e2e622ce460d0d12d7db83b654ae3e6efe88
|
data/Gemfile.lock
CHANGED
@@ -15,9 +15,9 @@ end
|
|
15
15
|
module Pod
|
16
16
|
class Command
|
17
17
|
class Whitelist < Command
|
18
|
-
self.summary = '
|
18
|
+
self.summary = "Validate Podspec's dependencies against a whitelist of pods."
|
19
19
|
self.description = <<-DESC
|
20
|
-
|
20
|
+
Validate Podspec's dependencies against a whitelist of pods.
|
21
21
|
DESC
|
22
22
|
|
23
23
|
self.arguments = [ CLAide::Argument.new('config', false),
|
@@ -46,9 +46,16 @@ module Pod
|
|
46
46
|
def run
|
47
47
|
whitelist = get_whitelist
|
48
48
|
specifications = get_podspec_specifications
|
49
|
+
|
50
|
+
if specifications.empty?
|
51
|
+
UI.puts "No Podspec found".yellow
|
52
|
+
return
|
53
|
+
end
|
54
|
+
|
49
55
|
specifications.map do |specification|
|
50
56
|
validate_dependencies(JSON.parse(specification.to_json), whitelist)
|
51
57
|
end
|
58
|
+
|
52
59
|
show_error_message
|
53
60
|
end
|
54
61
|
|
@@ -64,7 +71,7 @@ module Pod
|
|
64
71
|
# Checks the dependencies the project contains are in the whitelist
|
65
72
|
def validate_dependencies(podspec, whitelist, parentName = nil)
|
66
73
|
pod_name = parentName ? "#{parentName}/#{podspec['name']}" : podspec['name']
|
67
|
-
puts "Verifying dependencies in #{pod_name}"
|
74
|
+
UI.puts "Verifying dependencies in #{pod_name}"
|
68
75
|
|
69
76
|
dependencies = podspec["dependencies"] ? podspec["dependencies"] : []
|
70
77
|
not_allowed = []
|
data/spec/whitelist_spec.rb
CHANGED
@@ -95,6 +95,11 @@ module Pod
|
|
95
95
|
lambda { command.run }.should.not.raise
|
96
96
|
end
|
97
97
|
|
98
|
+
it 'should not fail when no podspecs are found' do
|
99
|
+
command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}"])
|
100
|
+
lambda { command.run }.should.not.raise
|
101
|
+
end
|
102
|
+
|
98
103
|
end
|
99
104
|
end
|
100
105
|
end
|