Permalink
Browse files

Clean a bit

  • Loading branch information...
1 parent 6436957 commit 095231593038298bb54a726c067581e45c200661 @alloy alloy committed Dec 3, 2010
Showing with 4 additions and 9 deletions.
  1. +4 −9 lib/macruby_bugmash_bot/trac.rb
@@ -23,18 +23,13 @@ def ticket(id)
DB.ticket(id)
end
- def ticket_message(id)
- t = ticket(id)
- "#{t[:summary]} (#{t[:link]})"
- end
-
- def _ticket_message(t)
+ def ticket_message(t)
"#{t[:summary]} (#{t[:link]})"
end
def user(name)
if (tickets = DB.user_tickets(name)) && !tickets.empty?
- result = tickets.map { |t| _ticket_message(t) }
+ result = tickets.map { |t| ticket_message(t) }
result.unshift("You are currently working on #{pluralize(result.size, 'ticket')}:")
result
else
@@ -47,7 +42,7 @@ def marked_for_review
if result.empty?
["There are currently no open tickets marked for review."]
else
- result = result.map { |t| _ticket_message(t) }
+ result = result.map { |t| ticket_message(t) }
result.unshift("There #{result.size == 1 ? 'is' : 'are'} currently #{pluralize(result.size, 'ticket')} marked for review:")
result
end
@@ -56,7 +51,7 @@ def marked_for_review
# Returns a ticket that nobody is working on yet, in ascending order.
def open_ticket
if ot = DB.random_open_ticket
- "Ticket available #{_ticket_message(ot)}"
+ "Ticket available #{ticket_message(ot)}"
else
"There are no more open tickets! \o/"
end

0 comments on commit 0952315

Please sign in to comment.