8 minutes = (epoch / 60).to_i; seconds %= 60 if minutes > 0
9 hours = (minutes / 60).to_i; minutes %= 60 if hours > 0
10 days = (hours / 24).to_i; hours %= 24 if days > 0
11 years = (days / 365).to_i; days %= 365 if years > 0
14 list << "#{years} #{pluralize('year', years)}" if years > 0
15 list << "#{days} #{pluralize('day', days)}" if days > 0
16 list << "#{hours} #{pluralize('hour', hours)}" if hours > 0
17 list << "#{minutes} #{pluralize('minute', minutes)}" if minutes > 0
18 list << "#{seconds} #{pluralize('second', seconds)}" if seconds > 0
22 def pluralize(str, count)
23 count == 1 ? str : str + 's'