Ruby Interpreter Options & How to Use Them Correctly

A Ruby interpreter is a program that reads & runs Ruby code. But… Did you know that the default Ruby interpreter (MRI) has lots of interesting & useful command-line options? Like: ruby -v Which gives you the Ruby version you are using right now. Or the -e flag which allows you to run a bit … Read more

How to Tell Your Ruby Program to Stop Running Early

How do you stop a Ruby program early? Normally a program will run until it’s done processing all the instructions. Or until it raises an exception that doesn’t get handled. But if you’re writing a Ruby program that doesn’t need to be running all the time, you may want to stop your program early for … Read more

7 Interesting Ruby Code Examples

One way to learn new Ruby tricks, patterns & methods is to read code others have written. But where do you find interesting code worth reading? We have many open source projects, and coding challenge sites that allow you to see the solutions from other developers once you submit your own. In this article: I … Read more

How to Write Your Own Classes in Ruby (Explained Clearly)

What is a class in Ruby? Classes are the basic building blocks in Object-Oriented Programming (OOP) & they help you define a blueprint for creating objects. Objects are the products of the class. So what is an object? An object is an individual “thing”, with its own identity & its own data. For example: A … Read more

What is Rake in Ruby & How to Use it

Rake is a popular task runner in Ruby. What is a task? Making a backup of your database Running your tests Gathering & reporting stats These are small tasks that without Rake would be scattered all over your project on different files. Rake centralizes access to your tasks. Rake also makes a few things easier, … Read more