Commit aa3d7be4 authored by Fabio Pelosin's avatar Fabio Pelosin

[Specification] Return lowest supported deployment target if needed.

Closes #357
parent c7c61af5
......@@ -474,7 +474,27 @@ module Pod
end
def deployment_target(platform)
@deployment_target[platform] || ( @parent ? @parent.deployment_target(platform) : nil )
@deployment_target[platform] || ( @parent ? @parent.deployment_target(platform) : lowest_supported_deployment_target(platform) )
end
# Returns the lowest supported deployment target for a given platform.
# The value should be pegged to the lowest deployment target supported
# by a default xcode installation.
#
# @param platform [Symbol] The platform for witch the deployment target
# shoud be returned.
#
# @return [String] The deployment target.
#
def lowest_supported_deployment_target(platform)
case platform
when :ios
'3.0'
when :osx
'10.4'
else
nil
end
end
end
Spec = Specification
......
......@@ -552,7 +552,7 @@ describe "A Pod::Specification, concerning its attributes that support different
it "returns the list of the supported platfroms and deployment targets" do
@spec.available_platforms.count.should == 2
@spec.available_platforms.should.include? Pod::Platform.new(:osx)
@spec.available_platforms.should.include? Pod::Platform.new(:osx, '10.4')
@spec.available_platforms.should.include? Pod::Platform.new(:ios, '4.0')
end
......
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