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
self.description = <<-DESC
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
# Run the command
......
......@@ -67,7 +67,7 @@ module Pod
#
def self.download_request(request, target)
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
if request.released_pod?
......@@ -88,35 +88,22 @@ module Pod
private
# Downloads a pod with the given `name` and `params` to `target`.
#
# @param [String] name
# Downloads a pod with the given `params` to `target`.
#
# @param [Pathname] target
#
# @param [Hash<Symbol,String>] params
#
# @param [Boolean] head
#
# @return [Hash] The checkout options required to re-download this exact
# same source.
#
def self.download_source(name, target, params, head)
def self.download_source(target, params)
FileUtils.rm_rf(target)
downloader = Downloader.for_target(target, params)
if head
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
if downloader.options_specific? && !head
if downloader.options_specific?
params
else
downloader.checkout_options
......
......@@ -23,11 +23,6 @@ module Pod
#
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
#
# @param [Specification,Nil] spec
......@@ -42,15 +37,11 @@ module Pod
# @param [Hash<Symbol,String>,Nil] params
# see {#params}
#
# @param [Boolean] head
# see {#head}
#
def initialize(spec: nil, released: false, name: nil, params: false, head: false)
def initialize(spec: nil, released: false, name: nil, params: false)
@released_pod = released
@spec = spec
@params = spec ? (spec.source && spec.source.dup) : params
@name = spec ? spec.name : name
@head = head
validate!
end
......
......@@ -11,7 +11,7 @@ module Pod
@stub_download = lambda do |&blk|
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
Dir.chdir(target) do
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