cocoapods 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,22 @@
1
- ## 0.11.1 (Unreleased)
1
+ ## 0.12.0
2
2
 
3
- [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.0...master)
3
+ [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.1...0.12.0)
4
+
5
+ ###### Enhancements
6
+
7
+ - The documentation is generated using the public headers if they are specified.
8
+ - In case of a download failure the installation is aborted and the error message is shown.
9
+ - Git submodules are initialized only if requested.
10
+ - Don’t impose a certain structure of the user’s project by raising if no ‘Frameworks’ group exists. [#431](https://github.com/CocoaPods/CocoaPods/pull/431)
11
+ - Support for GitHub Gists in the linter.
12
+ - Allow specifying ARC settings in subspecs.
13
+ - Add Podfile#inhibit_all_warnings! which will inhibit all warnings from the Pods library. [#209](https://github.com/CocoaPods/CocoaPods/issues/209)
14
+ - Make the Pods Xcode project prettier by namespacing subspecs in nested groups. [#466](https://github.com/CocoaPods/CocoaPods/pull/466)
15
+
16
+
17
+ ## 0.11.1
18
+
19
+ [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.11.0...0.11.1)
4
20
 
5
21
  ###### Bug fixes
6
22
 
@@ -8,6 +24,7 @@
8
24
  - Git submodules are loaded after the appropriate referenced is checked out and will be not loaded anymore in the cache. [#451]
9
25
  - Fixed SVN support for the head version. [#432]
10
26
 
27
+
11
28
  ## 0.11.0
12
29
 
13
30
  [CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.10.0...0.11.0)
@@ -16,7 +33,7 @@
16
33
 
17
34
  - Added support for public headers. [#440]
18
35
  - Added `pod repo lint`. [#423]
19
- - Improved support for `:head` option and svn repositories.
36
+ - Improved support for `:head` option and SVN repositories.
20
37
  - When integrating Pods with a project without "Frameworks" group in root of the project, raise an informative message. [#431](https://github.com/CocoaPods/CocoaPods/pull/431)
21
38
  - Dropped support for legacy `config.ios?` and `config.osx?`
22
39
 
@@ -25,6 +42,7 @@
25
42
  - Version message now correctly terminates with a 0 exit status.
26
43
  - Resolved an issue that lead to git error messages in the error report.
27
44
 
45
+
28
46
  ## 0.10.0
29
47
 
30
48
  [CocoaPods](http://git.io/4i75YA)
@@ -35,7 +53,6 @@
35
53
  - Added line number information for errors generated in the Podfile. [#408](http://git.io/fWQvMg)
36
54
  - Pods stored in git repositories now initialize submodules. [#406](http://git.io/L9ssSw)
37
55
 
38
-
39
56
  ###### Bug fixes
40
57
 
41
58
  - Removed note about the post install hook form the linter.
@@ -232,7 +249,7 @@ class ::Pod::Generator::Acknowledgements
232
249
  end
233
250
  ```
234
251
 
235
- You can even go one step further and customise the text on a per target basis by
252
+ You can even go one step further and customise the text on a per target basis by
236
253
  checking against the target name, like this:
237
254
 
238
255
  ```ruby
@@ -338,8 +355,6 @@ podspec, then update these method calls.
338
355
  * Added weak quoting to `ibtool` input paths.
339
356
 
340
357
 
341
- ---------------------------------------
342
-
343
358
  ## 0.5.0
344
359
 
345
360
  No longer requires MacRuby. Runs on MRI 1.8.7 (OS X system version) and 1.9.3.
@@ -347,15 +362,11 @@ No longer requires MacRuby. Runs on MRI 1.8.7 (OS X system version) and 1.9.3.
347
362
  A full list of all the changes since 0.3.0 can be found [here][7].
348
363
 
349
364
 
350
- ---------------------------------------
351
-
352
365
  ## 0.4.0
353
366
 
354
367
  Oops, accidentally skipped this version.
355
368
 
356
369
 
357
- ---------------------------------------
358
-
359
370
  ## 0.3.0
360
371
 
361
372
  ### Multiple targets
data/README.md CHANGED
@@ -15,7 +15,7 @@ You specify the dependencies for your project in one easy text file. CocoaPods r
15
15
 
16
16
  Ultimately, the goal is to improve discoverability of, and engagement in, third party open-source libraries, by creating a more centralized ecosystem.
17
17
 
18
- See the [NSScreencast episode about CocoaPods](http://nsscreencast.com/episodes/5-cocoapods) for a quick overview on how to get started, or [the wiki](https://github.com/CocoaPods/CocoaPods/wiki) for more in depth information on several topics.
18
+ See the [NSScreencast](https://twitter.com/NSScreencast) episode about [using CocoaPods](http://nsscreencast.com/episodes/5-cocoapods) for a quick overview on how to get started or [create a Pod specification](http://nsscreencast.com/episodes/28-creating-a-cocoapod), or [the wiki](https://github.com/CocoaPods/CocoaPods/wiki) for more in depth information on several topics.
19
19
 
20
20
  Or, if you’re already using CocoaPods, you can find the changelog [here](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md), which contains an overview of the changes in recent versions.
21
21
 
@@ -13,7 +13,7 @@ unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(
13
13
  end
14
14
 
15
15
  module Pod
16
- VERSION = '0.11.1'
16
+ VERSION = '0.12.0'
17
17
 
18
18
  class PlainInformative < StandardError
19
19
  end
@@ -225,15 +225,17 @@ module Pod
225
225
  messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/
226
226
  messages << "The summary should end with a dot" if spec.summary !~ /.*\./
227
227
  messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
228
- messages << "Git sources should specify either a tag or a commit" if source[:git] && !source[:commit] && !source[:tag]
229
- messages << "Github repositories should end in `.git'" if github_source? && source[:git] !~ /.*\.git/
230
- messages << "Github repositories should use `https' link" if github_source? && source[:git] !~ /https:\/\/github.com/
231
228
  messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24
232
- messages
233
- end
234
229
 
235
- def github_source?
236
- spec.source && spec.source[:git] =~ /github.com/
230
+ if (git_source = source[:git])
231
+ messages << "Git sources should specify either a tag or a commit" unless source[:commit] || source[:tag]
232
+ if git_source.include?('github.com')
233
+ messages << "Github repositories should end in `.git'" unless git_source.end_with?('.git')
234
+ messages << "Github repositories should use `https' link" unless git_source.start_with?('https://github.com') || git_source.start_with?('git://gist.github.com')
235
+ end
236
+ end
237
+
238
+ messages
237
239
  end
238
240
 
239
241
  # It creates a podfile in memory and builds a library containing
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/array/conversions'
2
+
1
3
  module Pod
2
4
  class Command
3
5
  class Presenter
@@ -27,7 +29,7 @@ module Pod
27
29
  end
28
30
 
29
31
  def authors
30
- oxfordify spec.authors.keys
32
+ spec.authors.keys.to_sentence
31
33
  end
32
34
 
33
35
  def homepage
@@ -89,13 +91,6 @@ module Pod
89
91
  end
90
92
 
91
93
  private
92
- def oxfordify words
93
- if words.size < 3
94
- words.join ' and '
95
- else
96
- "#{words[0..-2].join(', ')}, and #{words.last}"
97
- end
98
- end
99
94
 
100
95
  def distance_from_now_in_words(from_time)
101
96
  return nil unless from_time
@@ -14,6 +14,7 @@ module Pod
14
14
  def download
15
15
  create_cache unless cache_exist?
16
16
  puts '-> Cloning git repo' if config.verbose?
17
+
17
18
  if options[:tag]
18
19
  download_tag
19
20
  elsif options[:branch]
@@ -23,6 +24,8 @@ module Pod
23
24
  else
24
25
  download_head
25
26
  end
27
+
28
+ Dir.chdir(target_path) { git! "submodule update --init" } if options[:submodules]
26
29
  prune_cache
27
30
  end
28
31
 
@@ -30,7 +33,7 @@ module Pod
30
33
  puts "-> Creating cache git repo (#{cache_path})" if config.verbose?
31
34
  cache_path.rmtree if cache_path.exist?
32
35
  cache_path.mkpath
33
- git %Q|clone "#{url}" "#{cache_path}"|
36
+ clone(url, cache_path)
34
37
  end
35
38
 
36
39
  def prune_cache
@@ -73,10 +76,9 @@ module Pod
73
76
  def update_cache
74
77
  puts "-> Updating cache git repo (#{cache_path})" if config.verbose?
75
78
  Dir.chdir(cache_path) do
76
- git "reset --hard HEAD"
77
- git "clean -d -x -f"
78
- git "pull"
79
- git "submodule update"
79
+ git! "reset --hard HEAD"
80
+ git! "clean -d -x -f"
81
+ git! "pull origin master"
80
82
  end
81
83
  end
82
84
 
@@ -104,42 +106,44 @@ module Pod
104
106
  else
105
107
  create_cache
106
108
  end
107
- git %Q|clone "#{clone_url}" "#{target_path}"|
108
- Dir.chdir(target_path) { git "submodule update --init" }
109
+
110
+ clone(clone_url, target_path)
111
+ Dir.chdir(target_path) { git! "submodule update --init" } if options[:submodules]
109
112
  end
110
113
 
111
114
  def download_tag
112
115
  ensure_ref_exists(options[:tag])
113
116
  Dir.chdir(target_path) do
114
- git "init"
115
- git "remote add origin '#{clone_url}'"
116
- git "fetch origin tags/#{options[:tag]}"
117
- git "reset --hard FETCH_HEAD"
118
- git "checkout -b activated-pod-commit"
119
- git "submodule update --init"
117
+ git! "init"
118
+ git! "remote add origin '#{clone_url}'"
119
+ git! "fetch origin tags/#{options[:tag]}"
120
+ git! "reset --hard FETCH_HEAD"
121
+ git! "checkout -b activated-pod-commit"
120
122
  end
121
123
  end
122
124
 
123
125
  def download_commit
124
126
  ensure_ref_exists(options[:commit])
125
- git %Q|clone "#{clone_url}" "#{target_path}"|
127
+ clone(clone_url, target_path)
126
128
  Dir.chdir(target_path) do
127
- git "checkout -b activated-pod-commit #{options[:commit]}"
128
- git "submodule update --init"
129
+ git! "checkout -b activated-pod-commit #{options[:commit]}"
129
130
  end
130
131
  end
131
132
 
132
133
  def download_branch
133
134
  ensure_remote_branch_exists(options[:branch])
134
- git %Q|clone "#{clone_url}" "#{target_path}"|
135
+ clone(clone_url, target_path)
135
136
  Dir.chdir(target_path) do
136
- git "remote add upstream '#{@url}'" # we need to add the original url, not the cache url
137
- git "fetch -q upstream" # refresh the branches
138
- git "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch
139
- git "submodule update --init"
137
+ git! "remote add upstream '#{@url}'" # we need to add the original url, not the cache url
138
+ git! "fetch -q upstream" # refresh the branches
139
+ git! "checkout --track -b activated-pod-commit upstream/#{options[:branch]}" # create a new tracking branch
140
140
  puts "Just downloaded and checked out branch: #{options[:branch]} from upstream #{clone_url}" if config.verbose?
141
141
  end
142
142
  end
143
+
144
+ def clone(from, to)
145
+ git! %Q|clone "#{from}" "#{to}"|
146
+ end
143
147
  end
144
148
 
145
149
  class GitHub < Git
@@ -52,17 +52,17 @@ module Pod
52
52
  end
53
53
 
54
54
  def download_file(full_filename)
55
- curl "-L -o '#{full_filename}' '#{url}'"
55
+ curl! "-L -o '#{full_filename}' '#{url}'"
56
56
  end
57
57
 
58
58
  def extract_with_type(full_filename, type=:zip)
59
59
  case type
60
60
  when :zip
61
- unzip "'#{full_filename}' -d '#{target_path}'"
61
+ unzip! "'#{full_filename}' -d '#{target_path}'"
62
62
  when :tgz
63
- tar "xfz '#{full_filename}' -C '#{target_path}'"
63
+ tar! "xfz '#{full_filename}' -C '#{target_path}'"
64
64
  when :tar
65
- tar "xf '#{full_filename}' -C '#{target_path}'"
65
+ tar! "xf '#{full_filename}' -C '#{target_path}'"
66
66
  else
67
67
  raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
68
68
  end
@@ -12,11 +12,11 @@ module Pod
12
12
  end
13
13
 
14
14
  def download_head
15
- hg "clone \"#{url}\" \"#{target_path}\""
15
+ hg! "clone \"#{url}\" \"#{target_path}\""
16
16
  end
17
17
 
18
18
  def download_revision
19
- hg "clone \"#{url}\" --rev '#{options[:revision]}' \"#{target_path}\""
19
+ hg! "clone \"#{url}\" --rev '#{options[:revision]}' \"#{target_path}\""
20
20
  end
21
21
  end
22
22
  end
@@ -4,11 +4,11 @@ module Pod
4
4
  executable :svn
5
5
 
6
6
  def download
7
- svn %|checkout "#{reference_url}" "#{target_path}"|
7
+ svn! %|checkout "#{reference_url}" "#{target_path}"|
8
8
  end
9
9
 
10
10
  def download_head
11
- svn %|checkout "#{trunk_url}" "#{target_path}"|
11
+ svn! %|checkout "#{trunk_url}" "#{target_path}"|
12
12
  end
13
13
 
14
14
  def reference_url
@@ -20,7 +20,8 @@ module Pod
20
20
 
21
21
  def executable(name)
22
22
  bin = `which #{name}`.strip
23
- define_method(name) do |command|
23
+ base_method = "base_" << name.to_s
24
+ define_method(base_method) do |command, should_raise|
24
25
  if bin.empty?
25
26
  raise Informative, "Unable to locate the executable `#{name}'"
26
27
  end
@@ -33,9 +34,27 @@ module Pod
33
34
  end
34
35
  status = Open4.spawn(full_command, :stdout => stdout, :stderr => stderr, :status => true)
35
36
  # TODO not sure that we should be silent in case of a failure.
36
- puts (Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red unless status.success? || Config.instance.silent?
37
- stdout.join("\n") + stderr.join("\n") # TODO will this suffice?
37
+
38
+ output = stdout.join("\n") + stderr.join("\n") # TODO will this suffice?
39
+ unless status.success?
40
+ if should_raise
41
+ raise Informative, "#{name} #{command}\n\n#{output}"
42
+ else
43
+ puts (Config.instance.verbose? ? ' ' : '') << "[!] Failed: #{full_command}".red unless Config.instance.silent?
44
+ end
45
+ end
46
+ output
47
+ end
48
+
49
+ define_method(name) do |command|
50
+ send(base_method, command, false)
51
+ end
52
+
53
+ define_method(name.to_s + "!") do |command|
54
+ send(base_method, command, true)
38
55
  end
56
+
57
+
39
58
  private name
40
59
  end
41
60
  end
@@ -1,4 +1,5 @@
1
1
  require 'escape'
2
+ require 'active_support/core_ext/array/conversions'
2
3
 
3
4
  module Pod
4
5
  module Generator
@@ -23,7 +24,7 @@ module Pod
23
24
 
24
25
  def company
25
26
  if @specification.authors
26
- @specification.authors.keys.sort.join(', ')
27
+ @specification.authors.keys.sort.to_sentence
27
28
  else
28
29
  'no-company'
29
30
  end
@@ -42,7 +43,7 @@ module Pod
42
43
  end
43
44
 
44
45
  def files
45
- @pod.all_specs_public_header_files.map{ |f| f.relative_path_from(@pod.root).to_s }
46
+ @pod.documentation_headers.map{ |f| f.relative_path_from(@pod.root).to_s }
46
47
  end
47
48
 
48
49
  def index_file
@@ -28,9 +28,11 @@ module Pod
28
28
  @project.user_build_configurations = @podfile.user_build_configurations
29
29
  pods.each do |pod|
30
30
  # Add all source files to the project grouped by pod
31
- group = @project.add_pod_group(pod.name)
32
- pod.relative_source_files.each do |path|
33
- group.files.new('path' => path.to_s)
31
+ pod.relative_source_files_by_spec.each do |spec, paths|
32
+ group = @project.add_spec_group(spec.name)
33
+ paths.each do |path|
34
+ group.files.new('path' => path.to_s)
35
+ end
34
36
  end
35
37
  end
36
38
  # Add a group to hold all the target support files
@@ -13,10 +13,11 @@ module Pod
13
13
  def xcconfig
14
14
  @xcconfig ||= Xcodeproj::Config.new({
15
15
  # In a workspace this is where the static library headers should be found.
16
- 'PODS_ROOT' => @target_definition.relative_pods_root,
17
- 'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}',
18
- 'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
19
- 'OTHER_LDFLAGS' => default_ld_flags,
16
+ 'PODS_ROOT' => @target_definition.relative_pods_root,
17
+ 'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}',
18
+ 'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
19
+ 'OTHER_LDFLAGS' => default_ld_flags,
20
+ 'GCC_WARN_INHIBIT_ALL_WARNINGS' => @target_definition.inhibit_all_warnings? ? 'YES' : 'NO',
20
21
  })
21
22
  end
22
23
 
@@ -1,6 +1,9 @@
1
1
  require 'xcodeproj/workspace'
2
2
  require 'xcodeproj/project'
3
3
 
4
+ require 'active_support/core_ext/string/inflections'
5
+ require 'active_support/core_ext/array/conversions'
6
+
4
7
  module Pod
5
8
  class Installer
6
9
 
@@ -69,10 +72,8 @@ module Pod
69
72
  return if targets.empty?
70
73
 
71
74
  unless Config.instance.silent?
72
- # TODO let's just use ActiveSupport.
73
- plural = targets.size > 1
74
- puts "-> Integrating `#{@target_definition.lib_name}' into target#{'s' if plural} " \
75
- "`#{targets.map(&:name).join(', ')}' of Xcode project `#{user_project_path.basename}'.".green
75
+ puts "-> Integrating `#{@target_definition.lib_name}' into #{'target'.pluralize(targets.size)} " \
76
+ "`#{targets.map(&:name).to_sentence}' of Xcode project `#{user_project_path.basename}'.".green
76
77
  end
77
78
 
78
79
  add_xcconfig_base_configuration
@@ -141,10 +142,8 @@ module Pod
141
142
  end
142
143
 
143
144
  def add_pods_library
144
- framework_group = user_project.group("Frameworks")
145
- raise Informative, "Cannot add pod library to project. Please check if the project have a 'Frameworks' group in the root of the project." unless framework_group
146
-
147
- pods_library = framework_group.files.new_static_library(@target_definition.label)
145
+ group = user_project.group("Frameworks") || user_project.main_group
146
+ pods_library = group.files.new_static_library(@target_definition.label)
148
147
  targets.each do |target|
149
148
  target.frameworks_build_phases.each { |build_phase| build_phase << pods_library }
150
149
  end
@@ -192,6 +192,15 @@ module Pod
192
192
  source_files.map{ |p| p.relative_path_from(@sandbox.root) }
193
193
  end
194
194
 
195
+ def relative_source_files_by_spec
196
+ result = {}
197
+ source_files_by_spec.each do |spec, paths|
198
+ result[spec] = paths.map{ |p| p.relative_path_from(@sandbox.root) }
199
+ end
200
+ result
201
+ end
202
+
203
+
195
204
  # Finds the source files that every activated {Specification} requires.
196
205
  #
197
206
  # @note If the same file is required by two specifications the one at the
@@ -316,27 +325,35 @@ module Pod
316
325
  end
317
326
 
318
327
  # Computes the paths of all the public headers of the pod including every
319
- # subspec. For this reason the pod must not be cleaned before calling it.
328
+ # subspec (activated or not).
329
+ # For this reason the pod must not be cleaned when calling this command.
320
330
  #
321
331
  # This method is used by {Generator::Documentation}.
322
332
  #
323
333
  # @raise [Informative] If the pod was cleaned.
324
334
  #
325
- # @todo Merge with #221
326
- #
327
335
  # @return [Array<Pathname>] The path of all the public headers of the pod.
328
336
  #
329
- def all_specs_public_header_files
337
+ def documentation_headers
330
338
  if @cleaned
331
339
  raise Informative, "The pod is cleaned and cannot compute the " \
332
340
  "header files, as some might have been deleted."
333
341
  end
334
342
 
335
- all_specs = [ top_specification ] + top_specification.subspecs
336
- options = {:glob => '*.{h}'}
337
- files = paths_by_spec(:source_files, options, all_specs).values.flatten
338
- headers = files.select { |f| f.extname == '.h' }
339
- headers
343
+ specs = [top_specification] + top_specification.recursive_subspecs
344
+ source_files = paths_by_spec(:source_files, { :glob => '*.{h}'}, specs)
345
+ public_headers = paths_by_spec(:public_header_files,{ :glob => '*.{h}'}, specs)
346
+
347
+ result = []
348
+ specs.each do |spec|
349
+ if (public_h = public_headers[spec]) && !public_h.empty?
350
+ result += public_h
351
+ elsif (source_f = source_files[spec]) && !source_f.empty?
352
+ build_h = source_f.select { |f| f.extname == '.h' }
353
+ result += build_h unless build_h.empty?
354
+ end
355
+ end
356
+ result
340
357
  end
341
358
 
342
359
  # @!group Target integration
@@ -62,7 +62,7 @@ module Pod
62
62
 
63
63
  attr_reader :name, :target_dependencies
64
64
 
65
- attr_accessor :user_project, :link_with, :platform, :parent, :exclusive
65
+ attr_accessor :user_project, :link_with, :platform, :parent, :exclusive, :inhibit_all_warnings
66
66
 
67
67
  def initialize(name, options = {})
68
68
  @name, @target_dependencies = name, []
@@ -96,6 +96,11 @@ module Pod
96
96
  @platform || (@parent.platform if @parent)
97
97
  end
98
98
 
99
+ def inhibit_all_warnings
100
+ @inhibit_all_warnings.nil? ? (@parent.inhibit_all_warnings? if @parent) : @inhibit_all_warnings
101
+ end
102
+ alias_method :inhibit_all_warnings?, :inhibit_all_warnings
103
+
99
104
  def label
100
105
  if name == :default
101
106
  "Pods"
@@ -284,6 +289,13 @@ module Pod
284
289
  @target_definition.link_with = targets
285
290
  end
286
291
 
292
+ # Inhibits **all** warnings from the Pods library.
293
+ #
294
+ # When used, this is applied to all targets inheriting from the current one.
295
+ def inhibit_all_warnings!
296
+ @target_definition.inhibit_all_warnings = true
297
+ end
298
+
287
299
  # Specifies a dependency of the project.
288
300
  #
289
301
  # A dependency requirement is defined by the name of the Pod and _optionally_
@@ -34,9 +34,15 @@ module Pod
34
34
  groups.find { |g| g.name == 'Pods' } || groups.new({ 'name' => 'Pods' })
35
35
  end
36
36
 
37
- # Adds a group as child to the `Pods' group.
38
- def add_pod_group(name)
39
- pods.groups.new('name' => name)
37
+ # Adds a group as child to the `Pods' group namespacing subspecs.
38
+ def add_spec_group(name)
39
+ groups = pods.groups
40
+ group = nil
41
+ name.split('/').each do |name|
42
+ group = groups.find { |g| g.name == name } || groups.new({ 'name' => name })
43
+ groups = group.groups
44
+ end
45
+ group
40
46
  end
41
47
 
42
48
  def add_pod_target(name, platform)
@@ -51,8 +51,9 @@ module Pod
51
51
  compiler_flags ].each do |attr|
52
52
  instance_variable_set( "@#{attr}", { :ios => [], :osx => [] } )
53
53
  end
54
- @xcconfig = { :ios => Xcodeproj::Config.new, :osx => Xcodeproj::Config.new }
55
- @header_dir = { :ios => nil, :osx => nil }
54
+ @xcconfig = { :ios => Xcodeproj::Config.new, :osx => Xcodeproj::Config.new }
55
+ @header_dir = { :ios => nil, :osx => nil }
56
+ @requires_arc = { :ios => nil, :osx => nil }
56
57
 
57
58
  yield self if block_given?
58
59
  end
@@ -137,6 +138,7 @@ module Pod
137
138
  compiler_flags=
138
139
  deployment_target=
139
140
  header_dir=
141
+ requires_arc
140
142
  dependency }.each do |method|
141
143
  define_method(method) do |args|
142
144
  @specification._on_platform(@platform) do
@@ -194,7 +196,6 @@ module Pod
194
196
  top_attr_accessor :homepage
195
197
  top_attr_accessor :summary
196
198
  top_attr_accessor :documentation
197
- top_attr_accessor :requires_arc
198
199
  top_attr_accessor :version, lambda { |v| Version.new(v) }
199
200
 
200
201
  top_attr_reader :description, lambda { |instance, ivar| ivar || instance.summary }
@@ -255,6 +256,24 @@ module Pod
255
256
  alias_method :weak_framework=, :weak_frameworks=
256
257
  alias_method :library=, :libraries=
257
258
 
259
+
260
+ # @!method requires_arc=
261
+ #
262
+ # @abstract Wether the `-fobjc-arc' flag should be added to the compiler
263
+ # flags.
264
+ #
265
+ # @param [Bool] Wether the source files require ARC.
266
+ #
267
+ platform_attr_writer :requires_arc
268
+
269
+ def requires_arc
270
+ requires_arc = @requires_arc[active_platform]
271
+ if requires_arc.nil?
272
+ requires_arc = @parent ? @parent.requires_arc : false
273
+ end
274
+ requires_arc
275
+ end
276
+
258
277
  # @!method header_dir=
259
278
  #
260
279
  # @abstract The directory where to name space the headers files of
@@ -1,3 +1,5 @@
1
+ require 'active_support/core_ext/array/conversions'
2
+
1
3
  module Pod
2
4
  class Specification
3
5
  class Set
@@ -18,7 +20,7 @@ module Pod
18
20
  # TODO add graph that shows which dependencies led to this.
19
21
  raise Informative, "#{specification} tries to activate `#{dependency}', " \
20
22
  "but already activated version `#{required_version}' " \
21
- "by #{@required_by.join(', ')}."
23
+ "by #{@required_by.to_sentence}."
22
24
  end
23
25
  @specification = nil
24
26
  @required_by << specification
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-09 00:00:00.000000000 Z
12
+ date: 2012-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -247,9 +247,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
247
247
  - - ! '>='
248
248
  - !ruby/object:Gem::Version
249
249
  version: '0'
250
- segments:
251
- - 0
252
- hash: -2225480835849784751
253
250
  required_rubygems_version: !ruby/object:Gem::Requirement
254
251
  none: false
255
252
  requirements:
@@ -258,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
255
  version: '0'
259
256
  requirements: []
260
257
  rubyforge_project:
261
- rubygems_version: 1.8.24
258
+ rubygems_version: 1.8.23
262
259
  signing_key:
263
260
  specification_version: 3
264
261
  summary: An Objective-C library package manager.