Commit 745ca34e authored by Eloy Duran's avatar Eloy Duran

Get search info from the spec that the found spec is a part of. Fixes #177.

parent 7b619aea
......@@ -28,10 +28,11 @@ module Pod
def run
Source.search_by_name(@query.strip, @full_text_search).each do |set|
puts "\e[32m--> #{set.name} (#{set.versions.reverse.join(", ")})\e[0m"
puts_wrapped_text(set.specification.summary)
puts_detail('Homepage', set.specification.homepage)
source = set.specification.source ? set.specification.source.values[0] : nil
spec = set.specification.part_of_other_pod? ? set.specification.part_of_specification : set.specification
source = spec.source.values.first
puts_detail('Homepage', spec.homepage)
puts_detail('Source', source)
puts_github_info(source) if @stats
......
......@@ -173,6 +173,13 @@ module Pod
# This is assigned the other spec, of which this pod's source is a part, by
# a Resolver.
attr_accessor :part_of_specification
def part_of_specification
@part_of_specification || begin
set = Source.search(@part_of)
set.required_by(self)
set.specification
end
end
def wrapper?
source_files.empty? && !subspecs.empty?
......
......@@ -124,6 +124,11 @@ describe "A Pod::Specification that's part of another pod's source" do
@spec.dependencies.should == [Pod::Dependency.new('monkey', '>= 1')]
end
it "searches the sources for a matching specification if it has not been assigned by the Resolver yet (e.g. the search command)" do
@spec.part_of_dependency = 'SSZipArchive', '0.1.1'
@spec.part_of_specification.to_s.should == 'SSZipArchive (0.1.1)'
end
# TODO
#it "returns the specification of the pod that it's part of" do
# @spec.part_of_specification
......
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