{"id":21633754,"url":"https://github.com/dgroomes/ruby-playground","last_synced_at":"2026-05-21T04:01:31.710Z","repository":{"id":242378852,"uuid":"809378784","full_name":"dgroomes/ruby-playground","owner":"dgroomes","description":"📚 Learning and exploring the Ruby programming language","archived":false,"fork":false,"pushed_at":"2024-06-02T20:02:13.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T22:39:11.210Z","etag":null,"topics":["ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgroomes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-02T14:25:08.000Z","updated_at":"2024-06-02T20:02:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f164e363-e5a9-4080-8682-a3eecf7d70eb","html_url":"https://github.com/dgroomes/ruby-playground","commit_stats":null,"previous_names":["dgroomes/ruby-playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dgroomes/ruby-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fruby-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fruby-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fruby-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fruby-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgroomes","download_url":"https://codeload.github.com/dgroomes/ruby-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgroomes%2Fruby-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33288120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T02:57:32.698Z","status":"ssl_error","status_checked_at":"2026-05-21T02:57:31.990Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby"],"created_at":"2024-11-25T03:13:42.639Z","updated_at":"2026-05-21T04:01:31.704Z","avatar_url":"https://github.com/dgroomes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ruby-playground\n\n📚 Learning and exploring the Ruby programming language.\n\n\n## Overview\n\nThis repository is me learning Ruby and specifically the surrounding toolchain and basic language features. I'm reading\n(or at least partially reading) the classic [Programming Ruby](https://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-edition/)\nbook.\n\n\n## Instructions\n\nFollow these instructions to explore Ruby via various scripts and programs.\n\n1. Pre-requisite: Ruby\n   * I used Ruby 3.3.2 installed with `rbenv`\n2. Run a basic script\n   * ```shell\n     ruby hello_world.rb \n     ```\n   * The commandline and output will look something like the following.\n   * ```text\n     $ ruby hello_world.rb \n     \n     Hello programmer 👋 You rock with 100% intensity!\n     ```\n   * Using Ruby directly is great for learning and writing scripts (even sophisticated ones) that use only the Ruby\n     standard library and pre-installed Gems (packages). But, we eventually need to expand our program to include\n     third-party packages. We do this in all programming languages. Let's jump right into Bundler and figure out how to\n     manage our project and development workflow using the idiomatic Ruby toolchains.\n3. Install packages\n   * ```shell\n     bundle install\n     ```\n   * This installs the packages listed in `Gemfile.lock`. We are depending on the `irb` and `debug` gems which we will\n     explore next.\n4. Write Ruby interactively\n   * Start an interactive Ruby REPL (irb is short for \"interactive Ruby\") with the following command.\n   * ```shell\n     bundle exec irb\n     ```\n   * Try out some code. This is a fast way to validate your understanding of Ruby syntax and a low stakes way to try out\n     some random code. Here is what my exploration looked like.\n   * ```text\n     $ bundle exec irb\n     irb(main):001\u003e puts :hi if true\n     hi\n     =\u003e nil\n     irb(main):002\u003e :hi.inspect\n     =\u003e \":hi\"\n     irb(main):003\u003e :hi.inspect.inspect\n     =\u003e \"\\\":hi\\\"\"\n     irb(main):004\u003e :hi.class\n     =\u003e Symbol\n     irb(main):005\u003e\n     ```\n   * Try sourcing some code and using it. Use the following command from the Ruby REPL.\n   * ```text\n     load './Envelope.rb'\n     env = Envelope.new(\"hello\")\n     env.message\n     ```\n5. Debug a program\n   * ```shell\n     bundle exec rdbg hello_world.rb\n     ```\n   * Use the power of the debugger to interactively step through the code, inspect variables and change the program\n     state. My exploration looked like the following.\n   * ```text\n     $ bundle exec rdbg hello_world.rb\n     [1, 6] in hello_world.rb\n          1| # frozen_string_literal: true\n          2| \n     =\u003e   3| msg_template = \"Hello %s 👋 You rock with %s%% intensity!\"\n          4| msg = msg_template % ['programmer', 100]\n          5| \n          6| puts msg\n     =\u003e#0    \u003cmain\u003e at hello_world.rb:3\n     (rdbg) s    # step command\n     [1, 6] in hello_world.rb\n          1| # frozen_string_literal: true\n          2| \n          3| msg_template = \"Hello %s 👋 You rock with %s%% intensity!\"\n     =\u003e   4| msg = msg_template % ['programmer', 100]\n          5| \n          6| puts msg\n     =\u003e#0    \u003cmain\u003e at hello_world.rb:4\n     (ruby) msg_template = \"Hello from the debugger\"\n     \"Hello from the debugger\"\n     (rdbg) c    # continue command\n     Hello from the debugger\n     ```\n     \n   \n\n## Wish List\n\nGeneral clean-ups, TODOs and things I wish to implement for this project:\n\n* [x] DONE Let's get something running\n* [x] DONE (interestingly, Bundler comes pre-installed with Ruby these days) How does package management work? Ruby Gems of course, but what is the package manager?\n   * I think I'd like to combine some toolchain/package stuff with type checking (Sorbet). I know type checking isn't\n     really the spirit of Ruby but Homebrew does it and that's what I'm trying to study, plus I benefit from types once\n     we expand past a small program size.\n   * DONE (you have to make it yourself. Perfectly fine.) Init a Gemfile\n   * DONE (`bundle add debug --version '1.9.2'`) Add 'debug' to the Gemfile\n   * DONE Add instructions for bundle install and running hello_world.rb with a specific version of irb.\n* [ ] How does modularization work in Ruby? Packages?\n   * How are files discovered? Is there a search path?\n* [x] DONE How does debugging work in Ruby? Does it have something like an agent, like the JVM does?\n* [ ] What is `frozen_string_literal`?\n* [x] DONE (I mostly get it. The top-level self is \"main\". And the really tricky part is that in class initialization,\n  \"self\" is actually the class so that's why `def self.hello ...` is actually a class-level variable even though it\n  really feels like an instance-thing) How does resolution work in general? What does `self` do? Is it implicit?\n\n\n## Reference\n\n* [rbenv](https://github.com/rbenv/rbenv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroomes%2Fruby-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgroomes%2Fruby-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgroomes%2Fruby-playground/lists"}