AsifulNobel / learning-ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learning Ruby

This repository contains scripts and programs that I write while learning a new Ruby concept.

How to Run

Install the Ruby interpreter using your OS package manager, if you are using Linux or MacOS. Otherwise download it from ruby-lang download page. I used the asdf version manager to install v3.0.1 in my Ubuntu WSL2 dev environment.

After installation, run the following command from terminal to run a script -

ruby <path-to-a-ruby-file>

To activate the rubocop settings, run the following command to install rubocop gem (Ruby packages are called gems) -

gem install rubocop

This is optional. But to freeze literal strings during execution, run the following command -

ruby --enable=frozen-string-literal <path-to-a-ruby-file>

To know more about frozen literal strings, check this out.

How I Started Learning Ruby

When starting out, I checked the official Ruby documentation and various communities such as Ruby sub-reddit, Discord server. The official documentation contained too much information and the books section had books for total beginners. So, I chose to not use those.

The communities suggested the following book - The Well-Grounded Rubyist by David A. Black and Joseph Leo III. After going through the table of content and a few pages of the book, it seemed like a good book to start with for experienced programmers. I wrote the initial scripts while reading that book. But those scripts are not examples or exercises of that book. Those are merely things that I tried out myself. The book was there just to give me a structured way to learn Ruby concepts and get familiar with some of the quirks of the language.

Helpful VS Code Extensions

While coding Ruby scripts in VS Code, the following extensions felt useful for syntax highlighting, code completion and debugging -

License

This repository is licensed under the MIT License.

About

License:MIT License


Languages

Language:Ruby 100.0%