Permalink
Browse files

Remove Specification#install! and perform that work from Installer.

  • Loading branch information...
alloy committed Nov 26, 2011
1 parent d57722f commit 2f294634bb858eae2aa668e8d5507a3b8d15f3ef
Showing with 19 additions and 32 deletions.
  1. +12 −1 lib/cocoapods/installer.rb
  2. +7 −31 lib/cocoapods/specification.rb
View
@@ -182,9 +182,20 @@ def target_installers
end.compact
end
+ def install_dependencies!
+ build_specifications.each do |spec|
+ if spec.pod_destroot.exist?
+ puts "Using #{spec}" unless config.silent?
+ else
+ puts "Installing #{spec}" unless config.silent?
+ spec.download!
+ end
+ end
+ end
+
def install!
puts "Installing dependencies of: #{@podfile.defined_in_file}" unless config.silent?
- build_specifications.each(&:install!)
+ install_dependencies!
root = config.project_pods_root
puts "==> Generating support files" unless config.silent?
@@ -333,34 +333,6 @@ def validate!
# Install and download hooks
- # Override this if you need to perform work before or after activating the
- # pod. Eg:
- #
- # Pod::Spec.new do |s|
- # def s.install!
- # # pre-install
- # super
- # # post-install
- # end
- # end
- #
- # TODO Do we really need this now that we don’t install the podspec files anymore?
- def install!
- puts "==> Installing: #{self}" unless config.silent?
- # In case this spec is part of another pod's source, we need to dowload
- # the other pod's source.
- (part_of_specification || self).download_if_necessary!
- end
-
- def download_if_necessary!
- if pod_destroot.exist?
- puts " * Skipping download of #{self}, pod already downloaded" unless config.silent?
- else
- puts " * Downloading: #{self}" unless config.silent?
- download!
- end
- end
-
# Downloads the source of the pod and places it in the project's pods
# directory.
#
@@ -375,9 +347,13 @@ def download_if_necessary!
# end
# end
def download!
- downloader = Downloader.for_source(pod_destroot, source)
- downloader.download
- downloader.clean(expanded_clean_paths) if config.clean
+ if spec = part_of_specification
+ spec.download!
+ else
+ downloader = Downloader.for_source(pod_destroot, source)
+ downloader.download
+ downloader.clean(expanded_clean_paths) if config.clean
+ end
end
# This is a convenience method which gets called after all pods have been

0 comments on commit 2f29463

Please sign in to comment.