cocoapods-core 0.39.0.beta.5 → 0.39.0.rc.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: d0cce19a9396dc1ae60513185830afbf3af68a6a
4
- data.tar.gz: 92f9afcaca4c08a68c2d50871c263bd0f02e4ea4
3
+ metadata.gz: 4b5811fb8da66a24c3eec196ba8e7c03d5e10d15
4
+ data.tar.gz: 72861dbb796f441a58371a120baf8f92110d8b04
5
5
  SHA512:
6
- metadata.gz: e9fa0d1e8b277d29d151f90a08a7060aa5f3014770fe79fb210f977904b34944bc64bb6f9b0de4ea92b871d9276e8dfbd659d6c54175aba696499e8f2a65aaee
7
- data.tar.gz: 0432b37f724696727e94ccbd7265ab5b7f0f35ff79714ba98f5b322123751470121da64dbced2b9bb5be3eaa54a84e3a4ef69eca1e7e56b30d81a7a77935e670
6
+ metadata.gz: f0ffeff25cfbf0a2c888c04babb2806f2c269c924e93219c242b40a2f0a14e0a7a3b2ed4edfb3f2fdcd7255522b540005ca9ec58e9257dcee00cb19a193f0e3b
7
+ data.tar.gz: b13968326dbe8279f8c6b2126e0a7ef163a1ee16d00d5221548c9a0fd1cc7105eb106d1b410fc717dc0c5118f499ce7b2154b2523d75965bb01f90ddfdce06e3
@@ -335,7 +335,7 @@ module Pod
335
335
  when /HEAD/
336
336
  Dependency.new(name, :head)
337
337
  else
338
- version_requirements = version.split(',') if version
338
+ version_requirements = version.split(',') if version
339
339
  Dependency.new(name, version_requirements)
340
340
  end
341
341
  end
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the cocoapods-core.
3
3
  #
4
- CORE_VERSION = '0.39.0.beta.5' unless defined? Pod::CORE_VERSION
4
+ CORE_VERSION = '0.39.0.rc.1' unless defined? Pod::CORE_VERSION
5
5
  end
@@ -259,7 +259,7 @@ module Pod
259
259
  installed_deps = dependencies.map do |dep|
260
260
  dependencies_to_lock_pod_named(dep.root_name)
261
261
  end.flatten
262
- all_dep_names = (dependencies + podfile.dependencies).map(&:name).uniq
262
+ all_dep_names = (dependencies + podfile.dependencies).map(&:name).uniq
263
263
  all_dep_names.each do |name|
264
264
  installed_dep = installed_deps.find { |d| d.name == name }
265
265
  podfile_dep = podfile.dependencies.find { |d| d.name == name }
@@ -206,7 +206,8 @@ module Pod
206
206
  when :osx then 'OS X'
207
207
  when :watchos then 'watchOS'
208
208
  when :tvos then 'tvOS'
209
- else symbolic_name.to_s end
209
+ else symbolic_name.to_s
210
+ end
210
211
  end
211
212
  end
212
213
  end
@@ -183,12 +183,12 @@ module Pod
183
183
  # @return [Array] The keys used by the hash representation of the Podfile.
184
184
  #
185
185
  HASH_KEYS = %w(
186
- target_definitions
187
186
  workspace
188
187
  sources
189
- generate_bridge_support
190
- set_arc_compatibility_flag
191
188
  plugins
189
+ set_arc_compatibility_flag
190
+ generate_bridge_support
191
+ target_definitions
192
192
  ).freeze
193
193
 
194
194
  # @return [Hash] The hash representation of the Podfile.
@@ -203,7 +203,22 @@ module Pod
203
203
  # @return [String] The YAML representation of the Podfile.
204
204
  #
205
205
  def to_yaml
206
- to_hash.to_yaml
206
+ require 'cocoapods-core/yaml_helper'
207
+ "---\n" << YAMLHelper.convert_hash(to_hash, HASH_KEYS)
208
+ end
209
+
210
+ # @return [String] The SHA1 digest of the file in which the Podfile
211
+ # is defined.
212
+ #
213
+ # @return [Nil] If the podfile is not defined in a file.
214
+ #
215
+ def checksum
216
+ unless defined_in_file.nil?
217
+ require 'digest'
218
+ checksum = Digest::SHA1.hexdigest(File.read(defined_in_file))
219
+ checksum = checksum.encode('UTF-8') if checksum.respond_to?(:encode)
220
+ checksum
221
+ end
207
222
  end
208
223
 
209
224
  # @!group Class methods
@@ -243,7 +258,7 @@ module Pod
243
258
  # @return [Podfile] the new Podfile
244
259
  #
245
260
  def self.from_ruby(path, contents = nil)
246
- contents ||= File.open(path, 'r:utf-8') { |f| f.read }
261
+ contents ||= File.open(path, 'r:utf-8', &:read)
247
262
 
248
263
  # Work around for Rubinius incomplete encoding in 1.9 mode
249
264
  if contents.respond_to?(:encoding) && contents.encoding.name != 'UTF-8'
@@ -285,7 +300,7 @@ module Pod
285
300
  # @return [Podfile] the new Podfile
286
301
  #
287
302
  def self.from_yaml(path)
288
- string = File.open(path, 'r:utf-8') { |f| f.read }
303
+ string = File.open(path, 'r:utf-8', &:read)
289
304
  # Work around for Rubinius incomplete encoding in 1.9 mode
290
305
  if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
291
306
  string.encode!('UTF-8')
@@ -20,8 +20,6 @@ module Pod
20
20
  # @!group Configuration
21
21
  #-----------------------------------------------------------------------#
22
22
 
23
- # rubocop:disable Style/TrivialAccessors
24
-
25
23
  # Allows to specify an optional callback which is called before
26
24
  # analysing every spec. Suitable for UI.
27
25
  #
@@ -35,8 +33,6 @@ module Pod
35
33
  @pre_check_callback = block
36
34
  end
37
35
 
38
- # rubocop:enable Style/TrivialAccessors
39
-
40
36
  public
41
37
 
42
38
  # @!group Actions
@@ -113,7 +109,7 @@ module Pod
113
109
  #
114
110
  def check_spec_path(name, version, spec)
115
111
  unless spec.name == name && spec.version.to_s == version.to_s
116
- message = "Incorrect path #{ spec.defined_in_file }"
112
+ message = "Incorrect path #{spec.defined_in_file}"
117
113
  report.add_message(:error, message, name, spec.version)
118
114
  end
119
115
  end
@@ -495,8 +495,8 @@ module Pod
495
495
  # @return [Nil] If the specification is not defined in a file.
496
496
  #
497
497
  def checksum
498
- require 'digest'
499
498
  unless defined_in_file.nil?
499
+ require 'digest'
500
500
  checksum = Digest::SHA1.hexdigest(File.read(defined_in_file))
501
501
  checksum = checksum.encode('UTF-8') if checksum.respond_to?(:encode)
502
502
  checksum
@@ -530,7 +530,7 @@ module Pod
530
530
  raise Informative, "No podspec exists at path `#{path}`."
531
531
  end
532
532
 
533
- string = File.open(path, 'r:utf-8') { |f| f.read }
533
+ string = File.open(path, 'r:utf-8', &:read)
534
534
  # Work around for Rubinius incomplete encoding in 1.9 mode
535
535
  if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
536
536
  string.encode!('UTF-8')
@@ -298,7 +298,7 @@ module Pod
298
298
  # prepare hook was defined.
299
299
  #
300
300
  def prepare_value(attr, value)
301
- if attr.container == Array
301
+ if attr.container == Array
302
302
  value = [*value].compact
303
303
  end
304
304
 
@@ -18,7 +18,8 @@ module Pod
18
18
  # @param [Symbol] platform @see platform
19
19
  #
20
20
  def initialize(spec, platform)
21
- @spec, @platform = spec, platform
21
+ @spec = spec
22
+ @platform = platform
22
23
  end
23
24
 
24
25
  # Defines a setter method for each attribute of the specification
@@ -185,7 +185,7 @@ module Pod
185
185
  # Performs validations related to the `name` attribute.
186
186
  #
187
187
  def _validate_name(name)
188
- if name =~ /\//
188
+ if name =~ %r{/}
189
189
  results.add_error('name', 'The name of a spec should not contain ' \
190
190
  'a slash.')
191
191
  end
@@ -316,7 +316,7 @@ module Pod
316
316
  if type.nil?
317
317
  results.add_warning('license', 'Missing license type.')
318
318
  end
319
- if type && type.gsub(' ', '').gsub("\n", '').empty?
319
+ if type && type.delete(' ').delete("\n").empty?
320
320
  results.add_warning('license', 'Invalid license type.')
321
321
  end
322
322
  if type && type =~ /\(example\)/
@@ -397,7 +397,7 @@ module Pod
397
397
  #
398
398
  def check_git_ssh_source(s)
399
399
  if git = s[:git]
400
- if git =~ /\w+\@(\w|\.)+\:(\/\w+)*/
400
+ if git =~ %r{\w+\@(\w|\.)+\:(/\w+)*}
401
401
  results.add_warning('source', 'Git SSH URLs will NOT work for ' \
402
402
  'people behind firewalls configured to only allow HTTP, ' \
403
403
  'therefore HTTPS is preferred.', true)
@@ -26,7 +26,7 @@ module Pod
26
26
  # @param [String] message @see message
27
27
  #
28
28
  def initialize(type, attribute_name, message, public_only = false)
29
- @type = type
29
+ @type = type
30
30
  @attribute_name = attribute_name
31
31
  @message = message
32
32
  @public_only = public_only
@@ -77,16 +77,16 @@ module Pod
77
77
 
78
78
  lines = contents.lines
79
79
  indent = ' # '
80
- indicator = indent.gsub('#', '>')
80
+ indicator = indent.tr('#', '>')
81
81
  first_line = (line_numer.zero?)
82
82
  last_line = (line_numer == (lines.count - 1))
83
83
 
84
84
  m << "\n"
85
85
  m << "#{indent}from #{trace_line.gsub(/:in.*$/, '')}\n"
86
86
  m << "#{indent}-------------------------------------------\n"
87
- m << "#{indent}#{ lines[line_numer - 1] }" unless first_line
88
- m << "#{indicator}#{ lines[line_numer] }"
89
- m << "#{indent}#{ lines[line_numer + 1] }" unless last_line
87
+ m << "#{indent}#{lines[line_numer - 1]}" unless first_line
88
+ m << "#{indicator}#{lines[line_numer]}"
89
+ m << "#{indent}#{lines[line_numer + 1]}" unless last_line
90
90
  m << "\n" unless m.end_with?("\n")
91
91
  m << "#{indent}-------------------------------------------\n"
92
92
  end
@@ -158,7 +158,8 @@ module Pod
158
158
  limit = [segments.size, other_segments.size].max
159
159
 
160
160
  (0..limit).each do |i|
161
- lhs, rhs = segments[i] || 0, other_segments[i] || 0
161
+ lhs = segments[i] || 0
162
+ rhs = other_segments[i] || 0
162
163
 
163
164
  next if lhs == rhs
164
165
  return lhs <=> rhs if lhs <=> rhs
@@ -55,12 +55,12 @@ module Pod
55
55
  #
56
56
  def load_string(yaml_string, file_path = nil)
57
57
  YAML.load(yaml_string)
58
- rescue
59
- if yaml_has_merge_error?(yaml_string)
60
- raise Informative, yaml_merge_conflict_msg(yaml_string, file_path)
61
- else
62
- raise Informative, yaml_parsing_error_msg(yaml_string, file_path)
63
- end
58
+ rescue
59
+ if yaml_has_merge_error?(yaml_string)
60
+ raise Informative, yaml_merge_conflict_msg(yaml_string, file_path)
61
+ else
62
+ raise Informative, yaml_parsing_error_msg(yaml_string, file_path)
63
+ end
64
64
  end
65
65
 
66
66
  # Loads a YAML file and leans on the #load_string imp
@@ -109,9 +109,21 @@ module Pod
109
109
  #
110
110
  def process_array(array)
111
111
  result = sorted_array(array).map do |array_value|
112
- process_according_to_class(array_value)
112
+ processed = process_according_to_class(array_value)
113
+ case array_value
114
+ when Array, Hash
115
+ if array_value.size > 1
116
+ processed = processed.gsub(/^.*/).to_a
117
+ head = processed.shift
118
+ processed.map { |s| " #{s}" }.prepend(head).join("\n")
119
+ else
120
+ processed
121
+ end
122
+ else
123
+ processed
124
+ end
113
125
  end
114
- "- #{result * "\n- "}"
126
+ "- #{result.join("\n- ").strip}"
115
127
  end
116
128
 
117
129
  # Converts a hash to YAML after sorting its keys. Optionally accepts a
@@ -136,7 +148,7 @@ module Pod
136
148
  processed = process_according_to_class(key_value)
137
149
  processed_key = process_according_to_class(key)
138
150
  case key_value
139
- when Array, Hash
151
+ when Hash, Array
140
152
  key_partial_yaml = processed.lines.map { |line| " #{line}" } * ''
141
153
  "#{processed_key}:\n#{key_partial_yaml}"
142
154
  else
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: 0.39.0.beta.5
4
+ version: 0.39.0.rc.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: 2015-10-01 00:00:00.000000000 Z
12
+ date: 2015-10-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport