This repository contains scripts and programs that I write while learning a new Ruby concept.
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.
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.
While coding Ruby scripts in VS Code, the following extensions felt useful for syntax highlighting, code completion and debugging -
This repository is licensed under the MIT License.