cocoapods-whitelist 0.3.0 → 0.5.3
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
- data/.pre-commit-config.yaml +15 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +49 -42
- data/cocoapods-whitelist.gemspec +1 -1
- data/lib/cocoapods-whitelist/client/whitelist_resolver.rb +10 -2
- data/lib/cocoapods-whitelist/command/whitelist.rb +29 -13
- data/lib/cocoapods-whitelist/gem_version.rb +1 -1
- data/lib/cocoapods-whitelist/model/allowed_dependency.rb +3 -1
- data/spec/mocks/allowed_with_granular.podspec +13 -0
- data/spec/mocks/not_allowed_with_granular.podspec +13 -0
- data/spec/mocks/whitelist.json +8 -0
- data/spec/source_helper_spec.rb +4 -4
- data/spec/source_validator_spec.rb +5 -5
- data/spec/whitelist_resolver_spec.rb +1 -1
- data/spec/whitelist_spec.rb +15 -0
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df9811a2f73baf94fbffa4b66502c4b2d53235a661f29096662f5d3658584400
|
|
4
|
+
data.tar.gz: b8e55e5ea04eec1f3760ac15b0809d272ce723e18365bdc728abb01c01d1b206
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef87c35379e76239424379d9225cd8646e90ad91b3963ad6d3ae8b0fbc5e435f648bd03d5107709f61be6ccf18f700b381dc837a03e0abddfc920d50d17e1766
|
|
7
|
+
data.tar.gz: 218f8ab7fc4d67148255629f519302f8c90716664f0fabe2f62e20bdd628ed2a056bc388c82052545ef8a378760e352d9d9d6ccf2e006fb2ab6a245e63acf81c
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
# Websec hook is MANDATORY, DO NOT comment it.
|
|
3
|
+
- repo: https://github.com/melisource/fury_websec-git-hooks
|
|
4
|
+
rev: v1.1.0
|
|
5
|
+
hooks:
|
|
6
|
+
- id: pre_commit_hook
|
|
7
|
+
stages: [commit]
|
|
8
|
+
- id: post_commit_hook
|
|
9
|
+
stages: [post-commit]
|
|
10
|
+
- repo: https://github.com/melisource/fury_datasec-git-hooks
|
|
11
|
+
rev: 1.0.3
|
|
12
|
+
hooks:
|
|
13
|
+
- id: pre_commit_hook
|
|
14
|
+
stages: [commit]
|
|
15
|
+
verbose: true
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.1.4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.5.3
|
|
2
|
+
### Changed
|
|
3
|
+
- Get podspec specification functions changed to support KMP podspec path.
|
|
4
|
+
|
|
5
|
+
## 0.4.0
|
|
6
|
+
### Changed
|
|
7
|
+
- Add "allows_granular_projects" flag to whitelist for support the projects specified
|
|
8
|
+
|
|
1
9
|
## 0.2.1
|
|
2
10
|
### Changed
|
|
3
11
|
- Improve dependency injection message to inform the local source is being used.
|
data/Gemfile.lock
CHANGED
|
@@ -1,112 +1,119 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cocoapods-whitelist (0.
|
|
4
|
+
cocoapods-whitelist (0.5.1)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
CFPropertyList (3.0.
|
|
10
|
-
|
|
9
|
+
CFPropertyList (3.0.6)
|
|
10
|
+
rexml
|
|
11
|
+
activesupport (6.1.7.6)
|
|
11
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
12
|
-
i18n (>=
|
|
13
|
-
minitest (
|
|
14
|
-
tzinfo (~>
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
i18n (>= 1.6, < 2)
|
|
14
|
+
minitest (>= 5.1)
|
|
15
|
+
tzinfo (~> 2.0)
|
|
16
|
+
zeitwerk (~> 2.3)
|
|
17
|
+
addressable (2.8.5)
|
|
18
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
17
19
|
algoliasearch (1.27.5)
|
|
18
20
|
httpclient (~> 2.8, >= 2.8.3)
|
|
19
21
|
json (>= 1.5.1)
|
|
20
22
|
atomos (0.1.3)
|
|
21
23
|
bacon (1.2.0)
|
|
22
|
-
claide (1.0
|
|
23
|
-
cocoapods (1.
|
|
24
|
-
addressable (~> 2.
|
|
24
|
+
claide (1.1.0)
|
|
25
|
+
cocoapods (1.13.0)
|
|
26
|
+
addressable (~> 2.8)
|
|
25
27
|
claide (>= 1.0.2, < 2.0)
|
|
26
|
-
cocoapods-core (= 1.
|
|
28
|
+
cocoapods-core (= 1.13.0)
|
|
27
29
|
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
28
|
-
cocoapods-downloader (>= 1.
|
|
30
|
+
cocoapods-downloader (>= 1.6.0, < 2.0)
|
|
29
31
|
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
30
32
|
cocoapods-search (>= 1.0.0, < 2.0)
|
|
31
|
-
cocoapods-trunk (>= 1.
|
|
33
|
+
cocoapods-trunk (>= 1.6.0, < 2.0)
|
|
32
34
|
cocoapods-try (>= 1.1.0, < 2.0)
|
|
33
35
|
colored2 (~> 3.1)
|
|
34
36
|
escape (~> 0.0.4)
|
|
35
37
|
fourflusher (>= 2.3.0, < 3.0)
|
|
36
38
|
gh_inspector (~> 1.0)
|
|
37
|
-
molinillo (~> 0.
|
|
39
|
+
molinillo (~> 0.8.0)
|
|
38
40
|
nap (~> 1.0)
|
|
39
|
-
ruby-macho (
|
|
40
|
-
xcodeproj (>= 1.
|
|
41
|
-
cocoapods-core (1.
|
|
42
|
-
activesupport (
|
|
43
|
-
addressable (~> 2.
|
|
41
|
+
ruby-macho (>= 2.3.0, < 3.0)
|
|
42
|
+
xcodeproj (>= 1.23.0, < 2.0)
|
|
43
|
+
cocoapods-core (1.13.0)
|
|
44
|
+
activesupport (>= 5.0, < 8)
|
|
45
|
+
addressable (~> 2.8)
|
|
44
46
|
algoliasearch (~> 1.0)
|
|
45
47
|
concurrent-ruby (~> 1.1)
|
|
46
48
|
fuzzy_match (~> 2.0.4)
|
|
47
49
|
nap (~> 1.0)
|
|
48
50
|
netrc (~> 0.11)
|
|
49
|
-
public_suffix
|
|
51
|
+
public_suffix (~> 4.0)
|
|
50
52
|
typhoeus (~> 1.0)
|
|
51
|
-
cocoapods-deintegrate (1.0.
|
|
52
|
-
cocoapods-downloader (1.
|
|
53
|
+
cocoapods-deintegrate (1.0.5)
|
|
54
|
+
cocoapods-downloader (1.6.3)
|
|
53
55
|
cocoapods-plugins (1.0.0)
|
|
54
56
|
nap
|
|
55
|
-
cocoapods-search (1.0.
|
|
56
|
-
cocoapods-trunk (1.
|
|
57
|
+
cocoapods-search (1.0.1)
|
|
58
|
+
cocoapods-trunk (1.6.0)
|
|
57
59
|
nap (>= 0.8, < 2.0)
|
|
58
60
|
netrc (~> 0.11)
|
|
59
61
|
cocoapods-try (1.2.0)
|
|
60
62
|
colored2 (3.1.2)
|
|
61
|
-
concurrent-ruby (1.
|
|
63
|
+
concurrent-ruby (1.2.2)
|
|
62
64
|
escape (0.0.4)
|
|
63
|
-
ethon (0.
|
|
64
|
-
ffi (>= 1.
|
|
65
|
-
ffi (1.
|
|
65
|
+
ethon (0.16.0)
|
|
66
|
+
ffi (>= 1.15.0)
|
|
67
|
+
ffi (1.16.3)
|
|
66
68
|
fourflusher (2.3.1)
|
|
67
69
|
fuzzy_match (2.0.4)
|
|
68
70
|
gh_inspector (1.1.3)
|
|
69
71
|
httpclient (2.8.3)
|
|
70
|
-
i18n (1.
|
|
72
|
+
i18n (1.14.1)
|
|
71
73
|
concurrent-ruby (~> 1.0)
|
|
72
|
-
json (2.
|
|
73
|
-
minitest (5.
|
|
74
|
-
mocha (1.
|
|
74
|
+
json (2.6.3)
|
|
75
|
+
minitest (5.20.0)
|
|
76
|
+
mocha (2.1.0)
|
|
77
|
+
ruby2_keywords (>= 0.0.5)
|
|
75
78
|
mocha-on-bacon (0.2.3)
|
|
76
79
|
mocha (>= 0.13.0)
|
|
77
|
-
molinillo (0.
|
|
80
|
+
molinillo (0.8.0)
|
|
78
81
|
nanaimo (0.3.0)
|
|
79
82
|
nap (1.1.0)
|
|
80
83
|
netrc (0.11.0)
|
|
81
84
|
prettybacon (0.0.2)
|
|
82
85
|
bacon (~> 1.2)
|
|
83
|
-
public_suffix (4.0.
|
|
86
|
+
public_suffix (4.0.7)
|
|
84
87
|
rake (12.3.3)
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
rexml (3.2.6)
|
|
89
|
+
ruby-macho (2.5.1)
|
|
90
|
+
ruby2_keywords (0.0.5)
|
|
87
91
|
typhoeus (1.4.0)
|
|
88
92
|
ethon (>= 0.9.0)
|
|
89
|
-
tzinfo (
|
|
90
|
-
|
|
91
|
-
xcodeproj (1.
|
|
93
|
+
tzinfo (2.0.6)
|
|
94
|
+
concurrent-ruby (~> 1.0)
|
|
95
|
+
xcodeproj (1.23.0)
|
|
92
96
|
CFPropertyList (>= 2.3.3, < 4.0)
|
|
93
97
|
atomos (~> 0.1.3)
|
|
94
98
|
claide (>= 1.0.2, < 2.0)
|
|
95
99
|
colored2 (~> 3.1)
|
|
96
100
|
nanaimo (~> 0.3.0)
|
|
101
|
+
rexml (~> 3.2.4)
|
|
102
|
+
zeitwerk (2.6.12)
|
|
97
103
|
|
|
98
104
|
PLATFORMS
|
|
99
|
-
|
|
105
|
+
universal-darwin-22
|
|
100
106
|
|
|
101
107
|
DEPENDENCIES
|
|
102
108
|
bacon
|
|
103
109
|
bundler (~> 2.0)
|
|
104
110
|
cocoapods
|
|
105
111
|
cocoapods-whitelist!
|
|
112
|
+
json
|
|
106
113
|
mocha
|
|
107
114
|
mocha-on-bacon
|
|
108
115
|
prettybacon
|
|
109
116
|
rake (~> 12.0)
|
|
110
117
|
|
|
111
118
|
BUNDLED WITH
|
|
112
|
-
2.
|
|
119
|
+
2.4.22
|
data/cocoapods-whitelist.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ['mobile@mercadolibre.com']
|
|
11
11
|
spec.description = %q{A short description of cocoapods-whitelist.}
|
|
12
12
|
spec.summary = %q{A longer description of cocoapods-whitelist.}
|
|
13
|
-
spec.homepage = 'https://github.com/
|
|
13
|
+
spec.homepage = 'https://github.com/melisource/mobile-cocoapods_whitelist'
|
|
14
14
|
spec.license = 'MIT'
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'singleton'
|
|
2
|
+
require 'open-uri'
|
|
2
3
|
require 'cocoapods-whitelist/model/allowed_dependency'
|
|
3
4
|
|
|
4
5
|
class WhitelistResolver
|
|
@@ -26,7 +27,7 @@ class WhitelistResolver
|
|
|
26
27
|
|
|
27
28
|
def load_whitelist
|
|
28
29
|
begin
|
|
29
|
-
open(@whitelist_url) { |io|
|
|
30
|
+
URI.open(@whitelist_url) { |io|
|
|
30
31
|
buffer = io.read
|
|
31
32
|
@whitelist = parse_whitelist(buffer)
|
|
32
33
|
@whitelist_loaded = true
|
|
@@ -40,7 +41,14 @@ class WhitelistResolver
|
|
|
40
41
|
def parse_whitelist(raw_whitelist)
|
|
41
42
|
json = JSON.parse(raw_whitelist)
|
|
42
43
|
return json["whitelist"].map { |dependencyJson|
|
|
43
|
-
AllowedDependency.new(
|
|
44
|
+
AllowedDependency.new(
|
|
45
|
+
dependencyJson["name"],
|
|
46
|
+
dependencyJson["version"],
|
|
47
|
+
dependencyJson["expire"],
|
|
48
|
+
dependencyJson["source"],
|
|
49
|
+
dependencyJson["target"],
|
|
50
|
+
dependencyJson["allows_granular_projects"]
|
|
51
|
+
)
|
|
44
52
|
}
|
|
45
53
|
end
|
|
46
54
|
end
|
|
@@ -47,7 +47,7 @@ module Pod
|
|
|
47
47
|
load_excluded()
|
|
48
48
|
specifications = get_podspec_specifications
|
|
49
49
|
|
|
50
|
-
if specifications.empty?
|
|
50
|
+
if specifications == nil || specifications.empty?
|
|
51
51
|
UI.puts "No Podspec found".yellow
|
|
52
52
|
return
|
|
53
53
|
end
|
|
@@ -93,13 +93,27 @@ module Pod
|
|
|
93
93
|
name.start_with?(item.name.match(POD_NAME_REGEX).captures[POD_BASE_REGEX_POSITION]) && (!item.version || versions.grep(/#{item.version}/).any?) && (item.target == 'production')
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
# Checks if any of the allowed dependencies are expired, if so, fail with error
|
|
97
96
|
allowedDependency.each { |dependency|
|
|
97
|
+
|
|
98
|
+
# Checks the granularity
|
|
99
|
+
if dependency.allows_granular_projects != nil
|
|
100
|
+
granular_projects = dependency.allows_granular_projects.select { |granular_project|
|
|
101
|
+
granular_project == pod_name
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if granular_projects.empty?
|
|
105
|
+
not_allowed.push("#{name} Reason: Granular dependency not allowed for this project.")
|
|
106
|
+
next
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Checks if any of the allowed dependencies are expired, if so, fail with error
|
|
98
111
|
if dependency.expire?
|
|
99
112
|
not_allowed.push("#{name} Reason: Expired version. Please check the whitelist.")
|
|
100
113
|
end
|
|
101
|
-
}
|
|
102
114
|
|
|
115
|
+
}
|
|
116
|
+
|
|
103
117
|
if allowedDependency.empty?
|
|
104
118
|
not_allowed.push("#{name} (#{versions.join(", ")}) Reason: Specified version hasn't match any whitelisted version or Pod name is not valid")
|
|
105
119
|
next
|
|
@@ -127,17 +141,17 @@ module Pod
|
|
|
127
141
|
if @pospec_path
|
|
128
142
|
return [Pod::Specification.from_file(@pospec_path)]
|
|
129
143
|
end
|
|
130
|
-
|
|
131
|
-
# Search .podspec in
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
# 1 Arg = Search .podspec in current directory
|
|
145
|
+
# 2 Arg = Search .podspec in parent and sub directories. Some projects have Podfile into a subdirectory ("Example"), and run "pod install" from there.
|
|
146
|
+
# 3 Arg = Search .podspec in all directories
|
|
147
|
+
# 4 Arg = Search .podspec in parent and sub directories. Search is executed from children folder.
|
|
148
|
+
podspec_search_paths = ["./*.podspec", "../*.podspec", "./**/*.podspec", "../**/*.podspec"]
|
|
149
|
+
podspec_search_paths.each do |regex|
|
|
150
|
+
pod_specs = Dir.glob(regex)
|
|
151
|
+
if pod_specs.count != 0
|
|
152
|
+
return pod_specs.map { |path| Pod::Specification.from_file(path) }
|
|
153
|
+
end
|
|
138
154
|
end
|
|
139
|
-
|
|
140
|
-
return podspecs.map { |path| Pod::Specification.from_file(path) }
|
|
141
155
|
end
|
|
142
156
|
|
|
143
157
|
def show_error_message(message)
|
|
@@ -163,6 +177,7 @@ module Pod
|
|
|
163
177
|
FileUtils.mkdir_p(File.dirname(@outfile))
|
|
164
178
|
end
|
|
165
179
|
end
|
|
180
|
+
|
|
166
181
|
## Load a list of pods excluded from the validations, wrapped in ValidationExcluded.
|
|
167
182
|
def load_excluded
|
|
168
183
|
path = File.expand_path("../../exclude/excluded.json", __FILE__)
|
|
@@ -171,6 +186,7 @@ module Pod
|
|
|
171
186
|
@excluded_list = parse_excluded(file)
|
|
172
187
|
@excluded_list_loaded = true
|
|
173
188
|
end
|
|
189
|
+
|
|
174
190
|
## Aux function to populate the ValidationExcluded models from the JSON data.
|
|
175
191
|
def parse_excluded(list)
|
|
176
192
|
json = JSON.parse(list)
|
|
@@ -4,13 +4,15 @@ class AllowedDependency
|
|
|
4
4
|
attr_accessor :expire
|
|
5
5
|
attr_accessor :source
|
|
6
6
|
attr_accessor :target
|
|
7
|
+
attr_accessor :allows_granular_projects
|
|
7
8
|
|
|
8
|
-
def initialize(name, version, expire, source, target)
|
|
9
|
+
def initialize(name, version, expire, source, target, allows_granular_projects)
|
|
9
10
|
@name = name
|
|
10
11
|
@version = version
|
|
11
12
|
@expire = expire
|
|
12
13
|
@source = source
|
|
13
14
|
@target = target
|
|
15
|
+
@allows_granular_projects = allows_granular_projects
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
def expire?
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = "MLSearch"
|
|
3
|
+
s.version = "3.17.0"
|
|
4
|
+
s.summary = "Componente de search"
|
|
5
|
+
s.homepage = "http://www.mercadolibre.com.ar"
|
|
6
|
+
s.license = "none"
|
|
7
|
+
s.author = { "Mobile team" => "mobile@mercadolibre.com" }
|
|
8
|
+
s.platform = :ios, "7.0"
|
|
9
|
+
s.source = { :git => "git@github.com:mercadolibre/search-ios.git", :tag => s.version.to_s }
|
|
10
|
+
s.requires_arc = true
|
|
11
|
+
s.dependency 'Analytics', '~>5.1'
|
|
12
|
+
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = "MeliSDK"
|
|
3
|
+
s.version = "3.17.0"
|
|
4
|
+
s.summary = "Componente de search"
|
|
5
|
+
s.homepage = "http://www.mercadolibre.com.ar"
|
|
6
|
+
s.license = "none"
|
|
7
|
+
s.author = { "Mobile team" => "mobile@mercadolibre.com" }
|
|
8
|
+
s.platform = :ios, "7.0"
|
|
9
|
+
s.source = { :git => "git@github.com:mercadolibre/search-ios.git", :tag => s.version.to_s }
|
|
10
|
+
s.requires_arc = true
|
|
11
|
+
s.dependency 'Analytics', '~>5.1'
|
|
12
|
+
|
|
13
|
+
end
|
data/spec/mocks/whitelist.json
CHANGED
data/spec/source_helper_spec.rb
CHANGED
|
@@ -6,11 +6,11 @@ describe SourceHelper do
|
|
|
6
6
|
|
|
7
7
|
SourceHelper.instance.specs = [] # Avoid a non-empty SourceHelper
|
|
8
8
|
|
|
9
|
-
private_sources = [ "git@github.com:
|
|
9
|
+
private_sources = [ "git@github.com:melisource/mobile-ios_specs.git", "git@github.com:testable/testable_specs.git" ]
|
|
10
10
|
|
|
11
11
|
private_meli_specs = ["MyMELIPod1", "MyMELIPod2", "MyMELIPod3"]
|
|
12
12
|
meli_mock = mock()
|
|
13
|
-
meli_mock.stubs(:url).returns("git@github.com:
|
|
13
|
+
meli_mock.stubs(:url).returns("git@github.com:melisource/mobile-ios_specs.git")
|
|
14
14
|
meli_mock.stubs(:pods).returns(private_meli_specs)
|
|
15
15
|
|
|
16
16
|
private_cocoapods_cdn_specs = ["MyPublicPod1", "MyPublicPod2", "MyPublicPod2"]
|
|
@@ -38,11 +38,11 @@ describe SourceHelper do
|
|
|
38
38
|
|
|
39
39
|
SourceHelper.instance.specs = [] # Avoid a non-empty SourceHelper
|
|
40
40
|
|
|
41
|
-
private_sources = [ "git@github.com:
|
|
41
|
+
private_sources = [ "git@github.com:melisource/mobile-ios_specs.git", "git@github.com:testable/testable_specs.git" ]
|
|
42
42
|
|
|
43
43
|
private_meli_specs = []
|
|
44
44
|
meli_mock = mock()
|
|
45
|
-
meli_mock.stubs(:url).returns("git@github.com:
|
|
45
|
+
meli_mock.stubs(:url).returns("git@github.com:melisource/mobile-ios_specs.git")
|
|
46
46
|
meli_mock.stubs(:pods).returns(private_meli_specs)
|
|
47
47
|
|
|
48
48
|
private_cocoapods_cdn_specs = []
|
|
@@ -4,7 +4,7 @@ describe SourceValidator do
|
|
|
4
4
|
describe 'functionality' do
|
|
5
5
|
it 'external dependency that comes from a public source should be valid' do
|
|
6
6
|
|
|
7
|
-
private_sources = [ "git@github.com:
|
|
7
|
+
private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
|
|
8
8
|
private_specs = ["MyPod1", "MyPod1", "MyPod3"]
|
|
9
9
|
|
|
10
10
|
stub_url = stub(:url => 'https://cdn.cocoapods.org/')
|
|
@@ -20,7 +20,7 @@ describe SourceValidator do
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it 'internal dependency that comes from a public source should not be valid' do
|
|
23
|
-
private_sources = [ "git@github.com:
|
|
23
|
+
private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
|
|
24
24
|
private_specs = ["MyPod1", "MyPod1", "MyPod3", "MyInternalPod"]
|
|
25
25
|
|
|
26
26
|
stub_url = stub(:url => 'https://cdn.cocoapods.org/')
|
|
@@ -37,10 +37,10 @@ describe SourceValidator do
|
|
|
37
37
|
|
|
38
38
|
it 'internal dependency that comes from private source should be valid' do
|
|
39
39
|
|
|
40
|
-
private_sources = [ "git@github.com:
|
|
40
|
+
private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
|
|
41
41
|
private_specs = ["MyPod1", "MyPod1", "MyPod3", "MyInternalPod"]
|
|
42
42
|
|
|
43
|
-
stub_url = stub(:url => 'git@github.com:
|
|
43
|
+
stub_url = stub(:url => 'git@github.com:melisource/mobile-ios_specs.git')
|
|
44
44
|
spec_mock = mock()
|
|
45
45
|
spec_mock.stubs(:spec_source).returns(stub_url)
|
|
46
46
|
spec_mock.stubs(:defined_in_file).returns(nil?)
|
|
@@ -54,7 +54,7 @@ describe SourceValidator do
|
|
|
54
54
|
|
|
55
55
|
it 'development pods should be valid' do
|
|
56
56
|
|
|
57
|
-
private_sources = [ "git@github.com:
|
|
57
|
+
private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
|
|
58
58
|
private_specs = ["MyPod1", "MyPod1", "MyPod3", "MyInternalPod"]
|
|
59
59
|
|
|
60
60
|
stub_url = stub(:url => '')
|
|
@@ -6,7 +6,7 @@ describe WhitelistResolver do
|
|
|
6
6
|
describe 'functionality' do
|
|
7
7
|
it 'whitelist should be loaded from an specific url' do
|
|
8
8
|
whitelist = WhitelistResolver.instance.get_whitelist(WHITELIST_PATH)
|
|
9
|
-
whitelist.size.should.equal
|
|
9
|
+
whitelist.size.should.equal 7
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it 'if not URL is specified, whitelist comes from default URL' do
|
data/spec/whitelist_spec.rb
CHANGED
|
@@ -171,6 +171,21 @@ module Pod
|
|
|
171
171
|
command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}"])
|
|
172
172
|
lambda { command.run }.should.not.raise
|
|
173
173
|
end
|
|
174
|
+
|
|
175
|
+
it 'allowed granular dependency should be valid' do
|
|
176
|
+
command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
|
|
177
|
+
specification = Pod::Specification.from_file('./spec/mocks/allowed_with_granular.podspec')
|
|
178
|
+
command.expects(:get_podspec_specifications).returns([specification])
|
|
179
|
+
lambda { command.run }.should.not.raise Informative
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
it 'not allowed granular dependency should not be valid' do
|
|
183
|
+
command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
|
|
184
|
+
specification = Pod::Specification.from_file('./spec/mocks/not_allowed_with_granular.podspec')
|
|
185
|
+
command.expects(:get_podspec_specifications).returns([specification])
|
|
186
|
+
lambda { command.run }.should.raise Informative
|
|
187
|
+
end
|
|
188
|
+
|
|
174
189
|
end
|
|
175
190
|
end
|
|
176
191
|
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.3
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mobile Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -47,6 +47,8 @@ extra_rdoc_files: []
|
|
|
47
47
|
files:
|
|
48
48
|
- ".circleci/config.yml"
|
|
49
49
|
- ".gitignore"
|
|
50
|
+
- ".pre-commit-config.yaml"
|
|
51
|
+
- ".ruby-version"
|
|
50
52
|
- CHANGELOG.md
|
|
51
53
|
- Gemfile
|
|
52
54
|
- Gemfile.lock
|
|
@@ -68,10 +70,12 @@ files:
|
|
|
68
70
|
- lib/cocoapods-whitelist/model/validation_excluded.rb
|
|
69
71
|
- lib/cocoapods-whitelist/validator/source_validator.rb
|
|
70
72
|
- lib/cocoapods_plugin.rb
|
|
73
|
+
- spec/mocks/allowed_with_granular.podspec
|
|
71
74
|
- spec/mocks/bad_name.podspec
|
|
72
75
|
- spec/mocks/free_version.podspec
|
|
73
76
|
- spec/mocks/major_version_fixed.podspec
|
|
74
77
|
- spec/mocks/not_allowed.podspec
|
|
78
|
+
- spec/mocks/not_allowed_with_granular.podspec
|
|
75
79
|
- spec/mocks/whitelist.json
|
|
76
80
|
- spec/mocks/whitelist_with_expired_dependencies.json
|
|
77
81
|
- spec/mocks/whitelisted_podname.podspec
|
|
@@ -95,7 +99,7 @@ files:
|
|
|
95
99
|
- spec/spec_helper.rb
|
|
96
100
|
- spec/whitelist_resolver_spec.rb
|
|
97
101
|
- spec/whitelist_spec.rb
|
|
98
|
-
homepage: https://github.com/
|
|
102
|
+
homepage: https://github.com/melisource/mobile-cocoapods_whitelist
|
|
99
103
|
licenses:
|
|
100
104
|
- MIT
|
|
101
105
|
metadata: {}
|
|
@@ -114,15 +118,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
114
118
|
- !ruby/object:Gem::Version
|
|
115
119
|
version: '0'
|
|
116
120
|
requirements: []
|
|
117
|
-
rubygems_version: 3.
|
|
121
|
+
rubygems_version: 3.0.9
|
|
118
122
|
signing_key:
|
|
119
123
|
specification_version: 4
|
|
120
124
|
summary: A longer description of cocoapods-whitelist.
|
|
121
125
|
test_files:
|
|
126
|
+
- spec/mocks/allowed_with_granular.podspec
|
|
122
127
|
- spec/mocks/bad_name.podspec
|
|
123
128
|
- spec/mocks/free_version.podspec
|
|
124
129
|
- spec/mocks/major_version_fixed.podspec
|
|
125
130
|
- spec/mocks/not_allowed.podspec
|
|
131
|
+
- spec/mocks/not_allowed_with_granular.podspec
|
|
126
132
|
- spec/mocks/whitelist.json
|
|
127
133
|
- spec/mocks/whitelist_with_expired_dependencies.json
|
|
128
134
|
- spec/mocks/whitelisted_podname.podspec
|