We've added multiple exciting mini-projects to complement our Ruby for Beginners and Advanced Ruby courses. These projects will give you practical experience in building structured, maintainable codebases for real-world applications.

1. FileOrganizer

In this project, we'll create a script to organize files in a directory by their extensions.

For example, .jpg files go into an Images folder, .txt files go into a Documents folder, etc.

By the end of this project, you will have a deeper understanding of Ruby file operations, directory management, and practical usage of classes and modules to organize code effectively.

It's important to complete this mini-project after the Ruby for Beginners course to reinforce your knowledge

The codebase is structured as a production-ready gem, which gives you a taste of how professional Ruby projects are organized.

Tools and Concepts We'll Use

In this project, we will be using the following tools and concepts:

  • File and Dir Class and Modules: Provided by Ruby to handle file and directory operations. These classes are part of Ruby’s core library, maintained by the Ruby core team. We will use them to list files, check existence, create directories, and move files.
  • FileUtils Module: This module provides methods for file manipulation such as copying, moving, and deleting files.
  • Basic Data Types: Learn how to utilize Hash, Array, and String to represent the different layers of data needed for the mini project.
  • Modules as Namespace: To avoid name clashes and organize code.
  • Modules as Helpers: To provide utility functions.
  • Argument Forwarding Operator: Introduced in Ruby 2.7, it forwards arguments from one method to another.

Project Structure

file_organizer/
├── lib/
│   ├── file_organizer/
│   │   ├── organizer.rb
│   │   ├── file_categorizer.rb
│   │   ├── file_mover.rb
│   │   └── utilities.rb
│   └── file_organizer.rb
├── bin/
│   └── organize.rb
├── test_directory/
│   ├── image.jpg
│   ├── document.txt
│   ├── video.mp4
│   ├── music.mp3
│   └── archive.zip

2. FileEncryption

This project will help you apply Ruby concepts by creating a command-line tool to encrypt and decrypt files using simple algorithms like Caesar Cipher.

It's important to complete this mini-project after the Ruby for Beginners course to reinforce your knowledge.

The codebase is structured as a production-ready gem, which gives you a taste of how professional Ruby projects are organized.

Tools and Concepts We'll Use

  • Modules as Namespace: To avoid name clashes and organize code.
  • Modules as Helpers: To provide utility functions.
  • Caesar Cipher Algorithm: A basic encryption technique where each letter in the plaintext is shifted a certain number of places down or up the alphabet.
  • File and Dir Class and Modules: Provided by Ruby to handle file and directory operations. These classes are part of Ruby’s core library, maintained by the Ruby core team. The File class is used for file manipulation, while the Dir class is used for directory operations. We will use them to read, write, and manipulate files.

Project Structure

file_encryption/
├── lib/
│   ├── file_encryption/
│   │   ├── encrypter.rb
│   │   ├── decrypter.rb
│   │   └── utilities.rb
│   └── file_encryption.rb
├── bin/
│   └── encrypt.rb
│   └── decrypt.rb
├── test_directory/
│   ├── sample.txt

3. MyRake

This project will help you apply Ruby concepts by creating a command-line tool that mimics the basic functionality of Rake, a task automation tool.

It's important to complete this mini-project after the Advanced Ruby course to reinforce your knowledge and learn how to structure a Ruby codebase similar to a production-ready gem.

By the end of this project, you will have a solid understanding of how to create a simple task automation tool, similar to Rake, using Ruby.

Tools and Concepts We'll Use

  • Hash
  • Global variable and class methods
  • Blocks and Procs: Understanding blocks and how they can be saved as Procs for later execution.
  • ARGV: Array of arguments passed to the script from the command line.
  • require_relative: Used to load files relative to the file containing the call.
  • Module Mixins: Mixing in modules to add functionality to classes.
  • The main Object: Understanding how methods included in the main object become available globally.
  • Argument Forwarding Operator: Introduced in Ruby 2.7, it forwards arguments from one method to another.

Project Structure

my_rake/
├── lib/
│   ├── my_rake/
│   │   ├── task.rb
│   │   └── dsl.rb
│   └── my_rake.rb
├── Rakefile
├── bin/
│   └── my_rake.rb

4. MyInteractor

This project will help you apply Ruby concepts by creating a basic version of the popular interactor gem.

This is an excellent way to practice Advanced Ruby skills and learn how to structure a Ruby codebase similar to a production-ready gem.

By the end of this project, you will be proficient in creating an interactor pattern for handling business logic in Ruby applications.

You will learn to manage context using OpenStruct, handle custom errors, and implement argument forwarding.

This project will also enhance your skills in structuring a Ruby codebase and creating modular, reusable code.

Tools and Concepts We'll Use

  • Argument Forwarding Operator: Introduced in Ruby 2.7, it forwards arguments from one method to another.
  • Error Handling: Custom error classes and raising exceptions.
  • OpenStruct: Flexible object that can have its attributes added at runtime.
  • self.included Hook Method: Adds behavior to a module or class when it is included in another module or class.
  • require_relative: Loads files relative to the file containing the call.
  • End-less Methods: A shorthand syntax for method definitions introduced in Ruby 3.0.

Project Structure

my_interactor/
├── lib/
│   ├── my_interactor/
│   │   ├── context.rb
│   │   └── failure.rb
│   └── my_interactor.rb
├── bin/
│   └── create_user.rb

Other Mini Projects

HTML Generator In Ruby

URL Shortener service


Pricing

Yearly

$168

  • Course: Ruby For Beginners
  • Course: Advanced Ruby
  • Mini Projects
  • All the existing resources
  • 2+ new weekly resources
  • Up-to-date content

Get started

RubyCademy ©