Permalink
Browse files

Print the spec summary as well when searching.

  • Loading branch information...
1 parent b497b8f commit 6fe547da8c1f5c9ec5529cc2d921638048197660 @alloy alloy committed Sep 17, 2011
Showing with 31 additions and 24 deletions.
  1. +3 −1 lib/cocoapods/command/search.rb
  2. +28 −23 spec/functional/command_spec.rb
@@ -25,7 +25,9 @@ def initialize(argv)
def run
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
@@ -50,54 +50,59 @@ def command.master_repo_url; SpecHelper.fixture('spec-repos/master'); end
[
[
' s ',
- [
- "ASIHTTPRequest (1.8, 1.8.1)",
- "ASIWebPageRequest (1.8, 1.8.1)",
- "JSONKit (1.4)",
- "SSZipArchive (1.0)"
- ]
+ "==> ASIHTTPRequest (1.8, 1.8.1)\n" \
+ " Easy to use CFNetwork wrapper for HTTP requests, Objective-C, " \
+ "Mac OS X and iPhone\n\n" \
+ "==> ASIWebPageRequest (1.8, 1.8.1)\n" \
+ " 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',
- [
- "JSONKit (1.4)"
- ]
+ "==> JSONKit (1.4)\n" \
+ " A Very High Performance Objective-C JSON Library.\n\n",
]
].each do |query, result|
command = Pod::Command.parse('search', '--silent', query)
- def command.puts(msg)
- (@printed ||= []) << msg
+ def command.puts(msg = '')
+ (@printed ||= '') << "#{msg}\n"
end
command.run
printed = command.instance_variable_get(:@printed)
- printed.should == result.sort
+ printed.should == result
end
end
it "searches for a pod who's name, summary, or description matches the given query ignoring case" do
[
[
'systemCONfiguration',
- [
- "Reachability (2.0.4)"
- ]
+ "==> Reachability (2.0.4)\n" \
+ " A wrapper for the SystemConfiguration Reachablity APIs.\n\n",
],
[
'is',
- [
- "ASIHTTPRequest (1.8, 1.8.1)",
- "Reachability (2.0.4)",
- "SSZipArchive (1.0)"
- ]
+ "==> ASIHTTPRequest (1.8, 1.8.1)\n" \
+ " Easy to use CFNetwork wrapper for HTTP requests, Objective-C, " \
+ "Mac OS X and iPhone\n\n" \
+ "==> 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|
command = Pod::Command.parse('search', '--silent', '--full', query)
- def command.puts(msg)
- (@printed ||= []) << msg
+ def command.puts(msg = '')
+ (@printed ||= '') << "#{msg}\n"
end
command.run
printed = command.instance_variable_get(:@printed)
- printed.should == result.sort
+ printed.should == result
end
end
end

0 comments on commit 6fe547d

Please sign in to comment.