{"id":15605690,"url":"https://github.com/gangelo/thor_nested_subcommand","last_synced_at":"2025-05-07T13:45:05.364Z","repository":{"id":60946238,"uuid":"546887087","full_name":"gangelo/thor_nested_subcommand","owner":"gangelo","description":"A gem that allows you to patch the Thor gem bug that displays subcommand help incorrectly","archived":false,"fork":false,"pushed_at":"2024-10-28T18:37:24.000Z","size":38,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T04:35:46.821Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gangelo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-10-06T20:14:33.000Z","updated_at":"2024-08-03T13:27:44.000Z","dependencies_parsed_at":"2023-12-27T22:38:48.610Z","dependency_job_id":"a92575f6-f8a1-44b1-be85-7d092b6ec033","html_url":"https://github.com/gangelo/thor_nested_subcommand","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"2b43437330ee2f967c8e496cf27f86f9114b56e9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangelo%2Fthor_nested_subcommand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangelo%2Fthor_nested_subcommand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangelo%2Fthor_nested_subcommand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangelo%2Fthor_nested_subcommand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gangelo","download_url":"https://codeload.github.com/gangelo/thor_nested_subcommand/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252889604,"owners_count":21820214,"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":[],"created_at":"2024-10-03T04:11:26.752Z","updated_at":"2025-05-07T13:45:05.339Z","avatar_url":"https://github.com/gangelo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Ruby](https://github.com/gangelo/thor_nested_subcommand/actions/workflows/ruby.yml/badge.svg?refresh=12)](https://github.com/gangelo/thor_nested_subcommand/actions/workflows/ruby.yml)\n[![GitHub version](http://badge.fury.io/gh/gangelo%2Fthor_nested_subcommand.svg?refresh=12)](https://badge.fury.io/gh/gangelo%2Fthor_nested_subcommand)\n[![Gem Version](https://badge.fury.io/rb/thor_nested_subcommand.svg?refresh=12)](https://badge.fury.io/rb/thor_nested_subcommand)\n[![](http://ruby-gem-downloads-badge.herokuapp.com/thor_nested_subcommand?type=total)](http://www.rubydoc.info/gems/thor_nested_subcommand/)\n[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/thor_nested_subcommand/)\n[![Report Issues](https://img.shields.io/badge/report-issues-red.svg)](https://github.com/gangelo/thor_nested_subcommand/issues)\n[![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg)](#license)\n\n# ThorNestedSubcommand\n\n`ThorNestedSubcommand` is a Ruby gem that provides a workaround for the [Thor gem](https://rubygems.org/gems/thor) bug that displays nested subcommand help incorrectly. Simply include the `ThorNestedSubcommand` module in your Thor nested subcommand, and provide a simple class method to return what Thor help shoul be displaying, and that's it.\n\n## Usage\n\nFirst, follow instructions for [installation](#installation).\n\nSecondly, do the following in your Thor `subcommand`:\n* include the `ThorNestedSubcommand`.\n* Add a `.base_name` class method and return the base name for the nested `subcommand` you need Thor help to display.\n\nFor example:\n\n```ruby\nrequire 'thor'\nrequire 'thor_nested_subcommand'\n\nclass Command \u003c ::Thor\n  desc 'sub_command SUBCOMMAND', 'sub command'\n  subcommand :sub_command, SubCommand\nend\n\nclass SubCommand \u003c ::Thor\n    desc 'nested_sub_command SUBCOMMAND', 'nested sub command'\n    subcommand :nested_sub_command, NestedSubCommand\nend\n\n# Thor help breaks because this is a nested subcommand.\nclass NestedSubCommand \u003c ::Thor\n  # Include this:\n  include ThorNestedSubcommand\n\n  class \u003c\u003c self\n    # Add this:\n    def base_usage\n      # Return what Thor shoud be displaying for your nested subcommand:\n      'sub_command nested_sub_command'\n    end\n  end\n\n  desc 'test', 'test the command'\n  def test\n    puts 'test'\n  end\nend\n```\n\nThat's it. Disaster averted:\n\n```shell\n$ command sub_command help nested_sub_command\n\u003e Commands:\n\u003e  command sub_command nested_sub_command help [COMMAND]   # Describe subcommands or one specific subcommand\n\u003e  command sub_command nested_sub_command test             # test sub sub command\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'thor_nested_subcommand'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install thor_nested_subcommand\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/thor_nested_subcommand. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/thor_nested_subcommand/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the ThorNestedSubcommand project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/thor_nested_subcommand/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangelo%2Fthor_nested_subcommand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgangelo%2Fthor_nested_subcommand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangelo%2Fthor_nested_subcommand/lists"}