This repository showcases a series of Ruby-based scripting projects focused on command-line utilities, class extensions, encryption algorithms, and object-oriented programming.
Each script demonstrates practical problem-solving and clean, modular code design.
Extends Ruby’s built-in Array class:
- Custom
[]method returns'\0'for out-of-bounds access. - Enhanced
mapmethod supports optional step or range selection.
Command-line grep-like utility with multiple options:
-wword search-pregex match (default)-vinverse match-ccount matching lines-mextract matching fragments
Includes:
test.txtsample inputtest_rgrep.shscript for automated test runs- Screenshot:
Problem02-Terminal-Screenshot.png
Implements a cascading sum encryption algorithm:
- Each iteration reduces a digit sequence
- Final output is a 2-digit encrypted result
OOP hierarchy simulating vehicles:
Vehicle,MyCar,MyTruck, andElectricCarclasses- Modules:
TowableandSelfDriving - Functionality includes speed control, repainting, towing, mileage, and battery management
ruby array.rb
ruby rgrep.rb test.txt -w road
ruby pascal_triangle.rb
ruby vehicle.rb
bash test_rgrep.sh