From 036cb4c5fe469e6c0cfc3b2cd8d7fd8b388e433c Mon Sep 17 00:00:00 2001 From: Michael Dippery Date: Thu, 27 Dec 2012 12:58:19 -0500 Subject: [PATCH] Right-align comment amounts in subreddit tallies I think this looks a little bit better. --- features/browse.feature | 26 +++++++++++++------------- lib/usaidwat/application.rb | 2 +- lib/usaidwat/version.rb | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/features/browse.feature b/features/browse.feature index 68fb461..4bac48b 100644 --- a/features/browse.feature +++ b/features/browse.feature @@ -40,19 +40,19 @@ Feature: Browse comments When I run `usaidwat -t mipadi` Then it should pass with: """ - apple 6 - AskReddit 61 - battlefield3 2 - books 2 - django 1 - Games 1 - nyc 1 - personalfinance 1 - photography 1 - programming 20 - redditcasual 1 - wikipedia 1 - worldnews 2 + apple 6 + AskReddit 61 + battlefield3 2 + books 2 + django 1 + Games 1 + nyc 1 + personalfinance 1 + photography 1 + programming 20 + redditcasual 1 + wikipedia 1 + worldnews 2 """ Scenario: Tally comments when user has no comments diff --git a/lib/usaidwat/application.rb b/lib/usaidwat/application.rb index ff38b09..d4da0b8 100644 --- a/lib/usaidwat/application.rb +++ b/lib/usaidwat/application.rb @@ -58,7 +58,7 @@ def tally_comments subreddits = buckets.keys.sort { |a,b| a.downcase <=> b.downcase } subreddits.each do |subreddit| tally = buckets[subreddit] - printf "%-*s %s\n", longest_subreddit, subreddit, tally + printf "%-*s %3d\n", longest_subreddit, subreddit, tally end exit 0 end diff --git a/lib/usaidwat/version.rb b/lib/usaidwat/version.rb index c0c668e..c7def57 100644 --- a/lib/usaidwat/version.rb +++ b/lib/usaidwat/version.rb @@ -1,3 +1,3 @@ module USaidWat - VERSION = "0.1.3" + VERSION = "0.1.4dev" end