cocoapods-blacklist 0.1.1 → 0.1.2
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 +1 -1
- data/Gemfile.lock +7 -1
- data/README.md +1 -0
- data/lib/cocoapods-blacklist/command/blacklist.rb +16 -13
- data/lib/cocoapods-blacklist/gem_version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a536f7b97996715a0804fa4a12e9d8b00053d3db
|
4
|
+
data.tar.gz: 436cc27ed236ec60e3e7c999eb9c6a37724b9970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 708bd2d18a49e3874e955b468fdba82c0431e7a362eca8502a4e05ec79e280448254f35d42f0760e01e2885db5e03a46d222b800fec4a242b73edfb06103da56
|
7
|
+
data.tar.gz: 70454add6b1f3be2f8f342bc183082d3f5c78a7ff0c9b2263396485eea9112a4957815aa14613f2704c19767f92c059adfce50cb523dc9805056033e0e3ee5b9
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cocoapods-blacklist (0.1.
|
4
|
+
cocoapods-blacklist (0.1.2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -52,6 +52,8 @@ GEM
|
|
52
52
|
nap (0.8.0)
|
53
53
|
netrc (0.7.8)
|
54
54
|
open4 (1.3.4)
|
55
|
+
prettybacon (0.0.2)
|
56
|
+
bacon (~> 1.2)
|
55
57
|
rake (10.4.2)
|
56
58
|
safe_yaml (1.0.4)
|
57
59
|
thread_safe (0.3.5)
|
@@ -72,5 +74,9 @@ DEPENDENCIES
|
|
72
74
|
bundler (~> 1.3)
|
73
75
|
cocoapods
|
74
76
|
cocoapods-blacklist!
|
77
|
+
prettybacon
|
75
78
|
rake
|
76
79
|
webmock
|
80
|
+
|
81
|
+
BUNDLED WITH
|
82
|
+
1.10.6
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ module Pod
|
|
13
13
|
self.description = <<-DESC
|
14
14
|
Validate a project against a list of banned pods. Requires a lockfile
|
15
15
|
and a config file (JSON).
|
16
|
-
|
16
|
+
|
17
17
|
example:
|
18
18
|
$ pod blacklist --config blacklist.json
|
19
19
|
DESC
|
@@ -21,7 +21,7 @@ module Pod
|
|
21
21
|
self.arguments = [
|
22
22
|
CLAide::Argument.new('LOCKFILE', false),
|
23
23
|
]
|
24
|
-
|
24
|
+
|
25
25
|
def self.options
|
26
26
|
[
|
27
27
|
['--config=CONFIG', 'Config file or URL for the blacklist'],
|
@@ -31,32 +31,32 @@ module Pod
|
|
31
31
|
|
32
32
|
def initialize(argv)
|
33
33
|
@blacklist = argv.option('config')
|
34
|
-
@warn = argv.flag?('warn')
|
35
|
-
@
|
34
|
+
@warn = argv.flag?('warn')
|
35
|
+
@lockfile_path = argv.shift_argument
|
36
36
|
super
|
37
37
|
end
|
38
38
|
|
39
39
|
def validate!
|
40
40
|
super
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
|
42
|
+
@lockfile = @lockfile_path ? Lockfile.from_file(Pathname(@lockfile_path)) : config.lockfile
|
43
|
+
help! 'A lockfile is needed.' unless lockfile
|
44
|
+
help! 'A blacklist file is needed.' unless @blacklist
|
44
45
|
end
|
45
46
|
|
46
47
|
def run
|
47
|
-
lockfile = Pod::Lockfile.from_file(Pathname.new(@lockfile_name))
|
48
48
|
open(@blacklist) do |f|
|
49
49
|
@blacklist_file = JSON.parse(f.read)
|
50
50
|
end
|
51
51
|
|
52
52
|
warned = false
|
53
53
|
failed_pods = {}
|
54
|
-
|
54
|
+
|
55
55
|
@blacklist_file['pods'].each do |pod|
|
56
56
|
name = pod['name']
|
57
57
|
if lockfile.pod_names.include? name
|
58
|
-
version =
|
59
|
-
if
|
58
|
+
version = Version.new(lockfile.version(name))
|
59
|
+
if Requirement.create(pod['versions']).satisfied_by?(version)
|
60
60
|
UI.puts "[!] Validation error: Use of #{name} #{version} for reason: #{pod['reason']}".yellow
|
61
61
|
failed_pods[name] = version
|
62
62
|
warned = true
|
@@ -64,7 +64,7 @@ module Pod
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
if !warned
|
67
|
-
UI.puts "#{
|
67
|
+
UI.puts "#{UI.path lockfile.defined_in_file.expand_path} passed blacklist validation".green
|
68
68
|
else
|
69
69
|
failed_pod_string = failed_pods.map { |name, version| "#{name} (#{version})"}.join(", ")
|
70
70
|
unless @warn
|
@@ -72,7 +72,10 @@ module Pod
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
attr_reader :lockfile
|
76
79
|
end
|
77
80
|
end
|
78
81
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-blacklist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Grandinetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,4 +97,3 @@ test_files:
|
|
97
97
|
- spec/fixtures/GoodPodfile.lock
|
98
98
|
- spec/fixtures/blacklist.json
|
99
99
|
- spec/spec_helper.rb
|
100
|
-
has_rdoc:
|