cocoapods-core 1.0.0.beta.2 → 1.0.0.beta.3

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: 5c46c2b94d7609c8e8670ee44d014675305bbda0
4
- data.tar.gz: 7f3969b645f87aa6e328352014a8d873b63467cc
3
+ metadata.gz: 7613d5a3dbfbfd8dffb9d4c7994a1780ea3dd33b
4
+ data.tar.gz: 1ce8e16c31c7582cc9ebb33361ec626cce500c5e
5
5
  SHA512:
6
- metadata.gz: 734616dc29c304891a67a3d45c4f59dc5eb712a80ac02d25983d674e313a8ec69bb82ff853c99caf8571f01fd441036b6793e3eee6435edd1a9b06aa3930c6f0
7
- data.tar.gz: 768e07f278330b95cf658079a20e08b610c62fd72ebcc2864a9825d70b19ea7e7fc44f3444b5a53bfdfb5fdd7a4163afd271d9594195dc5683f9ca4c56376c8e
6
+ metadata.gz: 0e42ac029d73c53192a00efc00666a3868f6201e33d5725192f325e9fb57debfbe0a528a5c586b5beeb9395effe36a426bd61c64df3e8328a9f0639877303bcd
7
+ data.tar.gz: 35d2626af08e1ef52418e5c21b8e653ff450ff476317bbf4fa25ef7154206182e42edefc8107ebe1a0545b4150f3a0015528e29134fa030645ec965ff8847217
@@ -350,7 +350,7 @@ module Pod
350
350
  version = match_data[2]
351
351
  version = version.gsub(/[()]/, '') if version
352
352
  case version
353
- when ' HEAD'
353
+ when / HEAD( \(based on #{Pod::Version::VERSION_PATTERN}\))?/
354
354
  CoreUI.warn "Ignoring obsolete `HEAD` specifier in `#{string}`"
355
355
  Dependency.new(name)
356
356
  when nil, /from `(.*)(`|')/
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the cocoapods-core.
3
3
  #
4
- CORE_VERSION = '1.0.0.beta.2'.freeze unless defined? Pod::CORE_VERSION
4
+ CORE_VERSION = '1.0.0.beta.3'.freeze unless defined? Pod::CORE_VERSION
5
5
  end
@@ -9,6 +9,7 @@ module Pod
9
9
  #
10
10
  # A Podfile can be very simple:
11
11
  #
12
+ # target 'MyApp'
12
13
  # pod 'AFNetworking', '~> 1.0'
13
14
  #
14
15
  # An example of a more complex Podfile can be:
@@ -33,6 +34,39 @@ module Pod
33
34
  # end
34
35
  #
35
36
  module DSL
37
+ # @!group Root Options
38
+ # Configuration that applies to the Podfile as a whole.
39
+ #
40
+ # * `install!` declares the installation method and options to be used
41
+ # during installation.
42
+
43
+ # Specifies the installation method to be used when CocoaPods installs
44
+ # this Podfile.
45
+ #
46
+ # @param [String] installation_method
47
+ # the name of the installation strategy.
48
+ #
49
+ # @param [Hash] options
50
+ # the installation options.
51
+ #
52
+ # @example Specifying custom CocoaPods installation options
53
+ #
54
+ # install! 'cocoapods',
55
+ # :deterministic_uuids => false,
56
+ # :integrate_targets => false
57
+ #
58
+ # @return [void]
59
+ #
60
+ def install!(installation_method, options = {})
61
+ unless current_target_definition.root?
62
+ raise Informative, 'The installation method can only be set at the root level of the Podfile.'
63
+ end
64
+
65
+ set_hash_value('installation_method', 'name' => installation_method, 'options' => options)
66
+ end
67
+
68
+ #-----------------------------------------------------------------------#
69
+
36
70
  # @!group Dependencies
37
71
  # The Podfile specifies the dependencies of each user target.
38
72
  #
@@ -246,8 +280,7 @@ module Pod
246
280
  # pod 'SSZipArchive'
247
281
  # end
248
282
  #
249
- # @example Defining a test target which can access SSZipArchive via Pods
250
- # for it's parent target.
283
+ # @example Defining a test target accessing SSZipArchive pod from its parent
251
284
  #
252
285
  # target "ZipApp" do
253
286
  # pod 'SSZipArchive'
@@ -258,8 +291,7 @@ module Pod
258
291
  # end
259
292
  # end
260
293
  #
261
- # @example Defining a target applies Pods to multiple targets via its
262
- # parent target
294
+ # @example Defining a target applies Pods to multiple targets via its parent target
263
295
  #
264
296
  # target "ShowsApp" do
265
297
  # pod 'ShowsKit'
@@ -358,7 +390,8 @@ module Pod
358
390
 
359
391
  # Sets the inheritance mode for the current target.
360
392
  #
361
- # @param [:complete, :none, :search_paths] the inheritance mode to set.
393
+ # @param [:complete, :none, :search_paths] inheritance
394
+ # the inheritance mode to set.
362
395
  #
363
396
  # @example Inheriting only search paths
364
397
  #
@@ -374,35 +407,10 @@ module Pod
374
407
  current_target_definition.inheritance = inheritance
375
408
  end
376
409
 
377
- # Specifies the installation method to be used when CocoaPods installs
378
- # this Podfile.
379
- #
380
- # @param [String] installation_method
381
- # the name of the installation strategy.
382
- #
383
- # @param [Hash] options
384
- # the installation options.
385
- #
386
- # @example Specifying custom CocoaPods installation options
387
- #
388
- # install! 'cocoapods',
389
- # :deterministic_uuids => false,
390
- # :integrate_targets => false
391
- #
392
- # @return [void]
393
- #
394
- def install!(installation_method, options = {})
395
- unless current_target_definition.root?
396
- raise Informative, 'The installation method can only be set at the root level of the Podfile.'
397
- end
398
-
399
- set_hash_value('installation_method', 'name' => installation_method, 'options' => options)
400
- end
401
-
402
410
  #-----------------------------------------------------------------------#
403
411
 
404
412
  # @!group Target configuration
405
- # These settings are used to control the CocoaPods generated project.
413
+ # These settings are used to control the CocoaPods generated project.
406
414
  #
407
415
  # This starts out simply with stating what `platform` you are working
408
416
  # on. `xcodeproj` allows you to state specifically which project to
@@ -470,27 +478,39 @@ module Pod
470
478
  #
471
479
  # # This Target can be found in a Xcode project called `FastGPS`
472
480
  # target "MyGPSApp" do
473
- # xcodeproj 'FastGPS'
481
+ # project 'FastGPS'
474
482
  # ...
475
483
  # end
476
484
  #
477
485
  # # Same Podfile, multiple Xcodeprojects
478
486
  # target "MyNotesApp" do
479
- # xcodeproj 'FastNotes'
487
+ # project 'FastNotes'
480
488
  # ...
481
489
  # end
482
490
  #
483
491
  # @example Using custom build configurations
484
492
  #
485
- # xcodeproj 'TestProject', 'Mac App Store' => :release, 'Test' => :debug
493
+ # project 'TestProject', 'Mac App Store' => :release, 'Test' => :debug
486
494
  #
487
495
  # @return [void]
488
496
  #
489
- def xcodeproj(path, build_configurations = {})
497
+ def project(path, build_configurations = {})
490
498
  current_target_definition.user_project_path = path
491
499
  current_target_definition.build_configurations = build_configurations
492
500
  end
493
501
 
502
+ # @!visibility private
503
+ #
504
+ # @deprecated #{xcodeproj} was renamed to #{project}.
505
+ #
506
+ # TODO: This method can be deleted once people have migrated to this 1.0
507
+ # DSL.
508
+ #
509
+ def xcodeproj(*args)
510
+ CoreUI.warn 'xcodeproj was renamed to `project`. Please use that from now on.'
511
+ project(*args)
512
+ end
513
+
494
514
  # @!visibility private
495
515
  #
496
516
  # @deprecated linking a single target with multiple Xcode targets is no
@@ -516,6 +536,11 @@ module Pod
516
536
  #
517
537
  # pod 'SSZipArchive', :inhibit_warnings => true
518
538
  #
539
+ # Additionally, when you use `inhibit_all_warnings!` attribute,
540
+ # you can exclude a particular Pod from being inhibited using the following:
541
+ #
542
+ # pod 'SSZipArchive', :inhibit_warnings => false
543
+ #
519
544
  def inhibit_all_warnings!
520
545
  current_target_definition.inhibit_all_warnings = true
521
546
  end
@@ -284,7 +284,9 @@ module Pod
284
284
  # return true for any asked pod.
285
285
  #
286
286
  def inhibits_warnings_for_pod?(pod_name)
287
- if raw_inhibit_warnings_hash['all']
287
+ if Array(inhibit_warnings_hash['not_for_pods']).include?(pod_name)
288
+ false
289
+ elsif inhibit_warnings_hash['all']
288
290
  true
289
291
  elsif !root? && parent.inhibits_warnings_for_pod?(pod_name)
290
292
  true
@@ -307,14 +309,27 @@ module Pod
307
309
 
308
310
  # Inhibits warnings for a specific pod during compilation.
309
311
  #
310
- # @param [String] pod name
311
- # Whether the warnings should be suppressed.
312
+ # @param [String] pod_name
313
+ # Name of the pod for which the warnings will be inhibited or not.
314
+ #
315
+ # @param [Bool] should_inhibit
316
+ # Whether the warnings should be inhibited or not for given pod.
312
317
  #
313
318
  # @return [void]
314
319
  #
315
- def inhibit_warnings_for_pod(pod_name)
316
- raw_inhibit_warnings_hash['for_pods'] ||= []
317
- raw_inhibit_warnings_hash['for_pods'] << pod_name
320
+ def set_inhibit_warnings_for_pod(pod_name, should_inhibit)
321
+ hash_key = case should_inhibit
322
+ when true
323
+ 'for_pods'
324
+ when false
325
+ 'not_for_pods'
326
+ when nil
327
+ return
328
+ else
329
+ raise ArgumentError, "Got `#{should_inhibit.inspect}`, should be a boolean"
330
+ end
331
+ raw_inhibit_warnings_hash[hash_key] ||= []
332
+ raw_inhibit_warnings_hash[hash_key] << pod_name
318
333
  end
319
334
 
320
335
  #--------------------------------------#
@@ -622,7 +637,8 @@ module Pod
622
637
  unless HASH_KEYS.include?(key)
623
638
  raise StandardError, "Unsupported hash key `#{key}`"
624
639
  end
625
- internal_hash[key] ||= base_value
640
+ internal_hash[key] = base_value if internal_hash[key].nil?
641
+ internal_hash[key]
626
642
  end
627
643
 
628
644
  def raw_inhibit_warnings_hash
@@ -633,14 +649,28 @@ module Pod
633
649
  # Returns the inhibit_warnings hash pre-populated with default values.
634
650
  #
635
651
  # @return [Hash<String, Array>] Hash with :all key for inhibiting all
636
- # warnings, and :for_pods key for inhibiting warnings per Pod.
652
+ # warnings, :for_pods key for inhibiting warnings per Pod,
653
+ # and :not_for_pods key for not inhibiting warnings per Pod.
637
654
  #
638
655
  def inhibit_warnings_hash
639
656
  inhibit_hash = raw_inhibit_warnings_hash
640
657
  if exclusive?
641
658
  inhibit_hash
642
659
  else
643
- parent.send(:inhibit_warnings_hash).merge(inhibit_hash) { |l, r| (l + r).uniq }
660
+ parent_hash = parent.send(:inhibit_warnings_hash).dup
661
+ if parent_hash['not_for_pods']
662
+ # Remove pods that are set to not inhibit inside parent if they are set to inhibit inside current target.
663
+ parent_hash['not_for_pods'] -= Array(inhibit_hash['for_pods'])
664
+ end
665
+ if parent_hash['for_pods']
666
+ # Remove pods that are set to inhibit inside parent if they are set to not inhibit inside current target.
667
+ parent_hash['for_pods'] -= Array(inhibit_hash['for_pods'])
668
+ end
669
+ if inhibit_hash['all']
670
+ # Clean pods that are set to not inhibit inside parent if inhibit_all_warnings! was set.
671
+ parent_hash['not_for_pods'] = nil
672
+ end
673
+ parent_hash.merge(inhibit_hash) { |_, l, r| (l + r).uniq }
644
674
  end
645
675
  end
646
676
 
@@ -747,7 +777,8 @@ module Pod
747
777
  return requirements unless options.is_a?(Hash)
748
778
 
749
779
  should_inhibit = options.delete(:inhibit_warnings)
750
- inhibit_warnings_for_pod(Specification.root_name name) if should_inhibit
780
+ pod_name = Specification.root_name(name)
781
+ set_inhibit_warnings_for_pod(pod_name, should_inhibit)
751
782
 
752
783
  requirements.pop if options.empty?
753
784
  end
@@ -292,7 +292,7 @@ module Pod
292
292
  # rubocop:enable Eval
293
293
  rescue Exception => e
294
294
  message = "Invalid `#{path.basename}` file: #{e.message}"
295
- raise DSLError.new(message, path, e.backtrace, contents)
295
+ raise DSLError.new(message, path, e, contents)
296
296
  end
297
297
  # rubocop:enable Lint/RescueException
298
298
  end
@@ -618,6 +618,6 @@ module Pod
618
618
  rescue Exception => e
619
619
  # rubocop:enable Lint/RescueException
620
620
  message = "Invalid `#{path.basename}` file: #{e.message}"
621
- raise DSLError.new(message, path, e.backtrace, string)
621
+ raise DSLError.new(message, path, e, string)
622
622
  end
623
623
  end
@@ -17,19 +17,19 @@ module Pod
17
17
  #
18
18
  attr_reader :dsl_path
19
19
 
20
- # @return [Exception] the backtrace of the exception raised by the
20
+ # @return [Exception] the exception raised by the
21
21
  # evaluation of the dsl file.
22
22
  #
23
- attr_reader :backtrace
23
+ attr_reader :underlying_exception
24
24
 
25
- # @param [Exception] backtrace @see backtrace
25
+ # @param [Exception] underlying_exception @see underlying_exception
26
26
  # @param [String] dsl_path @see dsl_path
27
27
  #
28
- def initialize(description, dsl_path, backtrace, contents = nil)
29
- @description = description
30
- @dsl_path = dsl_path
31
- @backtrace = backtrace
32
- @contents = contents
28
+ def initialize(description, dsl_path, underlying_exception, contents = nil)
29
+ @description = description
30
+ @dsl_path = dsl_path
31
+ @underlying_exception = underlying_exception
32
+ @contents = contents
33
33
  end
34
34
 
35
35
  # @return [String] the contents of the DSL that cause the exception to
@@ -63,11 +63,10 @@ module Pod
63
63
  @message ||= begin
64
64
  trace_line, description = parse_line_number_from_description
65
65
 
66
- m = "\n[!] "
67
- m << description
68
- m << ". Updating CocoaPods might fix the issue.\n"
66
+ m = "\n[!] #{description}.\n"
69
67
  m = m.red if m.respond_to?(:red)
70
68
 
69
+ backtrace = underlying_exception.backtrace
71
70
  return m unless backtrace && dsl_path && contents
72
71
 
73
72
  trace_line = backtrace.find { |l| l.include?(dsl_path.to_s) } || trace_line
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.0.0.beta.2
4
+ version: 1.0.0.beta.3
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: 2016-01-05 00:00:00.000000000 Z
12
+ date: 2016-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubyforge_project:
140
- rubygems_version: 2.5.1
140
+ rubygems_version: 2.5.2
141
141
  signing_key:
142
142
  specification_version: 3
143
143
  summary: The models of CocoaPods