Commit 864e0afa authored by Marius Rackwitz's avatar Marius Rackwitz

Get completely rid of :head version support

parent e5afc825
...@@ -8,7 +8,7 @@ module Pod ...@@ -8,7 +8,7 @@ module Pod
self.description = <<-DESC self.description = <<-DESC
Shows the outdated pods in the current Podfile.lock, but only those from Shows the outdated pods in the current Podfile.lock, but only those from
spec repos, not those from local/external sources or `:head` versions. spec repos, not those from local/external sources.
DESC DESC
# Run the command # Run the command
......
...@@ -67,7 +67,7 @@ module Pod ...@@ -67,7 +67,7 @@ module Pod
# #
def self.download_request(request, target) def self.download_request(request, target)
result = Response.new result = Response.new
result.checkout_options = download_source(request.name, target, request.params, request.head?) result.checkout_options = download_source(target, request.params)
result.location = target result.location = target
if request.released_pod? if request.released_pod?
...@@ -88,35 +88,22 @@ module Pod ...@@ -88,35 +88,22 @@ module Pod
private private
# Downloads a pod with the given `name` and `params` to `target`. # Downloads a pod with the given `params` to `target`.
#
# @param [String] name
# #
# @param [Pathname] target # @param [Pathname] target
# #
# @param [Hash<Symbol,String>] params # @param [Hash<Symbol,String>] params
# #
# @param [Boolean] head
#
# @return [Hash] The checkout options required to re-download this exact # @return [Hash] The checkout options required to re-download this exact
# same source. # same source.
# #
def self.download_source(name, target, params, head) def self.download_source(target, params)
FileUtils.rm_rf(target) FileUtils.rm_rf(target)
downloader = Downloader.for_target(target, params) downloader = Downloader.for_target(target, params)
if head downloader.download
unless downloader.head_supported?
raise Informative, "The pod '#{name}' does not " \
"support the :head option, as it uses a #{downloader.name} " \
'source. Remove that option to use this pod.'
end
downloader.download_head
else
downloader.download
end
target.mkpath target.mkpath
if downloader.options_specific? && !head if downloader.options_specific?
params params
else else
downloader.checkout_options downloader.checkout_options
......
...@@ -23,11 +23,6 @@ module Pod ...@@ -23,11 +23,6 @@ module Pod
# #
attr_reader :params attr_reader :params
# @return [Boolean] Whether the download request is for a head download.
#
attr_reader :head
alias_method :head?, :head
# Initialize a new instance # Initialize a new instance
# #
# @param [Specification,Nil] spec # @param [Specification,Nil] spec
...@@ -42,15 +37,11 @@ module Pod ...@@ -42,15 +37,11 @@ module Pod
# @param [Hash<Symbol,String>,Nil] params # @param [Hash<Symbol,String>,Nil] params
# see {#params} # see {#params}
# #
# @param [Boolean] head def initialize(spec: nil, released: false, name: nil, params: false)
# see {#head}
#
def initialize(spec: nil, released: false, name: nil, params: false, head: false)
@released_pod = released @released_pod = released
@spec = spec @spec = spec
@params = spec ? (spec.source && spec.source.dup) : params @params = spec ? (spec.source && spec.source.dup) : params
@name = spec ? spec.name : name @name = spec ? spec.name : name
@head = head
validate! validate!
end end
......
...@@ -11,7 +11,7 @@ module Pod ...@@ -11,7 +11,7 @@ module Pod
@stub_download = lambda do |&blk| @stub_download = lambda do |&blk|
original_download_source = Downloader.method(:download_source) original_download_source = Downloader.method(:download_source)
Downloader.define_singleton_method(:download_source) do |_name, target, _params, _head| Downloader.define_singleton_method(:download_source) do |target, _params|
FileUtils.mkdir_p target FileUtils.mkdir_p target
Dir.chdir(target) do Dir.chdir(target) do
result = blk.call result = blk.call
......
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