Commit 6fe547da authored by Eloy Duran's avatar Eloy Duran

Print the spec summary as well when searching.

parent b497b8fa
...@@ -25,7 +25,9 @@ module Pod ...@@ -25,7 +25,9 @@ module Pod
def run def run
Source.search_by_name(@query.strip, @full_text_search).each do |set| Source.search_by_name(@query.strip, @full_text_search).each do |set|
puts "#{set.name} (#{set.versions.reverse.join(", ")})" puts "==> #{set.name} (#{set.versions.reverse.join(", ")})"
puts " #{set.specification.read(:summary).strip}"
puts
end end
end end
end end
......
...@@ -50,27 +50,31 @@ describe "Pod::Command" do ...@@ -50,27 +50,31 @@ describe "Pod::Command" do
[ [
[ [
' s ', ' s ',
[ "==> ASIHTTPRequest (1.8, 1.8.1)\n" \
"ASIHTTPRequest (1.8, 1.8.1)", " Easy to use CFNetwork wrapper for HTTP requests, Objective-C, " \
"ASIWebPageRequest (1.8, 1.8.1)", "Mac OS X and iPhone\n\n" \
"JSONKit (1.4)", "==> ASIWebPageRequest (1.8, 1.8.1)\n" \
"SSZipArchive (1.0)" " The ASIWebPageRequest class included with ASIHTTPRequest lets you " \
] "download\n complete webpages, including external resources like " \
"images and stylesheets.\n\n" \
"==> JSONKit (1.4)\n" \
" A Very High Performance Objective-C JSON Library.\n\n" \
"==> SSZipArchive (1.0)\n" \
" Utility class for unzipping files on iOS and Mac.\n\n"
], ],
[ [
'json', 'json',
[ "==> JSONKit (1.4)\n" \
"JSONKit (1.4)" " A Very High Performance Objective-C JSON Library.\n\n",
]
] ]
].each do |query, result| ].each do |query, result|
command = Pod::Command.parse('search', '--silent', query) command = Pod::Command.parse('search', '--silent', query)
def command.puts(msg) def command.puts(msg = '')
(@printed ||= []) << msg (@printed ||= '') << "#{msg}\n"
end end
command.run command.run
printed = command.instance_variable_get(:@printed) printed = command.instance_variable_get(:@printed)
printed.should == result.sort printed.should == result
end end
end end
...@@ -78,26 +82,27 @@ describe "Pod::Command" do ...@@ -78,26 +82,27 @@ describe "Pod::Command" do
[ [
[ [
'systemCONfiguration', 'systemCONfiguration',
[ "==> Reachability (2.0.4)\n" \
"Reachability (2.0.4)" " A wrapper for the SystemConfiguration Reachablity APIs.\n\n",
]
], ],
[ [
'is', 'is',
[ "==> ASIHTTPRequest (1.8, 1.8.1)\n" \
"ASIHTTPRequest (1.8, 1.8.1)", " Easy to use CFNetwork wrapper for HTTP requests, Objective-C, " \
"Reachability (2.0.4)", "Mac OS X and iPhone\n\n" \
"SSZipArchive (1.0)" "==> Reachability (2.0.4)\n" \
] " A wrapper for the SystemConfiguration Reachablity APIs.\n\n" \
"==> SSZipArchive (1.0)\n" \
" Utility class for unzipping files on iOS and Mac.\n\n"
] ]
].each do |query, result| ].each do |query, result|
command = Pod::Command.parse('search', '--silent', '--full', query) command = Pod::Command.parse('search', '--silent', '--full', query)
def command.puts(msg) def command.puts(msg = '')
(@printed ||= []) << msg (@printed ||= '') << "#{msg}\n"
end end
command.run command.run
printed = command.instance_variable_get(:@printed) printed = command.instance_variable_get(:@printed)
printed.should == result.sort printed.should == result
end end
end end
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