Commit e77766ca8ad083270df21f60844f4692d0f9b059
- Date: Tue Apr 29 08:44:10 +0000 2008
- Committer: Nicolas Pouillard (nicolas.pouillard@gmail.com)
- Author: Nicolas Pouillard (nicolas.pouillard@gmail.com)
- Commit SHA1: e77766ca8ad083270df21f60844f4692d0f9b059
- Tree SHA1: beb5aba4a27d42c663348cd9edf5eb6a7f083873
Replace ucfirst by capitalize that is a standard function.
Commit diff
| |   |
| 52 | 52 | open_issues = issues.select { |i| i.open? } |
| 53 | 53 | %> |
| 54 | 54 | <p> |
| 55 | | <%= link_to "unassigned", "unassigned issue".pluralize(issues.size).ucfirst %>; <%= open_issues.size.to_pretty_s %> open. |
| 55 | <%= link_to "unassigned", "unassigned issue".pluralize(issues.size).capitalize %>; <%= open_issues.size.to_pretty_s %> open. |
| 56 | 56 | </p> |
| 57 | 57 | |
| 58 | 58 | <% if components.size > 1 %> |
| toggle raw diff |
--- a/lib/index.rhtml
+++ b/lib/index.rhtml
@@ -52,7 +52,7 @@
open_issues = issues.select { |i| i.open? }
%>
<p>
- <%= link_to "unassigned", "unassigned issue".pluralize(issues.size).ucfirst %>; <%= open_issues.size.to_pretty_s %> open.
+ <%= link_to "unassigned", "unassigned issue".pluralize(issues.size).capitalize %>; <%= open_issues.size.to_pretty_s %> open.
</p>
<% if components.size > 1 %> |
| |   |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | class String |
| 15 | | def ucfirst; self[0..0].upcase + self[1..-1] end |
| 16 | 15 | def dcfirst; self[0..0].downcase + self[1..-1] end |
| 17 | 16 | def blank?; self =~ /\A\s*\z/ end |
| 18 | 17 | def underline; self + "\n" + ("-" * self.length) end |
| … | … | |
| 164 | 164 | ans = ask "(A)dd #{name}, (r)emove #{name}, or (d)one" |
| 165 | 165 | case ans |
| 166 | 166 | when "a", "A" |
| 167 | | ans = ask "#{name.ucfirst} name", "" |
| 167 | ans = ask "#{name.capitalize} name", "" |
| 168 | 168 | stuff << ans unless ans =~ /^\s*$/ |
| 169 | 169 | when "r", "R" |
| 170 | 170 | ans = ask "Remove which #{name}? (1--#{stuff.size})" |
| … | … | |
| 193 | 193 | end |
| 194 | 194 | |
| 195 | 195 | j = while true |
| 196 | | i = ask "#{name.ucfirst} (1--#{stuff.size})" |
| 196 | i = ask "#{name.capitalize} (1--#{stuff.size})" |
| 197 | 197 | break i.to_i if i && (1 .. stuff.size).member?(i.to_i) |
| 198 | 198 | end |
| 199 | 199 | |
| toggle raw diff |
--- a/lib/lowline.rb
+++ b/lib/lowline.rb
@@ -12,7 +12,6 @@ class NilClass
end
class String
- def ucfirst; self[0..0].upcase + self[1..-1] end
def dcfirst; self[0..0].downcase + self[1..-1] end
def blank?; self =~ /\A\s*\z/ end
def underline; self + "\n" + ("-" * self.length) end
@@ -165,7 +164,7 @@ module Lowline
ans = ask "(A)dd #{name}, (r)emove #{name}, or (d)one"
case ans
when "a", "A"
- ans = ask "#{name.ucfirst} name", ""
+ ans = ask "#{name.capitalize} name", ""
stuff << ans unless ans =~ /^\s*$/
when "r", "R"
ans = ask "Remove which #{name}? (1--#{stuff.size})"
@@ -194,7 +193,7 @@ module Lowline
end
j = while true
- i = ask "#{name.ucfirst} (1--#{stuff.size})"
+ i = ask "#{name.capitalize} (1--#{stuff.size})"
break i.to_i if i && (1 .. stuff.size).member?(i.to_i)
end
|