Ruby Essential Training Part 3: Files, Formats, Templates
2h 27mBeginner2019-02-07
Authors

Kevin Skoglund
Founder of NovaFabrica
Course details
Discover how to use Ruby code to interact with the file system. With Ruby, you can read and write to config files and logs, automate tasks like mail merge, and find and organize files without ever leaving your code editor. In this course, the third in the Ruby Essential Training series, Kevin Skoglund reviews the basic techniques for working with files and directories. Learn to find existing files and directories and to create new ones. Discover different techniques for reading and writing data to files. Then learn how to import and export data in popular formats and how to use Embedded Ruby (ERB) to bind dynamic values into reusable file templates. Each lesson is filled with practical examples, and programming challenges allow you to practice your new skills as you progress through the course.
Learning objectives
File system basics
Writing to and reading from files
Renaming, deleting, and copying files
Creating and editing directories
Working with common data formats
ERB templating
Learning objectives
File system basics
Writing to and reading from files
Renaming, deleting, and copying files
Creating and editing directories
Working with common data formats
ERB templating
Skills covered
RubyEssential TrainingProgramming LanguagesOpen SourceSoftware Development
Concepts
0. Introduction
- 01 - Learn the essentials of working with files in Ruby
- 02 - What you need to know
1. The File System
- 03 - Input output basics
- 04 - File system basics
- 05 - Types of file paths
- 06 - File permissions
2. Work with Files
- 07 - Access files
- 08 - Write to files
- 09 - Read from files
- 10 - File pointer
- 11 - Read or write an entire file
- 12 - Rename, delete, copy
- 13 - Examine file details
- 14 - Challenge - List maker
- 15 - Solution - List maker
3. Work with Directories
- 16 - Create directories
- 17 - Change directories
- 18 - Entries
- 19 - Glob
- 20 - Challenge - Multi-list maker
- 21 - Solution - Multi-list maker
4. Common Data Formats
- 22 - CSV
- 23 - CSV to hashes
- 24 - YAML
- 25 - JSON
- 26 - XML
5. ERB Templating
- 27 - Embed Ruby
- 28 - Binding
- 29 - Template files
- 30 - Challenge - Mail merge
- 31 - Solution - Mail merge
Conclusion
- 32 - Next steps
Related courses
- Ruby Essential Training Part 2: Classes and Modules
- Ruby Essential Training Part 1: The Basics
- Ruby on Rails 7 Essential Training
- Ruby on Rails 6 Essential Training: Models and Associations
- Installing and Running Ruby on Rails 5: Mac
- Installing and Running Ruby on Rails 5: Windows
- Ruby: Testing with RSpec
- Ruby on Rails: Get More From ActiveRecord
Related learn paths
- Getting Started with Continuous Integration / Continuous Delivery (CI/CD)
- Build Your Ruby on Rails Skills
- Prepare for the CompTIA PenTest+ (PT0-001) Exam
- Getting Started with C++
- Become a Programmer: Foundations
- Getting Started with DevOps
- Prepare for the CompTIA PenTest+ (PT0-002) Certification Exam
- Getting Started with R for Data Science