Skip to content

Commit

Permalink
Right-align comment amounts in subreddit tallies
Browse files Browse the repository at this point in the history
I think this looks a little bit better.
  • Loading branch information
mdippery committed Dec 27, 2012
1 parent 2dc313c commit 036cb4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions features/browse.feature
Expand Up @@ -40,19 +40,19 @@ Feature: Browse comments
When I run `usaidwat -t mipadi` When I run `usaidwat -t mipadi`
Then it should pass with: Then it should pass with:
""" """
apple 6 apple 6
AskReddit 61 AskReddit 61
battlefield3 2 battlefield3 2
books 2 books 2
django 1 django 1
Games 1 Games 1
nyc 1 nyc 1
personalfinance 1 personalfinance 1
photography 1 photography 1
programming 20 programming 20
redditcasual 1 redditcasual 1
wikipedia 1 wikipedia 1
worldnews 2 worldnews 2
""" """


Scenario: Tally comments when user has no comments Scenario: Tally comments when user has no comments
Expand Down
2 changes: 1 addition & 1 deletion lib/usaidwat/application.rb
Expand Up @@ -58,7 +58,7 @@ def tally_comments
subreddits = buckets.keys.sort { |a,b| a.downcase <=> b.downcase } subreddits = buckets.keys.sort { |a,b| a.downcase <=> b.downcase }
subreddits.each do |subreddit| subreddits.each do |subreddit|
tally = buckets[subreddit] tally = buckets[subreddit]
printf "%-*s %s\n", longest_subreddit, subreddit, tally printf "%-*s %3d\n", longest_subreddit, subreddit, tally
end end
exit 0 exit 0
end end
Expand Down
2 changes: 1 addition & 1 deletion lib/usaidwat/version.rb
@@ -1,3 +1,3 @@
module USaidWat module USaidWat
VERSION = "0.1.3" VERSION = "0.1.4dev"
end end

0 comments on commit 036cb4c

Please sign in to comment.