Ruby
Ruby is a dynamic, open-source programming language focused on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. Ruby is widely used for web development, scripting, automation, and prototyping, with its most famous framework being Ruby on Rails.
🌟 Key Concepts
- Object-Oriented: Everything in Ruby is an object, including primitive data types.
- Dynamic Typing: Types are determined at runtime, allowing for flexible and expressive code.
- Garbage Collection: Automatic memory management.
- Readable Syntax: Designed to be intuitive and close to natural language.
- Metaprogramming: Ruby allows code to modify itself at runtime.
📚 Books & Documentation
🛠️ Useful Links & Tools
- Clean code ruby – Clean Code concepts adapted for Ruby
- Using Ruby in 2019
- Sorbet – Fast, powerful type checker for Ruby (GitHub)
- Referral – Scan for definitions and references in your Ruby code
- Artichoke – Ruby made with Rust
- rubyfmt – Ruby Autoformatter
- Ruby Next – Transpiler for Ruby (HN)
- Rutie – Integrate Ruby with Rust
- ruruby – Alternative Ruby implementation in Rust
- How to Fix Slow Code in Ruby (Shopify) (HN)
- Install Ruby on CentOS/RHEL
- Edabit Ruby Challenges
- Ruby is nice, but what makes great? (Reddit)
🛠️ Common Commands
ruby -v # Show Ruby version
irb # Start interactive Ruby shell
gem install <gem> # Install a Ruby gem (library)
gem list # List installed gems
ruby script.rb # Run a Ruby script
bundle install # Install dependencies from Gemfile
rails new myapp # Create a new Rails app (if Rails installed)
📝 Notes
- Ruby is especially popular for rapid web development with Ruby on Rails.
- Gems are Ruby’s package management system for sharing libraries and tools.
- Ruby’s community is known for being friendly and helpful.