Commit 6cbbd909 authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Updated downloader.

parent f54a0b3f
......@@ -17,7 +17,7 @@ GIT
GIT
remote: git://github.com/CocoaPods/cocoapods-downloader
revision: 21f5a7b118d4071f21f810694d026c3a4e00df50
revision: 4ec997acca892f238aa8ced4edf37e95e69b5127
specs:
cocoapods-downloader (0.1.0)
......@@ -91,7 +91,7 @@ GEM
pygments.rb (0.3.2)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rake (0.9.5)
rake (0.9.6)
rb-fsevent (0.9.2)
redcarpet (2.2.2)
slop (3.3.3)
......
require 'pathname'
module Pod
# Stores the global configuration of CocoaPods.
#
class Config
# @!group Paths
......@@ -38,9 +41,6 @@ module Pod
# @return [Bool] Whether the generated documentation should be installed to
# Xcode.
#
# @note This is stored by the Config class so a global value value can be
# set.
#
attr_accessor :new_version_message
alias_method :new_version_message?, :new_version_message
......@@ -50,48 +50,39 @@ module Pod
# @return [Bool] Whether the installer should clean after the installation.
#
# @note This is stored by the Config class so a global value value can be
# set.
#
attr_accessor :clean
alias_method :clean?, :clean
# @return [Bool] Whether the documentation should be generated for the
# installed Pods.
#
# @note This is stored by the Config class so a global value value can be
# set.
#
attr_accessor :generate_docs
alias_method :generate_docs?, :generate_docs
# @return [Bool] Whether the generated documentation should be installed to
# Xcode.
#
# @note This is stored by the Config class so a global value value can be
# set.
#
attr_accessor :doc_install
alias_method :doc_install?, :doc_install
# @return [Bool] Whether CocoaPods should integrate a user target and build
# the workspace or just create the Pods project.
#
# @note This is stored by the Config class so a global value value can be
# set.
#
attr_accessor :integrate_targets
alias_method :integrate_targets?, :integrate_targets
# @return [Bool] Whether the installer should skip the repos update.
#
# @note This is stored by the Config class so a global value value can be
# set.
#
attr_accessor :skip_repo_update
alias_method :skip_repo_update?, :skip_repo_update
# @return [Bool] Whether the donwloader should use more agressive caching
# options.
#
attr_accessor :agressive_cache
alias_method :agressive_cache?, :agressive_cache
#--------------------------------------#
def initialize
......
......@@ -610,18 +610,27 @@ module Pod
# Downloads a Pod forcing the `bleeding edge' version if requested.
#
# @todo store the source of non specific downloads in the lockfile.
#
# @return [void]
#
def download_pod(pod)
downloader = Downloader.for_target(pod.root, pod.top_specification.source.dup)
downloader.cache_root = "~/Library/Caches/CocoaPods"
downloader.max_cache_size = 500
downloader.agressive_cache = config.agressive_cache?
if pod.top_specification.version.head?
downloader.download_head
specific_source = downloader.checkout_options
else
downloader.download
specific_source = downloader.checkout_options if downloader.specific_options?
end
pod.downloaded = true
if specific_source
# store the specific source
end
end
# Generates the documentation of a Pod unless it exists for a given
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment