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