Commit cfe61a69 authored by Fabio Pelosin's avatar Fabio Pelosin

[Platform] Always show the deployment target in #to_s.

Previously the deployment was shown only if explicitly declared.
However, as the Specification class needs a different default than
the Podfile class and thus needs to declare it, this was not useful
anymore.
parent c0f16364
......@@ -135,7 +135,7 @@ module Pod
files = [Pathname.new(@repo_or_podspec)]
raise Informative, "Unable to find a spec named #{@repo_or_podspec}" unless files[0].exist? && @repo_or_podspec.include?('.podspec')
else
files = Pathname.pwd.glob('*.podspec')
files = Pathname.pwd.glob('**/*.podspec')
raise Informative, "No specs found in the current directory" if files.empty?
end
files
......@@ -153,7 +153,7 @@ module Pod
end
def is_repo?
@is_repo ||= @repo_or_podspec && (config.repos_dir + @repo_or_podspec).exist? && !@repo_or_podspec.include?('/')
@is_repo ||= @repo_or_podspec && @repo_or_podspec != '.' && (config.repos_dir + @repo_or_podspec).exist? && !@repo_or_podspec.include?('/')
end
# Linter class
......
......@@ -51,13 +51,9 @@ module Pod
if input.is_a? Platform
@symbolic_name = input.name
@deployment_target = input.deployment_target
@declared_deployment_target = input.declared_deployment_target
else
@symbolic_name = input
target = target[:deployment_target] if target.is_a?(Hash)
@declared_deployment_target = target
unless target
case @symbolic_name
when :ios
......@@ -82,10 +78,6 @@ module Pod
#
attr_reader :deployment_target
# @return [Version] The deployment target declared on initialization.
#
attr_reader :declared_deployment_target
# @param [Platform, Symbol] other The other platform to check.
#
# @note If a symbol is passed the comparison does not take into account
......@@ -121,7 +113,7 @@ module Pod
when :osx
s = 'OS X'
end
s << " #{declared_deployment_target}" if declared_deployment_target
s << " #{deployment_target}"
s
end
......
......@@ -28,7 +28,7 @@ describe Pod::Command::Presenter do
output = presenter.describe(@set)
output.should.include? 'Author: Robbie Hanson'
output.should.include? 'License: BSD'
output.should.include? 'Platform: iOS - OS X'
output.should.include? 'Platform: iOS 3.0 - OS X 10.4'
output.should.include? 'Watchers: 318'
output.should.include? 'Forks: 42'
output.should.include? 'Pushed: more than a year ago'
......
......@@ -35,8 +35,8 @@ describe Pod::Platform do
end
it "presents an accurate string representation" do
@platform.to_s.should == "iOS"
Pod::Platform.new(:osx).to_s.should == 'OS X'
@platform.to_s.should == "iOS 4.3"
Pod::Platform.new(:osx).to_s.should == 'OS X 10.6'
Pod::Platform.new(:ios, '5.0.0').to_s.should == 'iOS 5.0.0'
Pod::Platform.new(:osx, '10.7').to_s.should == 'OS X 10.7'
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