You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since .append will write out any object which responds to #to_s, it wrote the options hash into the file, did not set owner/group on the file, and did this all silently.
While using SugarUtils:File.append I accidentally left out the data argument, but I did supply some options:
Since .append will write out any object which responds to #to_s, it wrote the options hash into the file, did not set owner/group on the file, and did this all silently.
What I had intended to write was:
I think that this parameter pattern will very rarely be valid, so all of the write related methods should check it and raise an exception if:
This change would mean that:
but this would not, because it includes an unexpected key:
This check would have caught my bug, and I think allow all of the correct calls to the method.
The text was updated successfully, but these errors were encountered: