{"id":20081981,"url":"https://github.com/exercism/ruby","last_synced_at":"2025-12-18T01:09:49.675Z","repository":{"id":14543789,"uuid":"17258847","full_name":"exercism/ruby","owner":"exercism","description":"Exercism exercises in Ruby.","archived":false,"fork":false,"pushed_at":"2024-05-23T06:29:43.000Z","size":4027,"stargazers_count":529,"open_issues_count":8,"forks_count":508,"subscribers_count":30,"default_branch":"main","last_synced_at":"2024-05-23T08:56:37.723Z","etag":null,"topics":["community-contributions-paused","exercism-track"],"latest_commit_sha":null,"homepage":"https://exercism.org/tracks/ruby","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exercism.png","metadata":{"funding":{"github":["exercism"],"custom":["https://exercism.org/donate"]},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-27T18:11:43.000Z","updated_at":"2024-05-28T17:13:14.950Z","dependencies_parsed_at":"2024-01-11T23:44:13.164Z","dependency_job_id":"adf02c3f-8640-4ea4-9cdd-ad144fabaeff","html_url":"https://github.com/exercism/ruby","commit_stats":{"total_commits":2171,"total_committers":310,"mean_commits":7.003225806451613,"dds":0.8272685398433901,"last_synced_commit":"c0e0a1ad78875003e45ed8b991d8d6390533a0f7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exercism%2Fruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exercism","download_url":"https://codeload.github.com/exercism/ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604610,"owners_count":20804099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["community-contributions-paused","exercism-track"],"created_at":"2024-11-13T15:41:14.164Z","updated_at":"2025-12-18T01:09:44.618Z","avatar_url":"https://github.com/exercism.png","language":"Ruby","funding_links":["https://github.com/sponsors/exercism","https://exercism.org/donate"],"categories":[],"sub_categories":[],"readme":"# Exercism Ruby Track\n\n[![Configlet Status][configlet-workflow-badge]][configlet-workflow]\n[![Exercise Test Status][tests-workflow-badge]][tests-workflow]\n\nExercism Exercises in Ruby\n\n## Table of Contents\n\n- [Setup][#setup]\n- [Anatomy of an Exercise][#anatomy-of-an-exercise]\n  - [Canonical Data][#canonical-data]\n- [Running the Tests][#running-the-tests]\n- [Pull Requests][#pull-requests]\n  - [Style Guide][#style-guide]\n- [READMEs][#readmes]\n- [Contributing Guide][#contributing-guide]\n- [Ruby icon][#ruby-icon]\n\n## Setup\n\nYou'll need a recent (2.6+) version of Ruby, but that's it.\nMinitest ships with the language, so you're all set.\n\n## Anatomy of an Exercise\n\nThe files for an exercise live in `exercises/\u003cslug\u003e`.\nThe slug for an exercise is a unique nickname composed of a-z (lowercase) and -, e.g. `clock` or `atbash-cipher`. Inside its directory, each exercise has:\n\n* a test suite, `\u003cexercise_name\u003e_test.rb`\n* an example solution, `.meta/solutions/\u003cexercise_name\u003e.rb`\n\nwhere `\u003cexercise_name\u003e` is the underscored version of the exercise's slug, e.g., `clock` or `atbash_cipher`.\n\nIf the exercise has a test generator, the directory will also contain:\n\n* the test generator, `.meta/generator/\u003cexercise_name\u003e_case.rb`\n\nA few exercises use a custom test template:\n\n* `.meta/generator/test_template.erb`\n\n### Canonical Data\n\n**Most exercises can be generated from shared inputs/outputs, called canonical data (see [Generated Test Suites][#generated-test-suites] below).** To find out whether a test has canonical data, check the [problem-specifications repo][canonical exercises].\n\n## Running the Tests\n\nRun the tests using `rake`, rather than `ruby path/to/the_test.rb`.\n`rake` knows to look for the example solution and to disable skips.\nJust tell `rake` the name of your problem and you are set:\n\n```sh\nrake test:clock\n```\n\nTo pass arguments to the test command, like `-p` for example, you can run the\nfollowing:\n\n```sh\nrake test:clock -- -p\n```\n\nTo run a subset of the tests, use a regular expression.\nFor example, if tests exist that are named identical_to_4_places, and identical, then we can run both tests with\n\n```sh\nrake test:hamming -- -p -n=\"/identical/\"\n```\n\nNote that flags which have an attached value, like above, must take the form `-flag=value` and if `value` has spaces `-flag=\"value with spaces\"`.\n\n## Pull Requests\n\nWe welcome pull requests that provide fixes to existing test suites (missing tests, interesting edge cases, improved APIs), as well as new problems.\n\nIf you're unsure, then go ahead and open a GitHub issue, and we'll discuss the change.\n\nPlease submit changes to a single problem per pull request unless you're submitting a general change across many of the problems (e.g. formatting).\n\nYou can run (some) of the same checks that we run by running the following tool in your terminal:\n\n    bin/local-status-check\n\nIf you would like to have these run right before you push your commits, you can activate the hook by running this tool in your terminal:\n\n    bin/setup-git-hoooks\n\nThank you so much for contributing! :sparkles:\n\n### Style Guide\n\nWe have created a minimal set of guidelines for the testing files, which you can take advantage of by installing the `rubocop` gem.\nIt will use the configuration file located in the root folder, `.rubocop.yml`.\nWhen you edit your code, you can simply run `rubocop -D`.\nIt will ignore your example solution, but will gently suggest style for your test code.\n\nThe `-D` option that is suggested is provided to give you the ability to easily ignore the Cops that you think should be ignored.\nThis is easily done by doing `# rubocop:disable CopName`, where the `CopName` is replaced appropriately.\n\nFor more complete information, see [Rubocop][rubocop].\n\nWhile `lib/generator/exercise_case.rb` provides helper functions as discussed above, it remains the responsibility of an exercise's generator to interpret its canonical-data.json data in a stylistically correct manner, e.g.  converting string indices to integer indices.\n\n## READMEs\n\nAll exercises must have a README.md file, but should not be created manually.\nThe READMEs are constructed using shared metadata, which lives in the [problem-specifications][] repo.\n\nUse the `configlet` tool to generate a README from shared metadata:\n\n1. Clone the [problem-specifications][] repo into an adjacent directory.\n2. Fetch the configlet appropriate for your system: `bin/fetch-configlet`\n3. Generate the readme for a particular exercise: `bin/configlet generate . --only rotational-cipher`\n\n## Contributing Guide\n\nIf adding a new exercise:\n\n* a [generator][#implementing-a-generator] should be implemented.\n* a minimal, partial, solution should be able to be pushed, in order to create a WIP pull request.\n\nFor an in-depth discussion of how exercism language tracks and exercises work, please see the [contributing guide][contributing guide].\n\nIf you're just getting started and looking for a helpful way to get involved, take a look at [regenerating the test suites][#regenerating-a-test-suite], [porting an exercise from another language][port exercise], or [creating an automated test generator][#implementing-a-generator].\n\nWe are also available at our community forum: [building-exercism]\n\n## Ruby icon\n\nThe Ruby icon is the Vienna.rb logo, and is used with permission. Thanks Floor\nDress :)\n\n[#anatomy-of-an-exercise]: #anatomy-of-an-exercise\n[assertion]: https://github.com/exercism/ruby/blob/master/lib/generator/exercise_case/assertion.rb\n[building-exercism]: https://forum.exercism.org/c/general/building-exercism/125\n[#canonical-data]: #canonical-data\n[canonical data]: https://github.com/exercism/problem-specifications/tree/master/exercises\n[canonical exercises]: https://github.com/exercism/problem-specifications/tree/master/exercises\n[#changing-a-generated-exercise]: #changing-a-generated-exercise\n[configlet-workflow-badge]: https://github.com/exercism/ruby/actions/workflows/configlet.yml/badge.svg\n[configlet-workflow]: https://github.com/exercism/ruby/actions/workflows/configlet.yml\n[configure the remote]: https://help.github.com/articles/configuring-a-remote-for-a-fork/\n[#contributing-guide]: #contributing-guide\n[contributing-guide]: https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data\n[default template]: https://github.com/exercism/ruby/blob/master/lib/generator/test_template.erb\n[exercism ruby]: https://github.com/exercism/ruby\n[#generated-test-suites]: #generated-test-suites\n[helper]: https://github.com/exercism/ruby/blob/master/lib/generator/exercise_case.rb\n[#implementing-a-generator]: #implementing-a-generator\n[port exercise]: https://github.com/exercism/docs/blob/master/you-can-help/implement-an-exercise-from-specification.md\n[problem-specifications]: https://github.com/exercism/problem-specifications\n[problem-specifications]: https://github.com/exercism/problem-specifications\n[#pull-requests]: #pull-requests\n[#readmes]: #readmes\n[rebasing documentation]: https://help.github.com/articles/about-git-rebase/\n[#regenerating-a-test-suite]: #regenerating-a-test-suite\n[#regenerating-a-test-suite]: #regenerating-a-test-suite\n[#ruby-icon]: #ruby-icon\n[#running-the-tests]: #running-the-tests\n[rubocop]: http://batsov.com/rubocop/\n[#setup]: #setup\n[#style-guide]: #style-guide\n[synchronize]: https://help.github.com/articles/syncing-a-fork/\n[tests-workflow-badge]: https://github.com/exercism/ruby/actions/workflows/exercise-tests.yml/badge.svg\n[tests-workflow]: https://github.com/exercism/ruby/actions/workflows/exercise-tests.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexercism%2Fruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexercism%2Fruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexercism%2Fruby/lists"}