Commit 5c2723c3 authored by Samuel Giddins's avatar Samuel Giddins

[Installation] Update for new Podfile#installation_method signature

parent a928351a
...@@ -7,7 +7,7 @@ GIT ...@@ -7,7 +7,7 @@ GIT
GIT GIT
remote: https://github.com/CocoaPods/Core.git remote: https://github.com/CocoaPods/Core.git
revision: 93db7951de84e96562f5b47882f6307983155bf8 revision: 930de7aeb3f50eccf6d65b4d479daa3f5a956f87
branch: seg-podfile-refactor branch: seg-podfile-refactor
specs: specs:
cocoapods-core (0.39.0) cocoapods-core (0.39.0)
......
...@@ -4,17 +4,32 @@ module Pod ...@@ -4,17 +4,32 @@ module Pod
class Installer class Installer
class InstallationOptions class InstallationOptions
def self.from_podfile(podfile) def self.from_podfile(podfile)
name = podfile.installation_method['name'] name, options = podfile.installation_method
unless name.downcase == 'cocoapods' unless name.downcase == 'cocoapods'
raise Informative "currently need to specify a cocoapods install, you chose #{name}" raise Informative "Currently need to specify a `cocoapods` install, you chose `#{name}`."
end end
options = podfile.installation_method['options']
new(options) new(options)
end end
# Defines a new installation option.
#
# @param [#to_s] name the name of the option.
#
# @param default the default value for the option.
#
# @param [Boolean] boolean whether the option has a boolean value.
#
# @return [void]
#
# @!macro [attach] option
#
# @note this option defaults to $2.
#
# @return the $1 $0 for installation.
#
def self.option(name, default, boolean: true) def self.option(name, default, boolean: true)
name = name.to_s name = name.to_s
raise ArgumentError, "The #{name} option is already defined" if defaults.key?(name) raise ArgumentError, "The `#{name}` option is already defined" if defaults.key?(name)
defaults[name] = default defaults[name] = default
attr_accessor name attr_accessor name
alias_method "#{name}?", name if boolean alias_method "#{name}?", name if boolean
......
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