Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

help all search results be aligned nicely

  • Loading branch information...
commit 5786c694af69823e8aa94569dad01d0c32f43293 1 parent 6d9eb41
@drnic drnic authored
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/commands/commands.rb
  2. +2 −2 spec/ui_spec.rb
View
5 lib/commands/commands.rb
@@ -136,7 +136,10 @@
repo_list = repos.map do |r|
{ "name" => "#{r['username']}/#{r['name']}", "description" => r['description'] }
end
- formatted_list = helper.format_list(repo_list).split("\n")
+ formatted_list = []
+ helper.format_list(repo_list).split("\n").each_with_index do |item, i|
+ formatted_list << ((i < 9) ? " " + item : item)
+ end
if user_repo = GitHub::UI.display_select_list(formatted_list)
user, repo = user_repo.split('/', 2)
end
View
4 spec/ui_spec.rb
@@ -360,8 +360,8 @@
']}'
json.rewind
question_list = <<-LIST.gsub(/^ /, '').split("\n").compact
- defunkt/github-gem # The official `github` command line helper for simplifying your GitHub experience.
- pjhyett/github-gem-builder # The scripts used to build RubyGems on GitHub
+ defunkt/github-gem # The official `github` command line helper for simplifying your GitHub experience.
+ pjhyett/github-gem-builder # The scripts used to build RubyGems on GitHub
LIST
@command.should_receive(:open).with("http://github.com/api/v1/json/search/github-gem").and_return(json)
GitHub::UI.should_receive(:display_select_list).with(question_list).
Please sign in to comment.
Something went wrong with that request. Please try again.