提交 724eb9e6 编写于 作者: H Henrik N

Fix some typos, including a global "seperator" -> "separator".

上级 aaacc999
...@@ -876,8 +876,8 @@ def input_id_from_type(type) ...@@ -876,8 +876,8 @@ def input_id_from_type(type)
input_name_from_type(type).gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '') input_name_from_type(type).gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '')
end end
# Given an ordering of datetime components, create the selection html # Given an ordering of datetime components, create the selection HTML
# and join them with their appropriate seperators # and join them with their appropriate separators.
def build_selects_from_types(order) def build_selects_from_types(order)
select = '' select = ''
order.reverse.each do |type| order.reverse.each do |type|
......
...@@ -140,7 +140,7 @@ def number_to_percentage(number, options = {}) ...@@ -140,7 +140,7 @@ def number_to_percentage(number, options = {})
# number_with_delimiter(12345678) # => 12,345,678 # number_with_delimiter(12345678) # => 12,345,678
# number_with_delimiter(12345678.05) # => 12,345,678.05 # number_with_delimiter(12345678.05) # => 12,345,678.05
# number_with_delimiter(12345678, :delimiter => ".") # => 12.345.678 # number_with_delimiter(12345678, :delimiter => ".") # => 12.345.678
# number_with_delimiter(12345678, :seperator => ",") # => 12,345,678 # number_with_delimiter(12345678, :separator => ",") # => 12,345,678
# number_with_delimiter(98765432.98, :delimiter => " ", :separator => ",") # number_with_delimiter(98765432.98, :delimiter => " ", :separator => ",")
# # => 98 765 432,98 # # => 98 765 432,98
# #
......
...@@ -538,7 +538,7 @@ def auto_link_urls(text, html_options = {}) ...@@ -538,7 +538,7 @@ def auto_link_urls(text, html_options = {})
punctuation = '' punctuation = ''
# detect already linked URLs # detect already linked URLs
if $` =~ /<a\s[^>]*href="$/ if $` =~ /<a\s[^>]*href="$/
# do not change string; URL is alreay linked # do not change string; URL is already linked
href href
else else
# don't include trailing punctuation character as part of the URL # don't include trailing punctuation character as part of the URL
......
...@@ -258,9 +258,9 @@ def demodulize(class_name_in_module) ...@@ -258,9 +258,9 @@ def demodulize(class_name_in_module)
# # => <a href="/person/1-donald-e-knuth">Donald E. Knuth</a> # # => <a href="/person/1-donald-e-knuth">Donald E. Knuth</a>
def parameterize(string, sep = '-') def parameterize(string, sep = '-')
re_sep = Regexp.escape(sep) re_sep = Regexp.escape(sep)
# replace accented chars with ther ascii equivalents # Replace accented chars with their ASCII equivalents.
parameterized_string = transliterate(string) parameterized_string = transliterate(string)
# Turn unwanted chars into the seperator # Turn unwanted chars into the separator.
parameterized_string.gsub!(/[^a-z0-9\-_\+]+/i, sep) parameterized_string.gsub!(/[^a-z0-9\-_\+]+/i, sep)
# No more than one of the separator in a row. # No more than one of the separator in a row.
parameterized_string.squeeze!(sep) parameterized_string.squeeze!(sep)
...@@ -270,7 +270,7 @@ def parameterize(string, sep = '-') ...@@ -270,7 +270,7 @@ def parameterize(string, sep = '-')
end end
# Replaces accented characters with their ascii equivalents. # Replaces accented characters with their ASCII equivalents.
def transliterate(string) def transliterate(string)
Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册