{"id":19816900,"url":"https://github.com/rvm/thor_extend","last_synced_at":"2025-05-01T10:33:18.765Z","repository":{"id":31017808,"uuid":"34576293","full_name":"rvm/thor_extend","owner":"rvm","description":"Dynamically extend options on a Thor::Command","archived":false,"fork":false,"pushed_at":"2020-03-17T10:55:14.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-26T23:09:52.923Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rvm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-25T16:34:26.000Z","updated_at":"2020-10-06T23:25:48.000Z","dependencies_parsed_at":"2022-09-08T18:20:32.222Z","dependency_job_id":null,"html_url":"https://github.com/rvm/thor_extend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Fthor_extend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Fthor_extend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Fthor_extend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvm%2Fthor_extend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvm","download_url":"https://codeload.github.com/rvm/thor_extend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251860574,"owners_count":21655769,"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-11-12T10:11:00.737Z","updated_at":"2025-05-01T10:33:18.429Z","avatar_url":"https://github.com/rvm.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ThorExtend\n\nThorExtend adds options to already defined Thor commands.\nNormally, you define options like this:\n\n```ruby\nrequire 'thor'\nclass MyCLI \u003c Thor\n  option :arg1\n  option :arg2\n  def action\n    #...\n  end\nend\n```\n\nThis is only works if you know the options upfront but not if you need to define them at runtime dynamically.\nWith ThorExtend you can add those when the cli class is already loaded:\n\n```ruby\nextender = ThorExtend.new(MyCLI)\nextender.command(\"action\").add(:arg3, {})\n```\n\nHere you add `arg3` to the `action` command.\nThe hash which is passed to `add` contains options you would normally pass additionally, e.g. a `type`.\nExample:\n\n```ruby\noption :yesno, :type =\u003e :boolean\ndef action\nend\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'ThorExtend'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install ThorExtend\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, 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` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\n1. Fork it ( https://github.com/[my-github-username]/ThorExtend/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvm%2Fthor_extend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvm%2Fthor_extend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvm%2Fthor_extend/lists"}