{"id":20019670,"url":"https://github.com/kddnewton/thor-hollaback","last_synced_at":"2025-05-09T00:10:54.003Z","repository":{"id":37858860,"uuid":"68935573","full_name":"kddnewton/thor-hollaback","owner":"kddnewton","description":"Adds callbacks to thor commands","archived":false,"fork":false,"pushed_at":"2025-04-29T13:23:02.000Z","size":398,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-29T14:38:28.913Z","etag":null,"topics":["gem","ruby","thor"],"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/kddnewton.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null},"funding":{"github":"kddnewton"}},"created_at":"2016-09-22T15:34:40.000Z","updated_at":"2025-04-29T13:23:06.000Z","dependencies_parsed_at":"2023-10-11T16:59:58.221Z","dependency_job_id":"79e506ab-2939-4ed5-b1bb-88b2ad78eec4","html_url":"https://github.com/kddnewton/thor-hollaback","commit_stats":{"total_commits":245,"total_committers":5,"mean_commits":49.0,"dds":"0.17142857142857137","last_synced_commit":"bcf5b5f976aae11660cd8e83dd3f2efc635b1340"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kddnewton%2Fthor-hollaback","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kddnewton%2Fthor-hollaback/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kddnewton%2Fthor-hollaback/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kddnewton%2Fthor-hollaback/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kddnewton","download_url":"https://codeload.github.com/kddnewton/thor-hollaback/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166521,"owners_count":21864482,"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":["gem","ruby","thor"],"created_at":"2024-11-13T08:28:23.454Z","updated_at":"2025-05-09T00:10:53.981Z","avatar_url":"https://github.com/kddnewton.png","language":"Ruby","funding_links":["https://github.com/sponsors/kddnewton"],"categories":[],"sub_categories":[],"readme":"# Thor::Hollaback\n\n[![Build Status](https://github.com/kddnewton/thor-hollaback/workflows/Main/badge.svg)](https://github.com/kddnewton/thor-hollaback/actions)\n[![Gem Version](https://img.shields.io/gem/v/thor-hollaback.svg)](https://rubygems.org/gems/thor-hollaback)\n\nAdds callbacks to thor commands.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"thor-hollaback\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install thor-hollaback\n\n## Usage\n\nUses the [`hollaback`](https://github.com/kddnewton/hollaback) gem to add callbacks to [`thor`](https://github.com/erikhuda/thor) commands. You can set CLI-level callbacks with the macros `class_before`, `class_after`, and `class_around`. You can set command-level callbacks with `before`, `after`, and `around`. Example below.\n\n```ruby\nclass CLI \u003c Thor\n  class_before :say_hello\n  class_after :say_goodbye\n\n  desc \"first_test\", \"First test command\"\n  around :say\n  def first_test\n    puts \"How are you?\"\n  end\n\n  desc \"second_test\", \"Second test command\"\n  def second_test\n    puts \"How are you?\"\n  end\n\n  no_commands do\n    def say_hello\n      puts \"Hello!\"\n    end\n\n    def say_goodbye\n      puts \"Goodbye!\"\n    end\n\n    def say\n      puts \"Speaking...\"\n      yield\n      puts \"...done.\"\n    end\n  end\nend\n```\n\nWhen invoked, the above CLI results with:\n\n```\nirb(main):001:0\u003e CLI.start([\"first_test\"])\nHello!\nSpeaking...\nHow are you?\n...done.\nGoodbye!\n=\u003e nil\n```\n\nand\n\n```\nirb(main):001:0\u003e CLI.start([\"second_test\"])\nHello!\nHow are you?\nGoodbye!\n=\u003e nil\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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 tags, 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/kddnewton/thor-hollaback.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkddnewton%2Fthor-hollaback","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkddnewton%2Fthor-hollaback","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkddnewton%2Fthor-hollaback/lists"}