Ruby working files

Create a new file and write content to file:

write more than one time continuously:

Read line by line:

Get all content of file:

Check file exist or not: