cocoapods-core 1.10.0 → 1.11.0.beta.2

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
2
  SHA256:
3
- metadata.gz: 7bca0f05c15f31af775ca0324d264d2be2a14beb979212d60b67afa84de4f892
4
- data.tar.gz: 43036fb73106921d9662e905508e0619a19326ed246db592e59d8ad2fffb80b8
3
+ metadata.gz: ff12ddf7a1e9510d4d701b561478ca599ce262f8c8924bc9b82b0a7ba31fb127
4
+ data.tar.gz: 2416235d2edcc6bfe656057a090f54afdf96d53948ab1e6796ffbbcdef5a0036
5
5
  SHA512:
6
- metadata.gz: 3cb469adf2b11f27dc95edbb9fb7188c79e07c2c66406a8f8d34ae4030ed548e8222789e9c466473be2eeac02eb213d108fbeafa96809884d19532a587087c06
7
- data.tar.gz: '0700791e6fbd5d8ee674bc6e82797eea88e32bc830cd6231ca540199978bf8e395684b981dce4d5f421dd91f113c5018ea4001f9b66de0829e6becdc38102b19'
6
+ metadata.gz: 2312bc251e1772ea971db3512379bb3b3184437c72f1dd792f70094a8f888aa2cfc702b5e6bc1001fffb0573d3f7107bc19b872ef4229d2ad94510a608240287
7
+ data.tar.gz: 4aea2e2fcd793014741625dbcc2f7a88f8b4d7181dde1fd2952d43d267eaa00e3cda4386f3005e93ee7d81aefe104b55c5ba23d1b8f962498306267e069d0d1e
@@ -350,7 +350,7 @@ module Pod
350
350
  end
351
351
 
352
352
  unless @check_existing_files_for_update
353
- debug "CDN: #{name} Relative path: #{partial_url} exists! Returning local because checking is only perfomed in repo update"
353
+ debug "CDN: #{name} Relative path: #{partial_url} exists! Returning local because checking is only performed in repo update"
354
354
  return Promises.fulfilled_future(partial_url, HYDRA_EXECUTOR)
355
355
  end
356
356
  end
@@ -371,7 +371,7 @@ module Pod
371
371
 
372
372
  download_task = download_typhoeus_impl_async(file_remote_url, etag).then do |response|
373
373
  case response.response_code
374
- when 301
374
+ when 301, 302
375
375
  redirect_location = response.headers['location']
376
376
  debug "CDN: #{name} Redirecting from #{file_remote_url} to #{redirect_location}"
377
377
  download_and_save_with_retries_async(partial_url, redirect_location, etag)
@@ -109,11 +109,16 @@ module Pod
109
109
  # one or more version restrictions).
110
110
  #
111
111
  def requirement
112
- if specific_version
113
- Requirement.new(Version.new(specific_version.version))
114
- else
115
- @requirement
116
- end
112
+ @specific_requirement || @requirement
113
+ end
114
+
115
+ # @param [Version] version the specific version to point to
116
+ #
117
+ def specific_version=(version)
118
+ @specific_version = version
119
+ @specific_requirement = if version
120
+ Requirement.new(Version.new(version.version))
121
+ end
117
122
  end
118
123
 
119
124
  # @return [Bool] whether the dependency points to a subspec.
@@ -196,9 +201,9 @@ module Pod
196
201
  def ==(other)
197
202
  self.class == other.class &&
198
203
  name == other.name &&
199
- requirement == other.requirement &&
200
204
  external_source == other.external_source &&
201
- podspec_repo == other.podspec_repo
205
+ podspec_repo == other.podspec_repo &&
206
+ requirement == other.requirement
202
207
  end
203
208
  alias_method :eql?, :==
204
209
 
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the cocoapods-core.
3
3
  #
4
- CORE_VERSION = '1.10.0'.freeze unless defined? Pod::CORE_VERSION
4
+ CORE_VERSION = '1.11.0.beta.2'.freeze unless defined? Pod::CORE_VERSION
5
5
  end
@@ -166,6 +166,23 @@ module Pod
166
166
  end
167
167
  end
168
168
 
169
+ # Calls the pre integrate callback if defined.
170
+ #
171
+ # @param [Pod::Installer] installer
172
+ # the installer that is performing the installation.
173
+ #
174
+ # @return [Bool] whether a pre integrate callback was specified and it was
175
+ # called.
176
+ #
177
+ def pre_integrate!(installer)
178
+ if @pre_integrate_callback
179
+ @pre_integrate_callback.call(installer)
180
+ true
181
+ else
182
+ false
183
+ end
184
+ end
185
+
169
186
  # Calls the post install callback if defined.
170
187
  #
171
188
  # @param [Pod::Installer] installer
@@ -310,9 +327,9 @@ module Pod
310
327
  podfile = Podfile.new(path) do
311
328
  # rubocop:disable Lint/RescueException
312
329
  begin
313
- # rubocop:disable Eval
330
+ # rubocop:disable Security/Eval
314
331
  eval(contents, nil, path.to_s)
315
- # rubocop:enable Eval
332
+ # rubocop:enable Security/Eval
316
333
  rescue Exception => e
317
334
  message = "Invalid `#{path.basename}` file: #{e.message}"
318
335
  raise DSLError.new(message, path, e, contents)
@@ -921,9 +921,7 @@ module Pod
921
921
  # This hook allows you to make any changes to the Pods after they have
922
922
  # been downloaded but before they are installed.
923
923
  #
924
- # It receives the
925
- # [`Pod::Installer`](http://rubydoc.info/gems/cocoapods/Pod/Installer/)
926
- # as its only argument.
924
+ # It receives the [Pod::Installer] as its only argument.
927
925
  #
928
926
  # @example Defining a pre-install hook in a Podfile.
929
927
  #
@@ -936,15 +934,31 @@ module Pod
936
934
  @pre_install_callback = block
937
935
  end
938
936
 
937
+ # This hook allows you to make changes before the project is written
938
+ # to disk.
939
+ #
940
+ # It receives the [Pod::Installer] as its only argument.
941
+ #
942
+ # @example Customizing the dependencies before integration
943
+ #
944
+ # pre_integrate do |installer|
945
+ # # perform some changes on dependencies
946
+ # end
947
+ #
948
+ # @return [void]
949
+ #
950
+ def pre_integrate(&block)
951
+ raise Informative, 'Specifying multiple `pre_integrate` hooks is unsupported.' if @pre_integrate_callback
952
+ @pre_integrate_callback = block
953
+ end
954
+
939
955
  # This hook allows you to make any last changes to the generated Xcode
940
956
  # project before it is written to disk, or any other tasks you might want
941
957
  # to perform.
942
958
  #
943
- # It receives the
944
- # [`Pod::Installer`](http://rubydoc.info/gems/cocoapods/Pod/Installer/)
945
- # as its only argument.
959
+ # It receives the [Pod::Installer] as its only argument.
946
960
  #
947
- # @example Customising the build settings of all targets
961
+ # @example Customizing the build settings of all targets
948
962
  #
949
963
  # post_install do |installer|
950
964
  # installer.pods_project.targets.each do |target|
@@ -964,11 +978,9 @@ module Pod
964
978
  # This hook allows you to make changes after the project is written
965
979
  # to disk.
966
980
  #
967
- # It receives the
968
- # [`Pod::Installer`](http://rubydoc.info/gems/cocoapods/Pod/Installer/)
969
- # as its only argument.
981
+ # It receives the [Pod::Installer] as its only argument.
970
982
  #
971
- # @example Customising the build settings of all targets
983
+ # @example Customizing the build settings of all targets
972
984
  #
973
985
  # post_integrate do |installer|
974
986
  # # some change after project write to disk
@@ -963,7 +963,7 @@ module Pod
963
963
  if exclusive?
964
964
  whitelist_hash
965
965
  else
966
- parent.send(:configuration_pod_whitelist).merge(whitelist_hash) { |l, r| (l + r).uniq }
966
+ parent.send(:configuration_pod_whitelist).merge(whitelist_hash) { |_, l, r| Array(l).concat(r).uniq }
967
967
  end
968
968
  end
969
969
 
@@ -15,7 +15,7 @@ module Pod
15
15
  #
16
16
  PATTERN = /\A\s*(#{quoted_operators})?\s*(#{Version::VERSION_PATTERN})\s*\z/
17
17
 
18
- DefaultRequirement = ['>=', Version.new(0)] # rubocop:disable Style/ConstantName
18
+ DefaultRequirement = ['>=', Version.new(0)] # rubocop:disable Naming/ConstantName
19
19
 
20
20
  #-------------------------------------------------------------------------#
21
21
 
@@ -167,9 +167,11 @@ module Pod
167
167
  pod_dir = pod_path(name)
168
168
  return unless pod_dir.exist?
169
169
  @versions_by_name[name] ||= pod_dir.children.map do |v|
170
+ next nil unless v.directory?
170
171
  basename = v.basename.to_s
172
+ next unless basename[0, 1] != '.'
171
173
  begin
172
- Version.new(basename) if v.directory? && basename[0, 1] != '.'
174
+ Version.new(basename)
173
175
  rescue ArgumentError
174
176
  raise Informative, 'An unexpected version directory ' \
175
177
  "`#{basename}` was encountered for the " \
@@ -266,6 +268,11 @@ module Pod
266
268
  query = query.root_name
267
269
  end
268
270
 
271
+ if (versions = @versions_by_name[query]) && !versions.empty?
272
+ set = set(query)
273
+ return set if set.specification_name == query
274
+ end
275
+
269
276
  found = []
270
277
  Pathname.glob(pod_path(query)) do |path|
271
278
  next unless Dir.foreach(path).any? { |child| child != '.' && child != '..' }
@@ -1,3 +1,5 @@
1
+ require 'public_suffix'
2
+
1
3
  module Pod
2
4
  class Source
3
5
  class Manager
@@ -265,6 +267,11 @@ module Pod
265
267
  require 'json'
266
268
  begin
267
269
  index = JSON.parse(search_index_path.read)
270
+ unless index # JSON.parse("null") => nil
271
+ search_index_path.delete
272
+ return nil
273
+ end
274
+
268
275
  index if index.is_a?(Hash) # TODO: should we also check if hash has correct hierarchy?
269
276
  rescue JSON::ParserError
270
277
  search_index_path.delete
@@ -404,12 +411,12 @@ module Pod
404
411
  # @example A non-Github.com URL
405
412
  #
406
413
  # name_for_url('https://sourceforge.org/Artsy/Specs.git')
407
- # # sourceforge-artsy-specs
414
+ # # sourceforge-artsy
408
415
  #
409
416
  # @example A file URL
410
417
  #
411
418
  # name_for_url('file:///Artsy/Specs.git')
412
- # # artsy-specs
419
+ # # artsy
413
420
  #
414
421
  # @param [#to_s] url
415
422
  # The URL of the source.
@@ -419,33 +426,52 @@ module Pod
419
426
  def name_for_url(url)
420
427
  base_from_host_and_path = lambda do |host, path|
421
428
  if host && !host.empty?
422
- base = host.split('.')[-2] || host
423
- base += '-'
429
+ domain = PublicSuffix.parse(host) rescue nil
430
+ base = [domain&.sld || host]
431
+ base = [] if base == %w(github)
424
432
  else
425
- base = ''
433
+ base = []
426
434
  end
427
435
 
428
- base + path.gsub(/.git$/, '').gsub(%r{^/}, '').split('/').join('-')
436
+ path = path.gsub(/.git$/, '').gsub(%r{^/}, '').split('/')
437
+ path.pop if path.last == 'specs'
438
+
439
+ (base + path).join('-')
440
+ end
441
+
442
+ valid_url = lambda do |url|
443
+ url =~ URI.regexp && (URI(url) rescue false)
429
444
  end
430
445
 
431
- case url.to_s.downcase
446
+ valid_scp_url = lambda do |url|
447
+ valid_url['scp://' + url]
448
+ end
449
+
450
+ url = url.to_s.downcase
451
+
452
+ case url
432
453
  when %r{https://#{Regexp.quote(trunk_repo_hostname)}}i
454
+ # Main CDN repo
433
455
  base = Pod::TrunkSource::TRUNK_REPO_NAME
434
- when %r{github.com[:/]+(.+)/(.+)}
435
- base = Regexp.last_match[1]
436
- when %r{^\S+@(\S+)[:/]+(.+)$}
437
- host, path = Regexp.last_match.captures
438
- base = base_from_host_and_path[host, path]
439
- when URI.regexp
440
- url = URI(url.downcase)
456
+ when valid_url
457
+ # HTTPS URL or something similar
458
+ url = valid_url[url]
459
+ base = base_from_host_and_path[url.host, url.path]
460
+ when valid_scp_url
461
+ # SCP-style URLs for private git repos
462
+ url = valid_scp_url[url]
441
463
  base = base_from_host_and_path[url.host, url.path]
464
+ when %r{(?:git|ssh|https?|[a-z0-9_-]+@([-\w.]+)):(\/\/)?(.*?)(\.git)(\/?|\#[-\d\w._]+?)$}i
465
+ # Additional SCP-style URLs for private git repos
466
+ host, _, path = Regexp.last_match.captures
467
+ base = base_from_host_and_path[host, path]
442
468
  else
443
- base = url.to_s.downcase
469
+ # This is nearly impossible, with all the previous cases
470
+ raise Informative, "Couldn't determine repo name for URL: #{url}"
444
471
  end
445
472
 
446
473
  name = base
447
- infinity = 1.0 / 0
448
- (1..infinity).each do |i|
474
+ (1..).each do |i|
449
475
  break unless source_dir(name).exist?
450
476
  name = "#{base}-#{i}"
451
477
  end
@@ -463,6 +463,12 @@ module Pod
463
463
  end
464
464
  end
465
465
 
466
+ # @return [Hash] The on demand resources value.
467
+ #
468
+ def on_demand_resources
469
+ attributes_hash['on_demand_resources'] || {}
470
+ end
471
+
466
472
  # @return [Hash] The scheme value.
467
473
  #
468
474
  def scheme
@@ -824,9 +830,9 @@ module Pod
824
830
  #
825
831
  #
826
832
  def self._eval_podspec(string, path)
827
- # rubocop:disable Eval
833
+ # rubocop:disable Security/Eval
828
834
  eval(string, nil, path.to_s)
829
- # rubocop:enable Eval
835
+ # rubocop:enable Security/Eval
830
836
 
831
837
  # rubocop:disable Lint/RescueException
832
838
  rescue Exception => e
@@ -168,6 +168,10 @@ module Pod
168
168
  #
169
169
  spec_attr_accessor :public_header_files
170
170
 
171
+ # @return [Array<String>] the project headers of the Pod.
172
+ #
173
+ spec_attr_accessor :project_header_files
174
+
171
175
  # @return [Array<String>] the private headers of the Pod.
172
176
  #
173
177
  spec_attr_accessor :private_header_files
@@ -182,7 +186,13 @@ module Pod
182
186
  #
183
187
  spec_attr_accessor :vendored_libraries
184
188
 
185
- # @return [Hash{String=>String}]] hash where the keys are the names of
189
+ # @return [Hash{String => Array<String>}] hash where the keys are the tags of
190
+ # the on demand resources and the values are their relative file
191
+ # patterns.
192
+ #
193
+ spec_attr_accessor :on_demand_resources
194
+
195
+ # @return [Hash{String=>String}]] hash where the keys are the names of
186
196
  # the resource bundles and the values are their relative file
187
197
  # patterns.
188
198
  #
@@ -455,6 +465,32 @@ module Pod
455
465
  Specification.convert_keys_to_symbol(value, :recursive => false) if value && value.is_a?(Hash)
456
466
  end
457
467
 
468
+ # Ensures that the file patterns of the on demand resources are contained in
469
+ # an array.
470
+ #
471
+ # @param [String, Array, Hash] value.
472
+ # The value of the attribute as specified by the user.
473
+ #
474
+ # @return [Hash] the on demand resources.
475
+ #
476
+ def _prepare_on_demand_resources(value)
477
+ result = {}
478
+ if value
479
+ value.each do |key, patterns|
480
+ case patterns
481
+ when String, Array
482
+ result[key] = { :paths => [*patterns].compact, :category => :download_on_demand }
483
+ when Hash
484
+ patterns = Specification.convert_keys_to_symbol(patterns, :recursive => false)
485
+ result[key] = { :paths => [*patterns[:paths]].compact, :category => patterns.fetch(:category, :download_on_demand).to_sym }
486
+ else
487
+ raise StandardError, "Unknown on demand resource value type `#{patterns}`."
488
+ end
489
+ end
490
+ end
491
+ result
492
+ end
493
+
458
494
  # Ensures that the file patterns of the resource bundles are contained in
459
495
  # an array.
460
496
  #
@@ -299,6 +299,36 @@ module Pod
299
299
 
300
300
  #------------------#
301
301
 
302
+ # @!method readme=(readme)
303
+ #
304
+ # The URL for the README markdown file for this pod version.
305
+ #
306
+ # @example
307
+ #
308
+ # spec.readme = 'https://www.example.com/Pod-1.5-README.md'
309
+ #
310
+ # @param [String] readme
311
+ # the readme markdown URL.
312
+ #
313
+ root_attribute :readme
314
+
315
+ #------------------#
316
+
317
+ # @!method changelog=(changelog)
318
+ #
319
+ # The URL for the CHANGELOG markdown file for this pod version.
320
+ #
321
+ # @example
322
+ #
323
+ # spec.changelog = 'https://www.example.com/Pod-1.5-CHANGELOG.md'
324
+ #
325
+ # @param [String] changelog
326
+ # the changelog markdown URL.
327
+ #
328
+ root_attribute :changelog
329
+
330
+ #------------------#
331
+
302
332
  # The keys accepted by the hash of the source attribute.
303
333
  #
304
334
  SOURCE_KEYS = {
@@ -1047,7 +1077,7 @@ module Pod
1047
1077
  SCRIPT_PHASE_OPTIONAL_KEYS = [:shell_path, :input_files, :output_files, :input_file_lists, :output_file_lists,
1048
1078
  :show_env_vars_in_log, :execution_position, :dependency_file].freeze
1049
1079
 
1050
- EXECUTION_POSITION_KEYS = [:before_compile, :after_compile, :any].freeze
1080
+ EXECUTION_POSITION_KEYS = [:before_compile, :after_compile, :before_headers, :after_headers, :any].freeze
1051
1081
 
1052
1082
  ALL_SCRIPT_PHASE_KEYS = (SCRIPT_PHASE_REQUIRED_KEYS + SCRIPT_PHASE_OPTIONAL_KEYS).freeze
1053
1083
 
@@ -1229,6 +1259,32 @@ module Pod
1229
1259
 
1230
1260
  #------------------#
1231
1261
 
1262
+ # @!method project_header_files=(project_header_files)
1263
+ #
1264
+ # A list of file patterns that should be used to mark project headers.
1265
+ #
1266
+ # ---
1267
+ #
1268
+ # These patterns are matched against the public headers (or all the
1269
+ # headers if no public headers have been specified) to exclude those
1270
+ # headers which should not be exposed to the user project and which
1271
+ # should not be used to generate the documentation. When the library
1272
+ # is built, these headers will _not_ appear in the build directory.
1273
+ #
1274
+ #
1275
+ # @example
1276
+ #
1277
+ # spec.project_header_files = 'Headers/Project/*.h'
1278
+ #
1279
+ # @param [String, Array<String>] project_header_files
1280
+ # the project headers of the Pod.
1281
+ #
1282
+ attribute :project_header_files,
1283
+ :container => Array,
1284
+ :file_patterns => true
1285
+
1286
+ #------------------#
1287
+
1232
1288
  # @!method private_header_files=(private_header_files)
1233
1289
  #
1234
1290
  # A list of file patterns that should be used to mark private headers.
@@ -1241,7 +1297,7 @@ module Pod
1241
1297
  # should not be used to generate the documentation. When the library
1242
1298
  # is built, these headers will appear in the build directory.
1243
1299
  #
1244
- # Header files that are not listed as neither public nor private will
1300
+ # Header files that are not listed as neither public nor project or private will
1245
1301
  # be treated as private, but in addition will not appear in the build
1246
1302
  # directory at all.
1247
1303
  #
@@ -1305,6 +1361,58 @@ module Pod
1305
1361
 
1306
1362
  #------------------#
1307
1363
 
1364
+ # The keys accepted by the category attribute for each on demand resource entry.
1365
+ #
1366
+ ON_DEMAND_RESOURCES_CATEGORY_KEYS = [:download_on_demand, :prefetched, :initial_install].freeze
1367
+
1368
+ # @!method on_demand_resources=(on_demand_resources)
1369
+ #
1370
+ # A hash of on demand resources that should be copied into the target bundle. Resources specified here
1371
+ # will automatically become part of the resources build phase of the target this pod is integrated into.
1372
+ #
1373
+ # If no category is specified then `:download_on_demand` is used as the default.
1374
+ #
1375
+ # @note
1376
+ #
1377
+ # Tags specified by pods are _always_ managed by CocoaPods. If a tag is renamed, changed or deleted then
1378
+ # CocoaPods will update the tag within the targets the pod was integrated into. It is highly recommended not to
1379
+ # share the same tags for your project as the ones used by the pods your project consumes.
1380
+ #
1381
+ # @example
1382
+ #
1383
+ # s.on_demand_resources = {
1384
+ # 'Tag1' => 'file1.png'
1385
+ # }
1386
+ #
1387
+ # @example
1388
+ #
1389
+ # s.on_demand_resources = {
1390
+ # 'Tag1' => ['file1.png', 'file2.png']
1391
+ # }
1392
+ #
1393
+ # @example
1394
+ #
1395
+ # s.on_demand_resources = {
1396
+ # 'Tag1' => { :paths => ['file1.png', 'file2.png'], :category => :download_on_demand }
1397
+ # }
1398
+ #
1399
+ # @example
1400
+ #
1401
+ # s.on_demand_resources = {
1402
+ # 'Tag1' => { :paths => ['file1.png', 'file2.png'], :category => :initial_install }
1403
+ # }
1404
+ #
1405
+ # @param [Hash{String=>String}, Hash{String=>Array<String>}, Hash{String=>Hash}] on_demand_resources
1406
+ # The on demand resources shipped with the Pod.
1407
+ #
1408
+ attribute :on_demand_resources,
1409
+ :types => [String, Array, Hash],
1410
+ :container => Hash,
1411
+ :file_patterns => true,
1412
+ :singularize => true
1413
+
1414
+ #------------------#
1415
+
1308
1416
  # @!method resource_bundles=(*resource_bundles)
1309
1417
  #
1310
1418
  # This attribute allows to define the name and the file of the resource
@@ -1428,6 +1536,12 @@ module Pod
1428
1536
  # The module map file that should be used when this pod is integrated as
1429
1537
  # a framework.
1430
1538
  #
1539
+ # `false` indicates that the default CocoaPods `modulemap` file should not
1540
+ # be generated.
1541
+ #
1542
+ # `true` is the default and indicates that the default CocoaPods
1543
+ # `modulemap` file should be generated.
1544
+ #
1431
1545
  # ---
1432
1546
  #
1433
1547
  # By default, CocoaPods creates a module map file based upon the public
@@ -1437,11 +1551,17 @@ module Pod
1437
1551
  #
1438
1552
  # spec.module_map = 'source/module.modulemap'
1439
1553
  #
1440
- # @param [String] module_map
1441
- # the path to the module map file that should be used.
1554
+ # @example
1555
+ #
1556
+ # spec.module_map = false
1557
+ #
1558
+ # @param [String, Bool] module_map
1559
+ # the path to the module map file that should be used
1560
+ # or whether to disable module_map generation.
1442
1561
  #
1443
1562
  attribute :module_map,
1444
- :root_only => true
1563
+ :types => [TrueClass, FalseClass, String],
1564
+ :root_only => true
1445
1565
 
1446
1566
  #-----------------------------------------------------------------------#
1447
1567
 
@@ -242,9 +242,6 @@ module Pod
242
242
  def _validate_version(v)
243
243
  if v.to_s.empty?
244
244
  results.add_error('version', 'A version is required.')
245
- elsif v <= Version::ZERO
246
- results.add_error('version', 'The version of the spec should be' \
247
- ' higher than 0.')
248
245
  end
249
246
  end
250
247
 
@@ -337,19 +334,6 @@ module Pod
337
334
  end
338
335
  end
339
336
 
340
- # Performs validations related to the `vendored_libraries` attribute.
341
- #
342
- # @param [Array<String>] vendored_libraries the values specified in the `vendored_libraries` attribute
343
- #
344
- def _validate_vendored_libraries(vendored_libraries)
345
- vendored_libraries.each do |lib|
346
- lib_name = lib.downcase
347
- unless lib_name.end_with?('.a') && lib_name.start_with?('lib')
348
- results.add_warning('vendored_libraries', "`#{File.basename(lib)}` does not match the expected static library name format `lib[name].a`")
349
- end
350
- end
351
- end
352
-
353
337
  # Performs validations related to the `license` attribute.
354
338
  #
355
339
  def _validate_license(l)
@@ -450,6 +434,17 @@ module Pod
450
434
  end
451
435
  end
452
436
 
437
+ # Performs validations related to the `on_demand_resources` attribute.
438
+ #
439
+ def _validate_on_demand_resources(h)
440
+ h.values.each do |value|
441
+ unless Specification::ON_DEMAND_RESOURCES_CATEGORY_KEYS.include?(value[:category])
442
+ results.add_error('on_demand_resources', "Invalid on demand resources category value `#{value[:category]}`. " \
443
+ "Available options are `#{Specification::ON_DEMAND_RESOURCES_CATEGORY_KEYS.join(', ')}`.")
444
+ end
445
+ end
446
+ end
447
+
453
448
  # Performs validation related to the `scheme` attribute.
454
449
  #
455
450
  def _validate_scheme(s)
@@ -520,6 +515,24 @@ module Pod
520
515
  end
521
516
  end
522
517
 
518
+ # Performs validations related to the `readme` attribute.
519
+ #
520
+ def _validate_readme(s)
521
+ if s =~ %r{https://www.example.com/README}
522
+ results.add_warning('readme', 'The readme has ' \
523
+ 'not been updated from the default.')
524
+ end
525
+ end
526
+
527
+ # Performs validations related to the `changelog` attribute.
528
+ #
529
+ def _validate_changelog(s)
530
+ if s =~ %r{https://www.example.com/CHANGELOG}
531
+ results.add_warning('changelog', 'The changelog has ' \
532
+ 'not been updated from the default.')
533
+ end
534
+ end
535
+
523
536
  # @param [Hash,Object] value
524
537
  #
525
538
  def _validate_info_plist(value)
@@ -90,6 +90,7 @@ module Pod
90
90
 
91
91
  if patterns.respond_to?(:each)
92
92
  patterns.each do |pattern|
93
+ pattern = pattern[:paths].join if attrb.name == :on_demand_resources
93
94
  if pattern.respond_to?(:start_with?) && pattern.start_with?('/')
94
95
  results.add_error('File Patterns', 'File patterns must be ' \
95
96
  "relative and cannot start with a slash (#{attrb.name}).")
@@ -102,7 +103,7 @@ module Pod
102
103
  # Check empty subspec attributes
103
104
  #
104
105
  def check_if_spec_is_empty
105
- methods = %w( source_files resources resource_bundles preserve_paths
106
+ methods = %w( source_files on_demand_resources resources resource_bundles preserve_paths
106
107
  dependencies vendored_libraries vendored_frameworks )
107
108
  empty_patterns = methods.all? { |m| consumer.send(m).empty? }
108
109
  empty = empty_patterns && consumer.spec.subspecs.empty?
@@ -99,6 +99,18 @@ module Pod
99
99
  attributes_hash['social_media_url']
100
100
  end
101
101
 
102
+ # @return [String] The readme.
103
+ #
104
+ def readme
105
+ attributes_hash['readme']
106
+ end
107
+
108
+ # @return [String] The changelog.
109
+ #
110
+ def changelog
111
+ attributes_hash['changelog']
112
+ end
113
+
102
114
  # @return [Hash] A hash containing the license information of the Pod.
103
115
  #
104
116
  # @note The indentation is stripped from the license text.
@@ -212,8 +212,6 @@ module Pod
212
212
 
213
213
  #-----------------------------------------------------------------------#
214
214
 
215
- private
216
-
217
215
  # @!group Array Sorting
218
216
 
219
217
  # Sorts an array using another one as a sort hint. All the values of the
@@ -291,21 +289,21 @@ module Pod
291
289
  /0x[0-9a-fA-F]+/, # base 16 int
292
290
  /[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?/, # float
293
291
  /[-+]?\.(inf|Inf|INF)/, # infinity
294
- /\.(nan|NaN|NAN)/, # NaN
292
+ /\.(nan|NaN|NAN)/ # NaN
295
293
  )
296
294
  private_constant :RESOLVED_TAGS
297
295
 
298
296
  INDICATOR_START_CHARS = %w(- ? : , [ ] { } # & * ! | > ' " % @ `).freeze
299
- INDICATOR_START = /\A#{Regexp.union(INDICATOR_START_CHARS)}/
297
+ INDICATOR_START = /\A#{Regexp.union(INDICATOR_START_CHARS)}/.freeze
300
298
  private_constant :INDICATOR_START_CHARS, :INDICATOR_START
301
299
 
302
- RESOLVED_TAGS_PATTERN = /\A#{Regexp.union(RESOLVED_TAGS)}\z/
300
+ RESOLVED_TAGS_PATTERN = /\A#{Regexp.union(RESOLVED_TAGS)}\z/.freeze
303
301
  private_constant :RESOLVED_TAGS_PATTERN
304
302
 
305
303
  VALID_PLAIN_SCALAR_STRING = %r{\A
306
304
  [\w&&[^#{INDICATOR_START_CHARS}]] # valid first character
307
305
  [\w/\ \(\)~<>=\.:`,-]* # all characters allowed after the first one
308
- \z}ox
306
+ \z}ox.freeze
309
307
  private_constant :VALID_PLAIN_SCALAR_STRING
310
308
 
311
309
  def process_string(string)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,28 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-10-20 00:00:00.000000000 Z
12
+ date: 2021-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '5.0'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '6'
23
+ version: '7'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ">"
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: '5.0'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '6'
33
+ version: '7'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: nap
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -121,28 +121,28 @@ dependencies:
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '2.6'
124
+ version: '2.8'
125
125
  type: :runtime
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '2.6'
131
+ version: '2.8'
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: public_suffix
134
134
  requirement: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '4.0'
139
139
  type: :runtime
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '4.0'
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: bacon
148
148
  requirement: !ruby/object:Gem::Requirement
@@ -224,15 +224,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
224
224
  requirements:
225
225
  - - ">="
226
226
  - !ruby/object:Gem::Version
227
- version: 2.3.3
227
+ version: '2.6'
228
228
  required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  requirements:
230
- - - ">="
230
+ - - ">"
231
231
  - !ruby/object:Gem::Version
232
- version: '0'
232
+ version: 1.3.1
233
233
  requirements: []
234
- rubygems_version: 3.0.3
234
+ rubygems_version: 3.1.3
235
235
  signing_key:
236
- specification_version: 3
236
+ specification_version: 4
237
237
  summary: The models of CocoaPods
238
238
  test_files: []