Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 2f294634bb858eae2aa668e8d5507a3b8d15f3ef 1 parent d57722f
Eloy Durán authored
13  lib/cocoapods/installer.rb
@@ -182,9 +182,20 @@ def target_installers
182 182
       end.compact
183 183
     end
184 184
 
  185
+    def install_dependencies!
  186
+      build_specifications.each do |spec|
  187
+        if spec.pod_destroot.exist?
  188
+          puts "Using #{spec}" unless config.silent?
  189
+        else
  190
+          puts "Installing #{spec}" unless config.silent?
  191
+          spec.download!
  192
+        end
  193
+      end
  194
+    end
  195
+
185 196
     def install!
186 197
       puts "Installing dependencies of: #{@podfile.defined_in_file}" unless config.silent?
187  
-      build_specifications.each(&:install!)
  198
+      install_dependencies!
188 199
       root = config.project_pods_root
189 200
 
190 201
       puts "==> Generating support files" unless config.silent?
38  lib/cocoapods/specification.rb
@@ -333,34 +333,6 @@ def validate!
333 333
 
334 334
     # Install and download hooks
335 335
 
336  
-    # Override this if you need to perform work before or after activating the
337  
-    # pod. Eg:
338  
-    #
339  
-    #   Pod::Spec.new do |s|
340  
-    #     def s.install!
341  
-    #       # pre-install
342  
-    #       super
343  
-    #       # post-install
344  
-    #     end
345  
-    #   end
346  
-    #
347  
-    # TODO Do we really need this now that we don’t install the podspec files anymore?
348  
-    def install!
349  
-      puts "==> Installing: #{self}" unless config.silent?
350  
-      # In case this spec is part of another pod's source, we need to dowload
351  
-      # the other pod's source.
352  
-      (part_of_specification || self).download_if_necessary!
353  
-    end
354  
-
355  
-    def download_if_necessary!
356  
-      if pod_destroot.exist?
357  
-        puts "  * Skipping download of #{self}, pod already downloaded" unless config.silent?
358  
-      else
359  
-        puts "  * Downloading: #{self}" unless config.silent?
360  
-        download!
361  
-      end
362  
-    end
363  
-
364 336
     # Downloads the source of the pod and places it in the project's pods
365 337
     # directory.
366 338
     #
@@ -375,9 +347,13 @@ def download_if_necessary!
375 347
     #     end
376 348
     #   end
377 349
     def download!
378  
-      downloader = Downloader.for_source(pod_destroot, source)
379  
-      downloader.download
380  
-      downloader.clean(expanded_clean_paths) if config.clean
  350
+      if spec = part_of_specification
  351
+        spec.download!
  352
+      else
  353
+        downloader = Downloader.for_source(pod_destroot, source)
  354
+        downloader.download
  355
+        downloader.clean(expanded_clean_paths) if config.clean
  356
+      end
381 357
     end
382 358
 
383 359
     # This is a convenience method which gets called after all pods have been

0 notes on commit 2f29463

Please sign in to comment.
Something went wrong with that request. Please try again.