aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorMarkus Reiter2017-03-11 23:35:33 +0100
committerGitHub2017-03-11 23:35:33 +0100
commit7a8d782365b615e066bead9b4829f6fce7f375df (patch)
tree0c6716cdd000e2f45f823450faecf798db957426 /Library/Homebrew/utils.rb
parent666ab1438c0aba8d4c0f4b540a5ccdba485f0eca (diff)
parent44d367edca03acaa737a3156d05bf462f79f0fc3 (diff)
downloadbrew-7a8d782365b615e066bead9b4829f6fce7f375df.tar.bz2
Merge pull request #2314 from reitermarkus/formatter-pluralize
Replace `#plural` by `Formatter::pluralize`.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 8f897de17..46a8cc68e 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -131,16 +131,12 @@ def pretty_duration(s)
if s > 59
m = s / 60
s %= 60
- res = "#{m} minute#{plural m}"
+ res = Formatter.pluralize(m, "minute")
return res if s.zero?
res << " "
end
- res + "#{s} second#{plural s}"
-end
-
-def plural(n, s = "s")
- n == 1 ? "" : s
+ res << Formatter.pluralize(s, "second")
end
def interactive_shell(f = nil)