mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
copy-edits a couple of exception messages
"Safe Buffer" should either be the constant with the class name, or go in lower case. I've chosen to follow the same terminology that is used in the AS core extensiong guide, "safe string", though "safe buffer" is also used elsewhere, we should pick one.
This commit is contained in:
@@ -158,17 +158,17 @@ module ActiveSupport #:nodoc:
|
||||
UNAVAILABLE_STRING_METHODS.each do |unavailable_method|
|
||||
class_eval <<-EOT, __FILE__, __LINE__
|
||||
# def gsub(*args)
|
||||
# raise NoMethodError, "gsub cannot be used with a Safe Buffer object. You should use object.to_str.gsub"
|
||||
# raise NoMethodError, "gsub cannot be used with a safe string. You should use object.to_str.gsub."
|
||||
# end
|
||||
def #{unavailable_method}(*args)
|
||||
raise NoMethodError, "#{unavailable_method} cannot be used with a Safe Buffer object. You should use object.to_str.#{unavailable_method}"
|
||||
raise NoMethodError, "#{unavailable_method} cannot be used with a safe string. You should use object.to_str.#{unavailable_method}."
|
||||
end
|
||||
|
||||
# def gsub!(*args)
|
||||
# raise NoMethodError, "gsub! cannot be used with a Safe Buffer object. You should use object.to_str.gsub!"
|
||||
# raise NoMethodError, "gsub! cannot be used with a safe string. You should use object.to_str.gsub!."
|
||||
# end
|
||||
def #{unavailable_method}!(*args)
|
||||
raise NoMethodError, "#{unavailable_method}! cannot be used with a Safe Buffer object. You should use object.to_str.#{unavailable_method}!"
|
||||
raise NoMethodError, "#{unavailable_method}! cannot be used with a safe string. You should use object.to_str.#{unavailable_method}!."
|
||||
end
|
||||
EOT
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user