Created
November 14, 2011 08:14
-
-
Save fadhlirahim/1363508 to your computer and use it in GitHub Desktop.
Create Tempfile
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
# Creates Tempfile | |
def ical_file | |
file = Tempfile.new("foo") | |
begin | |
file.path | |
file.write('foo') | |
file.rewind | |
file.read | |
ensure | |
file.close | |
file.unlink # deletes the temp file | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment