{"id":16746817,"url":"https://github.com/ohbarye/rusky","last_synced_at":"2025-04-10T13:43:35.967Z","repository":{"id":56893877,"uuid":"101889918","full_name":"ohbarye/rusky","owner":"ohbarye","description":"💎 + 🐶 = Rusky, it helps you to manage Git hooks easily.","archived":false,"fork":false,"pushed_at":"2023-12-15T14:57:58.000Z","size":46,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:21:52.220Z","etag":null,"topics":["gem","git","githook","hooks","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rusky","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/ohbarye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2017-08-30T14:14:39.000Z","updated_at":"2025-03-21T01:50:04.000Z","dependencies_parsed_at":"2025-02-17T10:41:42.598Z","dependency_job_id":null,"html_url":"https://github.com/ohbarye/rusky","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbarye%2Frusky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbarye%2Frusky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbarye%2Frusky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohbarye%2Frusky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohbarye","download_url":"https://codeload.github.com/ohbarye/rusky/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248226361,"owners_count":21068188,"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","git","githook","hooks","ruby"],"created_at":"2024-10-13T02:08:25.311Z","updated_at":"2025-04-10T13:43:35.946Z","avatar_url":"https://github.com/ohbarye.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rusky\n\nRusky is a lightweight library which helps you to manage Git hooks easily. Once you set up Rusky, it would be beneficial for all your team.\n\nThis library is inspired an awesome npm library, [husky](https://github.com/typicode/husky). So Rusky = Ruby + husky.\n\nIf you don't know Git hooks well, [the official document](https://git-scm.com/docs/githooks) would help you.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rusky', group: :development\n```\n\nAnd then execute:\n\n```console\n$ bundle\n```\n\nOr install it yourself as:\n\n```console\n$ gem install rusky\n```\n\nAfter installation, Rusky automatically creates git hook scripts in `.git/hooks` directory. It does not remove existing files.\n\n## Usage\n\n1. Add the following lines into your `Rakefile` (or [any other rake file](https://github.com/ruby/rake/blob/68ef9140c11d083d8bb7ee5da5b0543e3a7df73d/lib/rake/application.rb#L41-L46)). It defines rake tasks to be executed on Git hook. The task names are `\"rusky:#{git_hook_name}\"`.\n\n```ruby\nrequire \"rusky/task\"\nRusky::Task.install\n```\n\n2. Create `.rusky` file and define what you want on Git hooks as YAML. Keys should be Git hook name. Values should be an array of shell commands. Rusky executes those commands on Git hook.\n\n```yaml\n# .rusky\npre-commit:\n  - rubocop\npre-push:\n  - bundle exec rspec\n```\n\n### Manual installation\n\nAlthough Rusky automatically creates necessary files, it provides CLI for (un)installation as well. It would be useful when you want to retry (un)install.\n\n```console\nrusky -h\nCommands:\n  rusky help [COMMAND]  # Describe available commands or one specific command\n  rusky install         # Generate Git hooks and .rusky files\n  rusky uninstall       # Remove files generated by rusky\n  rusky version         # Show current version\n\nOptions:\n  -h, [--help], [--no-help]        # Show help message.\n  -v, [--version], [--no-version]  # Show current version\n```\n\n### Customizable callback rake task\n\nYou can write your own rake task as a callback of Git hook.\n\n```ruby\n# Rakefile\nrequire \"rusky/task\"\n\nnamespace :rusky do\n  task :pre_commit do\n    # Your awesome task\n  end\nend\n\nRusky::Task.install\n```\n\nNOTE: You have to call `Rusky::Task.install` after your task definition. Otherwise, the task is defined twice. According to the current Rake spec, such a duplicated task does not overwrite a former one, both run when calling the task.  \n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` 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/ohbarye/rusky. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\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%2Fohbarye%2Frusky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohbarye%2Frusky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohbarye%2Frusky/lists"}