Skip to content

Commit

Permalink
[Installer] Fix incorrect name for Pods with preferred subspecs.
Browse files Browse the repository at this point in the history
See #485
  • Loading branch information
fabiopelosin committed Aug 29, 2012
1 parent fab64fb commit 9436e75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 2 additions & 8 deletions lib/cocoapods/installer.rb
Expand Up @@ -48,17 +48,11 @@ def target_installers
#
def install_dependencies!
pods.sort_by { |pod| pod.top_specification.name.downcase }.each do |pod|
name = pod.top_specification.name
should_install = @resolver.should_install?(name) || !pod.exists?
should_install = @resolver.should_install?(pod.top_specification.name) || !pod.exists?

unless config.silent?
marker = config.verbose ? "\n-> ".green : ''
if subspec_name = pod.top_specification.preferred_dependency
name = "#{pod.top_specification.name}/#{subspec_name} (#{pod.top_specification.version})"
else
name = pod.to_s
end
puts marker << ( should_install ? "Installing #{name}".green : "Using #{name}" )
puts marker << ( should_install ? "Installing #{pod}".green : "Using #{pod}" )
end

if should_install
Expand Down
3 changes: 2 additions & 1 deletion lib/cocoapods/specification.rb
Expand Up @@ -458,7 +458,8 @@ def dependency_by_top_level_spec_name(name)
end

def to_s
"#{name} (#{version})"
display_name = preferred_dependency.nil? ? name : "#{name}/#{preferred_dependency}"
"#{display_name} (#{version})"
end

def inspect
Expand Down

0 comments on commit 9436e75

Please sign in to comment.