cocoapods-whitelist 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b5e6eca5022d389d3b4365d67027985c72e8a5e5
4
- data.tar.gz: 6c81391a25a039e470609b4f9c5dbbaf82fa325d
2
+ SHA256:
3
+ metadata.gz: ac35a09134957238dfebe24132c80aa456c46bd4fe0b30e4a8615b210321b614
4
+ data.tar.gz: ee7d647d915058f1da78c3d86ae95781a0423e98a87b4f43e005c9d37d418c7d
5
5
  SHA512:
6
- metadata.gz: 22e7d9d0427233fb8f3685422f6ba6839beed969c9de482bb98de6c77ba28cb29ef2f6338fedc8a185642bb6e3e01ce55aefee7c5570bdf4c5c21c4ef88c29e1
7
- data.tar.gz: 00c0638eca55e951f4c31820003dd9d2adf75c300a866410e318229c18eef047952289bfeb6b51f6487e793fff0d498d44e43dab39a2324bd2dec72f69a28e5e
6
+ metadata.gz: 6773f81644aa4b7dfa24c61bac7b4e86a6902a6d6a41d3aa3e05940418bd4cf860437836c577047237f2e4fdb69bd4c82b89f02da84376b6255402605a980888
7
+ data.tar.gz: 3bffec4b9f7e462532a99fd5dfc1908a6376f21c8dbf2fcb2959c719432034878b29a68230b169bcc3f4d7785151172aca5b0536d68b33cbc414d8b522917b5b
@@ -0,0 +1,30 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ docker:
5
+ - image: circleci/ruby:2.4.4-node
6
+ environment:
7
+ BUNDLER_VERSION: 2.0.2
8
+ resource_class: small
9
+ steps:
10
+ - checkout
11
+ - add_ssh_keys
12
+ - run:
13
+ name: Update Bundler
14
+ command: |
15
+ sudo gem update --system
16
+ sudo gem uninstall bundler
17
+ sudo rm /usr/local/bin/bundle
18
+ sudo rm /usr/local/bin/bundler
19
+ sudo gem install bundler
20
+ - run:
21
+ name: Run Build
22
+ command: |
23
+ bundle install --quiet --without static-dependencies
24
+ gem build cocoapods-whitelist.gemspec --silent -q --backtrace
25
+ gem install *.gem --silent -q --backtrace
26
+ rm -rf *.gem
27
+ rm -rf Gemfile.lock
28
+ - run:
29
+ name: Run Tests
30
+ command: rake
@@ -1,3 +1,10 @@
1
+ ## 0.0.11
2
+ - Enhancing dependencies linter by checking not only name but also version
3
+ - Enabling CI
4
+
5
+ ## 0.0.10
6
+ - Revert 0.0.8 validation rule
7
+
1
8
  ## 0.0.9
2
9
  - Revert 0.0.8 validation rule
3
10
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-whitelist (0.0.9)
4
+ cocoapods-whitelist (0.0.11)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -94,4 +94,4 @@ DEPENDENCIES
94
94
  rake (~> 12.0)
95
95
 
96
96
  BUNDLED WITH
97
- 2.0.1
97
+ 2.0.2
@@ -1,6 +1,8 @@
1
1
  require 'open-uri'
2
2
 
3
3
  DEFAULT_WHITELIST_URL = "https://raw.githubusercontent.com/mercadolibre/mobile-dependencies_whitelist/master/ios-whitelist.json"
4
+ POD_NAME_REGEX = /^([^\/]+)(?:\/.*)*$/
5
+ POD_BASE_REGEX_POSITION = 0
4
6
 
5
7
  class AllowedDependency
6
8
  attr_accessor :name
@@ -93,19 +95,25 @@ module Pod
93
95
  # Skip subspec dependency
94
96
  next if parentName && name.start_with?("#{parentName}/")
95
97
 
98
+ if versions.length != 1
99
+ not_allowed.push("#{name} (#{versions.join(", ")}) Reason: A specific version must be defined for every dependency (just one). " +
100
+ "Suggestion: find this dependency in your Podspec and add the version listed in the whitelist.")
101
+ next
102
+ end
103
+
96
104
  allowedDependency = whitelist.select { |item|
97
- /#{item.name}/ =~ name && (versions.empty? || !item.version || versions.grep(/#{item.version}/).any?)
105
+ name.start_with?(item.name.match(POD_NAME_REGEX).captures[POD_BASE_REGEX_POSITION]) && (!item.version || versions.grep(/#{item.version}/).any?)
98
106
  }
99
107
 
100
108
  # Checks if any of the allowed dependencies are expired, if so, fail with error
101
109
  allowedDependency.each { |dependency|
102
110
  if dependency.expire?
103
- not_allowed.push("#{name} (Expired)")
111
+ not_allowed.push("#{name} Reason: Expired version. Please check the whitelist.")
104
112
  end
105
113
  }
106
114
 
107
115
  if allowedDependency.empty?
108
- not_allowed.push("#{name} (#{versions.join(", ")})")
116
+ not_allowed.push("#{name} (#{versions.join(", ")}) Reason: Specified version hasn't match any whitelisted version or Pod name is not valid")
109
117
  next
110
118
  end
111
119
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsWhitelist
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -3,17 +3,24 @@
3
3
  {
4
4
  "name": "MeliSDK",
5
5
  "version": "^~>5.[0-9]+$"
6
- }, {
6
+ },
7
+ {
7
8
  "name": "MLRecommendations",
8
9
  "version": null
9
- }, {
10
- "name": "MLBilling",
11
- "version": null,
12
- "expire" : "2100-11-15"
13
- }, {
14
- "name": "MLOnDemandResources",
15
- "version": "^~>5.[0-9]+$",
16
- "expire" : "2016-11-15"
10
+ },
11
+ {
12
+ "expire": "2100-11-15",
13
+ "name": "MLBilling",
14
+ "version": null
15
+ },
16
+ {
17
+ "expire": "2016-11-15",
18
+ "name": "MLOnDemandResources",
19
+ "version": "^~>5.[0-9]+$"
20
+ },
21
+ {
22
+ "name": "MLMyDependency",
23
+ "version": "1.0.0|2.0.0"
17
24
  }
18
25
  ]
19
26
  }
@@ -0,0 +1,18 @@
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
+
12
+ s.subspec "Suggestion" do |suggestion|
13
+ suggestion.resource = "LibraryComponents/Suggestions/assets/*.*", "LibraryComponents/Suggestions/classes/*.xib"
14
+ suggestion.source_files = "LibraryComponents/Suggestions/classes/*.{h,m,c}"
15
+ suggestion.dependency "MeliSDK/Error", "~>5.0"
16
+ end
17
+
18
+ end
@@ -0,0 +1,19 @@
1
+
2
+ Pod::Spec.new do |s|
3
+ s.name = "MLSearch"
4
+ s.version = "3.17.0"
5
+ s.summary = "Componente de search"
6
+ s.homepage = "http://www.mercadolibre.com.ar"
7
+ s.license = "none"
8
+ s.author = { "Mobile team" => "mobile@mercadolibre.com" }
9
+ s.platform = :ios, "7.0"
10
+ s.source = { :git => "git@github.com:mercadolibre/search-ios.git", :tag => s.version.to_s }
11
+ s.requires_arc = true
12
+
13
+ s.subspec "Suggestion" do |suggestion|
14
+ suggestion.resource = "LibraryComponents/Suggestions/assets/*.*", "LibraryComponents/Suggestions/classes/*.xib"
15
+ suggestion.source_files = "LibraryComponents/Suggestions/classes/*.{h,m,c}"
16
+ suggestion.dependency "MeliSDK", ">5.0", "<6.0"
17
+ end
18
+
19
+ end
@@ -0,0 +1,18 @@
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
+
12
+ s.subspec "Suggestion" do |suggestion|
13
+ suggestion.resource = "LibraryComponents/Suggestions/assets/*.*", "LibraryComponents/Suggestions/classes/*.xib"
14
+ suggestion.source_files = "LibraryComponents/Suggestions/classes/*.{h,m,c}"
15
+ suggestion.dependency "MyMeliSDK/Error", "~>5.0"
16
+ end
17
+
18
+ end
@@ -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 'MercadoPagoSDK', '~>1.0.0'
12
+
13
+ end
@@ -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 'MLMyDependency', '1.0.0'
12
+
13
+ end
@@ -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 'MLMyDependency', '2.0.0'
12
+
13
+ end
@@ -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 'MLMyDependency', '~> 1.0'
12
+
13
+ end
@@ -12,17 +12,17 @@ module Pod
12
12
  it 'parse whitelist json' do
13
13
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}"])
14
14
  dependencies = command.get_whitelist
15
- dependencies.size.should.equal 4
15
+ dependencies.size.should.equal 5
16
16
  end
17
17
  end
18
18
 
19
19
  describe 'validations' do
20
- it 'dependency without version should be valid' do
20
+ it 'dependency without version should not be valid' do
21
21
  # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('MeliSDK')
22
22
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
23
23
  specification = Pod::Specification.from_file('./spec/mocks/without_version.podspec')
24
24
  command.expects(:get_podspec_specifications).returns([specification])
25
- lambda { command.run }.should.not.raise
25
+ lambda { command.run }.should.raise Informative
26
26
  end
27
27
 
28
28
  it 'dependency with major version fixed should be valid' do
@@ -48,6 +48,14 @@ module Pod
48
48
  lambda { command.run }.should.raise Informative
49
49
  end
50
50
 
51
+ it 'not allowed similar dependency should not be valid' do
52
+ # Whitelist: ('MercadoPagoSDKV4', '~>5.*') | Podspec: ('MercadoPagoSDK')
53
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
54
+ specification = Pod::Specification.from_file('./spec/mocks/with_similar_name_not_allowed.podspec')
55
+ command.expects(:get_podspec_specifications).returns([specification])
56
+ lambda { command.run }.should.raise Informative
57
+ end
58
+
51
59
  it 'dependency with not allowed version should be valid' do
52
60
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
53
61
  specification = Pod::Specification.from_file('./spec/mocks/with_fixed_version.podspec')
@@ -79,6 +87,14 @@ module Pod
79
87
  lambda { command.run }.should.raise Informative
80
88
  end
81
89
 
90
+ it 'dependency with two versions requierement should not be valid' do
91
+ # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
92
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
93
+ specification = Pod::Specification.from_file('./spec/mocks/with_more_than_one_version_in_subspec.podspec')
94
+ command.expects(:get_podspec_specifications).returns([specification])
95
+ lambda { command.run }.should.raise Informative
96
+ end
97
+
82
98
  it 'dependency not allowed in subspec should not be valid' do
83
99
  # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
84
100
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
@@ -87,6 +103,22 @@ module Pod
87
103
  lambda { command.run }.should.raise Informative
88
104
  end
89
105
 
106
+ it 'subspec dependency allowed in the whitelist should be valid' do
107
+ # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('MeliSDK/Error')
108
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
109
+ specification = Pod::Specification.from_file('./spec/mocks/with_allowed_subspec.podspec')
110
+ command.expects(:get_podspec_specifications).returns([specification])
111
+ lambda { command.run }.should.not.raise
112
+ end
113
+
114
+ it 'subspec dependency not allowed in the whitelist should not be valid' do
115
+ # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('MyMeliSDK/Error')
116
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
117
+ specification = Pod::Specification.from_file('./spec/mocks/with_not_allowed_subspec.podspec')
118
+ command.expects(:get_podspec_specifications).returns([specification])
119
+ lambda { command.run }.should.raise Informative
120
+ end
121
+
90
122
  it 'podspec without dependencies should be valid' do
91
123
  # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
92
124
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
@@ -111,6 +143,30 @@ module Pod
111
143
  lambda { command.run }.should.not.raise
112
144
  end
113
145
 
146
+ it 'fixed mayor dependency in whitelist and podspec should not fail on first option' do
147
+ # Whitelist: ('MLMyDependency', '1.0.0|2.0.0') | Podspec: ('MLMyDependency', '1.0.0')
148
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
149
+ specification = Pod::Specification.from_file('./spec/mocks/with_whitelisted_dependency_fixed_versions_v1.podspec')
150
+ command.expects(:get_podspec_specifications).returns([specification])
151
+ lambda { command.run }.should.not.raise
152
+ end
153
+
154
+ it 'fixed mayor dependency in whitelist and podspec should not fail on second option' do
155
+ # Whitelist: ('MLMyDependency', '1.0.0|2.0.0') | Podspec: ('MLMyDependency', '2.0.0')
156
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
157
+ specification = Pod::Specification.from_file('./spec/mocks/with_whitelisted_dependency_fixed_versions_v2.podspec')
158
+ command.expects(:get_podspec_specifications).returns([specification])
159
+ lambda { command.run }.should.not.raise
160
+ end
161
+
162
+ it 'fixed mayor dependency in whitelist but not in podspec should fail' do
163
+ # Whitelist: ('MLMyDependency', '1.0.0|2.0.0') | Podspec: ('MLMyDependency', '~> 1.0')
164
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
165
+ specification = Pod::Specification.from_file('./spec/mocks/with_whitelisted_dependency_fixed_versions_variable.podspec')
166
+ command.expects(:get_podspec_specifications).returns([specification])
167
+ lambda { command.run }.should.raise Informative
168
+ end
169
+
114
170
  it 'not allowed dependency should not raise exception if --fail-on-error is not present' do
115
171
  # Whitelist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
116
172
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--podspec=./spec/mocks/not_allowed.podspec"])
@@ -121,7 +177,6 @@ module Pod
121
177
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}"])
122
178
  lambda { command.run }.should.not.raise
123
179
  end
124
-
125
180
  end
126
181
  end
127
182
  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.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mobile Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-10 00:00:00.000000000 Z
11
+ date: 2019-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -45,6 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".circleci/config.yml"
48
49
  - ".gitignore"
49
50
  - CHANGELOG.md
50
51
  - Gemfile
@@ -65,11 +66,18 @@ files:
65
66
  - spec/mocks/whitelist.json
66
67
  - spec/mocks/whitelist_with_expired_dependencies.json
67
68
  - spec/mocks/with_allowed_in_subspec.podspec
69
+ - spec/mocks/with_allowed_subspec.podspec
68
70
  - spec/mocks/with_expired_dependencies.podspec
69
71
  - spec/mocks/with_fixed_version.podspec
72
+ - spec/mocks/with_more_than_one_version_in_subspec.podspec
70
73
  - spec/mocks/with_not_allowed_in_subspec.podspec
74
+ - spec/mocks/with_not_allowed_subspec.podspec
71
75
  - spec/mocks/with_not_yet_expired_dependencies.podspec
76
+ - spec/mocks/with_similar_name_not_allowed.podspec
72
77
  - spec/mocks/with_two_requirement.podspec
78
+ - spec/mocks/with_whitelisted_dependency_fixed_versions_v1.podspec
79
+ - spec/mocks/with_whitelisted_dependency_fixed_versions_v2.podspec
80
+ - spec/mocks/with_whitelisted_dependency_fixed_versions_variable.podspec
73
81
  - spec/mocks/without_dependencies.podspec
74
82
  - spec/mocks/without_version.podspec
75
83
  - spec/spec_helper.rb
@@ -94,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
102
  version: '0'
95
103
  requirements: []
96
104
  rubyforge_project:
97
- rubygems_version: 2.6.13
105
+ rubygems_version: 2.7.8
98
106
  signing_key:
99
107
  specification_version: 4
100
108
  summary: A longer description of cocoapods-whitelist.
@@ -106,11 +114,18 @@ test_files:
106
114
  - spec/mocks/whitelist.json
107
115
  - spec/mocks/whitelist_with_expired_dependencies.json
108
116
  - spec/mocks/with_allowed_in_subspec.podspec
117
+ - spec/mocks/with_allowed_subspec.podspec
109
118
  - spec/mocks/with_expired_dependencies.podspec
110
119
  - spec/mocks/with_fixed_version.podspec
120
+ - spec/mocks/with_more_than_one_version_in_subspec.podspec
111
121
  - spec/mocks/with_not_allowed_in_subspec.podspec
122
+ - spec/mocks/with_not_allowed_subspec.podspec
112
123
  - spec/mocks/with_not_yet_expired_dependencies.podspec
124
+ - spec/mocks/with_similar_name_not_allowed.podspec
113
125
  - spec/mocks/with_two_requirement.podspec
126
+ - spec/mocks/with_whitelisted_dependency_fixed_versions_v1.podspec
127
+ - spec/mocks/with_whitelisted_dependency_fixed_versions_v2.podspec
128
+ - spec/mocks/with_whitelisted_dependency_fixed_versions_variable.podspec
114
129
  - spec/mocks/without_dependencies.podspec
115
130
  - spec/mocks/without_version.podspec
116
131
  - spec/spec_helper.rb