Skip to content

Commit

Permalink
copy-edits a couple of exception messages
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
fxn committed Sep 8, 2011
1 parent 06b218d commit f7627de
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -158,17 +158,17 @@ def #{unsafe_method}!(*args) # def capitalize!(*args)
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
Expand Down

2 comments on commit f7627de

@dmathieu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fxn
Copy link
Member Author

@fxn fxn commented on f7627de Sep 8, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I did but forgot to amend. Thanks!

Please sign in to comment.