Code to use in ruby
filename = "/path-to/file/file.ext"
text=''
File.open(filename,"r"){ |f| f.gets; text=f.read}
File.open(filename,"w+"){ |f| f.write(text)}
Make sure that variable "filename" should be in lowercase
If you want a variable in uppercase then you have to declare it outside the def/method.