In this chapter, we walked through the basic components that comprise the Ruby File class and also reviewed the list of options that you can use when creating or adding to files. We analyzed how you can read the contents of files into Ruby programs by utilizing the read method. We also examined how to iterate over each line in a file and perform operations on each line. We learned how to delete files in Ruby. However, you should be careful while using this command as you don't want to accidentally delete a file. Remember, Ruby offers no warning whatsoever before deleting, so make sure you use it carefully. This chapter also walked you through the commands for appending content to the end of a file. Appending content to the end of a file is a great way of adding persistence to a Ruby program, without having to integrate a full database such as PostgreSQL or MySQL....
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine