Skip to content

Commit

Permalink
Refactored printf output
Browse files Browse the repository at this point in the history
  • Loading branch information
adarsh committed Apr 26, 2012
1 parent c881948 commit 580bcbf
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions gitsucker.rb
Expand Up @@ -109,22 +109,17 @@ def sort_authors_by_score(array_of_objects)
puts "Fetching data..."
query = Query.new(input)

headers = ["all", "originals", "forked", "ruby", "js", "score"]
printf "%-20s", "name"
headers.each { |title| printf "%-10s", title }
printf "%-20s %-10s %-10s %-10s %-10s %-10s %-10s",
"name", "all", "originals", "forked", "ruby", "js", "score"

puts
print '='*80
puts

query.forking_authors.each do |author|
printf "%-20s", author.name
printf "%-10s", author.all_projects
printf "%-10s", author.originals
printf "%-10s", author.forked
printf "%-10s", author.ruby
printf "%-10s", author.js
printf "%-10s", author.score
printf "%-20s %-10s %-10s %-10s %-10s %-10s %-10s",
author.name, author.all_projects, author.originals, author.forked,
author.ruby, author.js, author.score
puts
end
rescue
Expand Down

0 comments on commit 580bcbf

Please sign in to comment.