Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.33 KB  |  views: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class IO
  2.   def hello_world
  3.     path = "fileio.txt"
  4.     writeFile(path, "hello") do |file|
  5.       file = File.open(path, "a") do
  6.         write(file, "\nworld") do
  7.           close(file) do
  8.             data = read(path) do
  9.               puts data.last
  10.             end
  11.           end
  12.         end
  13.       end
  14.     end
  15.   end
  16. end
  17.  
  18. IO.new.hello_world