cocoapods-core 0.19.1 → 0.20.0

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: c78a14e3df06815c25e8e063f05e1cc004e5609e
4
- data.tar.gz: b12b77b615e9e696898af673e1c9551d7b1009b4
3
+ metadata.gz: 94c9b71988632829dff6d7853a7d1f39b16e812d
4
+ data.tar.gz: 6b8a89122bfee97fafb3f005f3f6a3a8f59d40e7
5
5
  SHA512:
6
- metadata.gz: b00127a405e14efb508dee563e5a3e6a2008b84f72322b0191e09975bc5d0d9328e50da041f65c01d410b4e39b3798941014f9781cefe1cb918c6795371dd8eb
7
- data.tar.gz: de882d36c17f5f71c7c7fb4aa84b27d164f669cfccfd51ba9ac98d0ca31215175b66c4fecca76b112a222549d4e4e25381ae21185532927a722e63d6a6ba1bb1
6
+ metadata.gz: 803bca5479af6a508dd19327aec6a29806f25d83725b0a5095019ab5bcc9db2c61d96d5ecd2c9a05c7057a0dbc01659da6a839aa851bc0db354ca9968d7c71c3
7
+ data.tar.gz: 40565670aae75805ac2461e22ae9ee840489b5bea51bca7f25ab7b7a87bca8cd2aadae74207ccc1599148d3e3712844f2ede2bec6e5585c0409bc0cf3e7c093b
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/CocoaPods/Core.png?branch=master)](https://travis-ci.org/CocoaPods/Core)
4
4
  [![Coverage Status](https://coveralls.io/repos/CocoaPods/Core/badge.png?branch=master)](https://coveralls.io/r/CocoaPods/Core)
5
+ [![Code Climate](https://codeclimate.com/github/CocoaPods/Core.png)](https://codeclimate.com/github/CocoaPods/Core)
5
6
 
6
7
  The CocoaPods-Core gem provides support to work with the models of CocoaPods.
7
8
  It is intended to be used in place of the CocoaPods when the installation
@@ -2,5 +2,5 @@ module Pod
2
2
 
3
3
  # The version of the cocoapods-core.
4
4
  #
5
- CORE_VERSION = '0.19.1' unless defined? Pod::CORE_VERSION
5
+ CORE_VERSION = '0.20.0' unless defined? Pod::CORE_VERSION
6
6
  end
@@ -89,10 +89,10 @@ module Pod
89
89
  # Dependencies can be obtained also from external sources.
90
90
  #
91
91
  #
92
- # ### Using the files from a folder local to the machine.
92
+ # ### Using the files from a local path.
93
93
  #
94
94
  # If you wold like to use develop a Pod in tandem with its client
95
- # project you can use the `local` option.
95
+ # project you can use the `path` option.
96
96
  #
97
97
  # pod 'AFNetworking', :path => '~/Documents/AFNetworking'
98
98
  #
@@ -272,7 +272,7 @@ module Pod
272
272
  # return true for any asked pod.
273
273
  #
274
274
  def inhibits_warnings_for_pod?(pod_name)
275
- return true if inhibit_warnings_hash['all'] || (parent.inhibits_warnings_for_pod?(name) unless root?)
275
+ return true if inhibit_warnings_hash['all'] || (parent.inhibits_warnings_for_pod?(pod_name) unless root?)
276
276
 
277
277
  inhibit_warnings_hash['for_pods'] ||= []
278
278
  inhibit_warnings_hash['for_pods'].include? pod_name
@@ -30,7 +30,7 @@ module Pod
30
30
  def analyze(spec, previous_spec = nil)
31
31
  errors = []
32
32
  check_spec_source_change(spec, errors)
33
- check_if_untagged_version_is_acceptable(spec, errors)
33
+ check_if_untagged_version_is_acceptable(spec, previous_spec, errors)
34
34
  check_commit_change_for_untagged_version(spec, previous_spec, errors)
35
35
  check_dependencies(spec, errors)
36
36
  errors
@@ -81,9 +81,10 @@ module Pod
81
81
  #
82
82
  # @return [void]
83
83
  #
84
- def check_if_untagged_version_is_acceptable(spec, errors)
84
+ def check_if_untagged_version_is_acceptable(spec, previous_spec, errors)
85
85
  return if !spec.source[:git] || spec.source[:tag]
86
86
  return unless related_specifications(spec)
87
+ return if previous_spec
87
88
  has_tagged_spec = related_specifications(spec).any? { |s| s.version != '0.0.1' }
88
89
  if has_tagged_spec
89
90
  errors << "There is already at least one versioned specification so " \
@@ -212,12 +212,12 @@ module Pod
212
212
  #
213
213
  # @example Specifying a Git source with a tag.
214
214
  #
215
- # spec.source = { :git => "git://github.com/AFNetworking/AFNetworking.git",
215
+ # spec.source = { :git => 'git://github.com/AFNetworking/AFNetworking.git',
216
216
  # :tag => 'v0.0.1' }
217
217
  #
218
218
  # @example Using the version of the Pod to identify the Git tag.
219
219
  #
220
- # spec.source = { :git => "git://github.com/AFNetworking/AFNetworking.git",
220
+ # spec.source = { :git => 'git://github.com/AFNetworking/AFNetworking.git',
221
221
  # :tag => "v#{spec.version}" }
222
222
  #
223
223
  # @param [Hash{Symbol=>String}] source
@@ -945,6 +945,8 @@ module Pod
945
945
  # for each Pods library and only for installations where the Pod is
946
946
  # installed.
947
947
  #
948
+ # This hook should be used to generate and modify the files of the Pod.
949
+ #
948
950
  # It receives the
949
951
  # [`Pod::Hooks::PodRepresentation`](http://docs.cocoapods.org/cocoapods/pod/hooks/podrepresentation/)
950
952
  # and the
@@ -968,6 +970,9 @@ module Pod
968
970
  # been generated. Note that this hook is called for each Pods library and
969
971
  # only for installations where the Pod is installed.
970
972
  #
973
+ # To modify and generate files for the Pod the pre install hook should be
974
+ # used instead of this one.
975
+ #
971
976
  # It receives a
972
977
  # [`Pod::Hooks::LibraryRepresentation`](http://docs.cocoapods.org/cocoapods/pod/hooks/libraryrepresentation/)
973
978
  # instance for the current target.
@@ -191,7 +191,7 @@ module Pod
191
191
  #
192
192
  def _validate_name(n)
193
193
  if spec.name && file
194
- names_match = (file.basename.to_s == spec.root.name + '.podspec')
194
+ names_match = (file.basename.to_s == spec.root.name + '.podspec') || (file.basename.to_s == spec.root.name + '.podspec.yaml')
195
195
  unless names_match
196
196
  error "The name of the spec should match the name of the file."
197
197
  end
@@ -57,13 +57,13 @@ module Pod
57
57
  #
58
58
  # @return [Specification] the specification
59
59
  #
60
- def self.from_hash(hash)
61
- spec = Spec.new
60
+ def self.from_hash(hash, parent = nil)
61
+ spec = Spec.new(parent)
62
62
  attributes_hash = hash.dup
63
63
  subspecs = attributes_hash.delete('subspecs')
64
64
  spec.attributes_hash = attributes_hash
65
65
  if subspecs
66
- spec.subspecs = subspecs.map { |s_hash| Specification.from_hash(s_hash) }
66
+ spec.subspecs = subspecs.map { |s_hash| Specification.from_hash(s_hash, spec) }
67
67
  end
68
68
  spec
69
69
  end
@@ -532,14 +532,35 @@ module Pod
532
532
  raise Informative, "No podspec exists at path `#{path}`."
533
533
  end
534
534
 
535
+ string = File.open(path, 'r:utf-8') { |f| f.read }
536
+ # Work around for Rubinius incomplete encoding in 1.9 mode
537
+ if string.respond_to?(:encoding) && string.encoding.name != "UTF-8"
538
+ string.encode!('UTF-8')
539
+ end
540
+
541
+ from_string(string, path, subspec_name)
542
+ end
543
+
544
+ # Loads a specification with the given string.
545
+ #
546
+ # @param [String] spec_contents
547
+ # A string describing a specification.
548
+ #
549
+ # @param [Pathname, String] path @see from_file
550
+ # @param [String] subspec_name @see from_file
551
+ #
552
+ # @return [Specification] the specification
553
+ #
554
+ def self.from_string(spec_contents, path, subspec_name = nil)
555
+ path = Pathname.new(path)
535
556
  case path.extname
536
557
  when '.podspec'
537
- spec = ::Pod._eval_podspec(path)
558
+ spec = ::Pod._eval_podspec(spec_contents, path)
538
559
  unless spec.is_a?(Specification)
539
560
  raise Informative, "Invalid podspec file at path `#{path}`."
540
561
  end
541
562
  when '.yaml'
542
- spec = Specification.from_yaml(path.read)
563
+ spec = Specification.from_yaml(spec_contents)
543
564
  else
544
565
  raise Informative, "Unsupported specification format `#{path.extname}`."
545
566
  end
@@ -567,20 +588,22 @@ module Pod
567
588
 
568
589
  #---------------------------------------------------------------------------#
569
590
 
570
- # Evaluates the file at the given path in the namespace of the Pod module.
591
+ # @visibility private
592
+ #
593
+ # Evaluates the given string in the namespace of the Pod module.
594
+ #
595
+ # @param [String] string
596
+ # The string containing the Ruby description of the Object to
597
+ # evaluate.
598
+ #
599
+ # @param [Pathname] path
600
+ # The path where the object to evaluate is stored.
571
601
  #
572
602
  # @return [Object] it can return any object but, is expected to be called on
573
603
  # `podspec` files that should return a #{Specification}.
574
604
  #
575
- # @private
576
605
  #
577
- def self._eval_podspec(path)
578
- string = File.open(path, 'r:utf-8') { |f| f.read }
579
- # Work around for Rubinius incomplete encoding in 1.9 mode
580
- if string.respond_to?(:encoding) && string.encoding.name != "UTF-8"
581
- string.encode!('UTF-8')
582
- end
583
-
606
+ def self._eval_podspec(string, path)
584
607
  begin
585
608
  eval(string, nil, path.to_s)
586
609
  rescue Exception => e
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.19.1
4
+ version: 0.20.0
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: 2013-04-30 00:00:00.000000000 Z
12
+ date: 2013-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport