cocoapods-core 1.3.0 → 1.3.1

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
  SHA1:
3
- metadata.gz: 5c063b0b4e40e944f935689ca0428f16995165a1
4
- data.tar.gz: 080d1eb8b262d0b82a96988c993bccc0565648cf
3
+ metadata.gz: 96af737ecf934debea04d7435690a369c6f23560
4
+ data.tar.gz: 336c3874933dc9d7176bba6c8195365b23e34e56
5
5
  SHA512:
6
- metadata.gz: 1cb45d36de1199af2850a25e01c98c0fe5665d4e69d501accfc9bf816c596440fe76c9de6b3d5406f9f75c115713ee013e520cb89a7ef04ab4acc8c739e55305
7
- data.tar.gz: d2bd75318fd914971f490e6c8d9f5744c382519667289c1fce767e2a55467788bd725eeb4b55985b7ed3c45fca76d38f5fb3ff2f2bcd25ba298de4d6a5c50b00
6
+ metadata.gz: 2f1d8ae60360d5bc05fb344fcd63a4347a1df6cb9a48bc76337e2f32cdd6ab8bc384d93dcf5dadb033af42eb9b49b99a8451a28ecfddd3efb6fb9b573e8dcdaf
7
+ data.tar.gz: 0aa890f8197e50892c1ea190b83e3d8596fffa578866adf5f7568ee36104f1d5ac90c05bb924db947f4fe9f58bcb1f520e99de76a154765e795ba385b5176f79
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the cocoapods-core.
3
3
  #
4
- CORE_VERSION = '1.3.0'.freeze unless defined? Pod::CORE_VERSION
4
+ CORE_VERSION = '1.3.1'.freeze unless defined? Pod::CORE_VERSION
5
5
  end
@@ -458,6 +458,25 @@ module Pod
458
458
 
459
459
  #------------------#
460
460
 
461
+ # @!method static_framework=(flag)
462
+ #
463
+ # Indicates, that if use_frameworks! is specified, the
464
+ # pod should include a static library framework.
465
+ #
466
+ # @example
467
+ #
468
+ # spec.static_framework = true
469
+ #
470
+ # @param [Bool] flag
471
+ # Indicates, that if use_frameworks! is specified, the
472
+ # pod should include a static library framework.
473
+ #
474
+ root_attribute :static_framework,
475
+ :types => [TrueClass, FalseClass],
476
+ :default_value => false
477
+
478
+ #------------------#
479
+
461
480
  # @!method deprecated=(flag)
462
481
  #
463
482
  # Whether the library has been deprecated.
@@ -1336,10 +1355,14 @@ module Pod
1336
1355
  #
1337
1356
  # test_spec.test_type = :unit
1338
1357
  #
1339
- # @param [Symbol] type
1358
+ # @example
1359
+ #
1360
+ # test_spec.test_type = 'unit'
1361
+ #
1362
+ # @param [Symbol, String] type
1340
1363
  # The test type to use.
1341
1364
  attribute :test_type,
1342
- :types => [Symbol],
1365
+ :types => [Symbol, String],
1343
1366
  :multi_platform => false
1344
1367
 
1345
1368
  # Represents a test specification for the library. Here you can place all
@@ -26,8 +26,12 @@ module Pod
26
26
  platforms = Hash[available_platforms.map { |p| [p.name.to_s, p.deployment_target && p.deployment_target.to_s] }]
27
27
  hash['platforms'] = platforms
28
28
  end
29
- unless subspecs.empty?
30
- hash['subspecs'] = subspecs.map(&:to_hash)
29
+ all_testspecs, all_subspecs = subspecs.partition(&:test_specification?)
30
+ unless all_testspecs.empty?
31
+ hash['testspecs'] = all_testspecs.map(&:to_hash)
32
+ end
33
+ unless all_subspecs.empty?
34
+ hash['subspecs'] = all_subspecs.map(&:to_hash)
31
35
  end
32
36
  hash
33
37
  end
@@ -49,25 +53,33 @@ module Pod
49
53
 
50
54
  # Configures a new specification from the given hash.
51
55
  #
52
- # @param [Hash] the hash which contains the information of the
56
+ # @param [Hash] hash the hash which contains the information of the
53
57
  # specification.
54
58
  #
59
+ # @param [Specification] parent the parent of the specification unless the
60
+ # specification is a root.
61
+ #
55
62
  # @return [Specification] the specification
56
63
  #
57
64
  def self.from_hash(hash, parent = nil)
58
65
  spec = Spec.new(parent)
59
66
  attributes_hash = hash.dup
60
67
  subspecs = attributes_hash.delete('subspecs')
68
+ testspecs = attributes_hash.delete('testspecs')
61
69
  spec.attributes_hash = attributes_hash
62
70
  spec.test_specification = !attributes_hash['test_type'].nil?
63
- if subspecs
64
- spec.subspecs = subspecs.map do |s_hash|
65
- Specification.from_hash(s_hash, spec)
66
- end
67
- end
71
+ spec.subspecs.concat(subspecs_from_hash(spec, subspecs))
72
+ spec.subspecs.concat(subspecs_from_hash(spec, testspecs))
68
73
  spec
69
74
  end
70
75
 
76
+ def self.subspecs_from_hash(spec, subspecs)
77
+ return [] if subspecs.nil?
78
+ subspecs.map do |s_hash|
79
+ Specification.from_hash(s_hash, spec)
80
+ end
81
+ end
82
+
71
83
  #-----------------------------------------------------------------------#
72
84
  end
73
85
  end
@@ -384,8 +384,8 @@ module Pod
384
384
  results.add_error('test_type', 'Test type can only be used for test specifications.')
385
385
  return
386
386
  end
387
- supported_test_types = Specification::DSL::SUPPORTED_TEST_TYPES
388
- unless supported_test_types.include?(t)
387
+ supported_test_types = Specification::DSL::SUPPORTED_TEST_TYPES.map(&:to_s)
388
+ unless supported_test_types.include?(t.to_s)
389
389
  results.add_error('test_type', "The test type `#{t}` is not supported. " \
390
390
  "Supported test type values are #{supported_test_types}.")
391
391
  end
@@ -152,6 +152,13 @@ module Pod
152
152
  command.strip_heredoc.chomp if command
153
153
  end
154
154
 
155
+ # @return [Bool] Indicates, that if use_frameworks! is specified, the
156
+ # framework should include a static library.
157
+ #
158
+ def static_framework
159
+ attributes_hash['static_framework']
160
+ end
161
+
155
162
  # @return [Bool] Whether the Pod has been deprecated.
156
163
  #
157
164
  def deprecated
@@ -96,6 +96,7 @@ module Pod
96
96
  case value
97
97
  when Array then process_array(value)
98
98
  when Hash then process_hash(value, hash_keys_hint)
99
+ when String then process_string(value)
99
100
  else YAML.dump(value, :line_width => 2**31 - 1).sub(/\A---/, '').sub(/[.]{3}\s*\Z/, '')
100
101
  end.strip
101
102
  end
@@ -270,6 +271,35 @@ module Pod
270
271
  when Symbol then sorting_string(value.to_s)
271
272
  when Array then sorting_string(value.first)
272
273
  when Hash then value.keys.map { |key| key.to_s.downcase }.sort.first
274
+ else raise "Cannot sort #{value.inspect}"
275
+ end
276
+ end
277
+
278
+ RESOLVED_TAGS = [
279
+ 'null', 'Null', 'NULL', '~', '', # resolve to null
280
+ 'true', 'True', 'TRUE', 'false', 'False', 'FALSE', # bool
281
+ /[-+]?[0-9]+/, # base 10 int
282
+ /00[0-7]+/, # base 8 int
283
+ /0x[0-9a-fA-F]+/, # base 16 int
284
+ /[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?/, # float
285
+ /[-+]?\.(inf|Inf|INF)/, # infinity
286
+ /\.(nan|NaN|NAN)/, # NaN
287
+ ].freeze
288
+ private_constant :RESOLVED_TAGS
289
+
290
+ RESOLVED_TAGS_PATTERN = /\A#{Regexp.union(RESOLVED_TAGS)}\z/
291
+ private_constant :RESOLVED_TAGS_PATTERN
292
+
293
+ def process_string(string)
294
+ case string
295
+ when /\A\s*\z/
296
+ string.inspect
297
+ when RESOLVED_TAGS_PATTERN
298
+ "'#{string}'"
299
+ when %r{\A\w[\w/ \(\)~<>=\.-]*\z}
300
+ string
301
+ else
302
+ string.inspect
273
303
  end
274
304
  end
275
305
  end
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.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-02 00:00:00.000000000 Z
12
+ date: 2017-08-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport