{"id":50469806,"url":"https://github.com/bweave/ruby-refactoring-katas","last_synced_at":"2026-06-01T09:32:50.926Z","repository":{"id":357389021,"uuid":"1235726194","full_name":"bweave/ruby-refactoring-katas","owner":"bweave","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-12T14:19:18.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T16:24:32.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bweave.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-11T15:40:58.000Z","updated_at":"2026-05-12T15:03:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bweave/ruby-refactoring-katas","commit_stats":null,"previous_names":["bweave/ruby-refactoring-katas"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bweave/ruby-refactoring-katas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweave%2Fruby-refactoring-katas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweave%2Fruby-refactoring-katas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweave%2Fruby-refactoring-katas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweave%2Fruby-refactoring-katas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bweave","download_url":"https://codeload.github.com/bweave/ruby-refactoring-katas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bweave%2Fruby-refactoring-katas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33769492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-01T09:32:50.843Z","updated_at":"2026-06-01T09:32:50.921Z","avatar_url":"https://github.com/bweave.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby Design Katas\n\nKatas for building design intuition. Each one gives you messy but working code\nand a passing test suite. Your job: refactor until the code is clean while keeping\nevery test green.\n\n## Format\n\n```\nNN_kata_name/\n  README.md               — the smell, the goal, constraints\n  name.rb                 — start here, edit freely\n  name_test.rb            — do not edit\n  name_solution.rb        — reference solution, don't peek\n```\n\n## Setup\n\n```sh\nbundle install\n```\n\n## Running\n\nRun all katas:\n\n```sh\nbundle exec rake\n```\n\nRun one kata's tests:\n\n```sh\nbundle exec ruby 01_extract_method/registration_summary_test.rb\n```\n\nRun a single test by line number:\n\n```sh\nbundle exec rake 01_extract_method/registration_summary_test.rb:42\n```\n\nWatch for changes and re-run automatically:\n\n```sh\nbin/watch                                              # all katas\nbin/watch 01_extract_method/registration_summary_test.rb  # one kata\n```\n\n## Linting and Formatting\n\n```sh\nbundle exec rubocop          # lint\nbundle exec rubocop -a       # autofix safe offenses\nbundle exec stree write **/*.rb  # format\n```\n\n## Progression\n\n| # | Kata | Smell |\n|---|------|-------|\n| 01 | Extract Method | Long method, comments as section headers |\n| 02 | Split Responsibility | One class doing two unrelated jobs |\n| 03 | Replace Conditional with Polymorphism | Case/if chains that grow with every new type |\n| 04 | Replace Temp with Query | Local variables that each compute one thing once |\n| 05 | Introduce Parameter Object | Raw hash unpacked into many local variables |\n| 06 | Null Object | Nil checks for an optional collaborator scattered across methods |\n| 07 | Feature Envy | A method more interested in another object's data than its own |\n| 08 | Guard Clause | Deeply nested conditionals (the arrow anti-pattern) |\n| 09 | Primitive Obsession | Money as a raw integer with formatting logic repeated |\n| 10 | Data Clump | Fields that always travel together but live as separate attributes |\n| 11 | Message Chain | Reaching through an object graph two or three hops deep |\n| 12 | Collection Pipeline | Imperative loops where Enumerable methods would name the intent |\n| 13 | Decompose Conditional | A complex boolean condition that requires translation to understand |\n| 14 | Tell Don't Ask | Asking an object's state externally and deciding what to do yourself |\n| 15 | Encapsulate Collection | A raw collection exposed via attr_reader that callers can freely mutate |\n| 16 | Introduce Value Object | A multi-field concept (day, time, zone) treated as separate raw scalars |\n| 17 | Replace Inheritance with Delegation | Inheriting a utility class just to borrow a few methods |\n| 18 | Middle Man | A class that does nothing but proxy every call to another object |\n| 19 | Query Object | Repeated filter conditions scattered across methods instead of composed |\n| 20 | Shotgun Surgery | Adding one new tier forces small edits across four separate methods |\n\n## Rules\n\n1. Tests must stay green the entire time — not just at the end.\n2. Refactoring changes *how* code works, not *what* it does. No new behavior.\n3. Name the smell before you fix it. The name picks the refactoring.\n4. Small steps. Run tests after each one. Revert if something goes red.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbweave%2Fruby-refactoring-katas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbweave%2Fruby-refactoring-katas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbweave%2Fruby-refactoring-katas/lists"}