Created
January 4, 2012 15:55
-
-
Save isaacsanders/1560659 to your computer and use it in GitHub Desktop.
Ruby Under
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class File | |
instance_eval do | |
:open.is_inverse_of(:close) | |
end | |
end | |
File.under(:open, *open_args) do |file| | |
# do stuff to the file | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment