{"id":28376593,"url":"https://github.com/apiaryio/dredd-hooks-ruby","last_synced_at":"2025-06-26T10:30:42.039Z","repository":{"id":34323465,"uuid":"38242135","full_name":"apiaryio/dredd-hooks-ruby","owner":"apiaryio","description":" Ruby Hooks Worker for Dredd API Testing Framework","archived":true,"fork":false,"pushed_at":"2021-07-12T13:49:03.000Z","size":114,"stargazers_count":15,"open_issues_count":5,"forks_count":7,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-30T00:07:20.279Z","etag":null,"topics":["dredd","dredd-hooks","ruby","sjs-team"],"latest_commit_sha":null,"homepage":"http://dredd.rtfd.org/en/latest/hooks-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/apiaryio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-29T10:33:42.000Z","updated_at":"2024-11-08T09:04:01.000Z","dependencies_parsed_at":"2022-09-11T02:12:14.313Z","dependency_job_id":null,"html_url":"https://github.com/apiaryio/dredd-hooks-ruby","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/apiaryio/dredd-hooks-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaryio%2Fdredd-hooks-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaryio%2Fdredd-hooks-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaryio%2Fdredd-hooks-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaryio%2Fdredd-hooks-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apiaryio","download_url":"https://codeload.github.com/apiaryio/dredd-hooks-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaryio%2Fdredd-hooks-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262047766,"owners_count":23250415,"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":["dredd","dredd-hooks","ruby","sjs-team"],"created_at":"2025-05-30T00:07:20.821Z","updated_at":"2025-06-26T10:30:42.033Z","avatar_url":"https://github.com/apiaryio.png","language":"Ruby","readme":"Ruby Hooks Handler for Dredd API Testing Framework\n==================================================\n\n[![Gem Version](https://badge.fury.io/rb/dredd_hooks.svg)](http://badge.fury.io/rb/dredd_hooks)\n[![Build Status](https://travis-ci.org/apiaryio/dredd-hooks-ruby.svg?branch=master)](https://travis-ci.org/apiaryio/dredd-hooks-ruby)\n[![Code Climate](https://codeclimate.com/github/apiaryio/dredd-hooks-ruby/badges/gpa.svg)](https://codeclimate.com/github/apiaryio/dredd-hooks-ruby)\n[![Inline Docs](http://inch-ci.org/github/apiaryio/dredd-hooks-ruby.svg?branch=master)](http://inch-ci.org/github/apiaryio/dredd-hooks-ruby)\n\nTest your API with the [Dredd HTTP API testing framework](https://github.com/apiaryio/dredd) and write [hooks](http://dredd.readthedocs.org/en/latest/hooks/) in Ruby!\n\n\u003e **DISCLAIMER**: This is an early version of _dred-hooks-ruby_, please be aware that it will not be stable until **v1.0.0**. At any moment, [feedback][issues] is welcome! : )\n\n  [issues]: https://github.com/apiaryio/dredd-hooks-ruby/issues\n\nInstallation\n------------\n\nAdd the gem to your `Gemfile`:\n\n```ruby\n# Gemfile\n\ngem 'dredd_hooks', '0.1.2' # see semver.org\n```\n\nUsage\n-----\n\nCreate a hook file (the file name is arbitrary):\n\n```ruby\n# ./hooks.rb\n\nrequire 'dredd_hooks/methods'\n\ninclude DreddHooks::Methods\n\nbefore \"Machines \u003e Machines collection \u003e Get Machines\" do |transaction|\n  transaction['skip'] = \"true\"\nend\n```\n\nRun it with Dredd:\n\n```bash\n# note that the hooks file was named ./hooks.rb\ndredd apiary.apib localhost:3000 --language ruby --hookfiles ./hooks.rb\n```\n\nDocumentation\n-------------\n\n### API\n\nThe `DreddHooks::Methods` module provides the following methods to be used with [transaction names][doc-names]:\n\n- `before`\n- `after`\n- `before_validation`\n\nAnd these ones to be used without them:\n\n- `before_all`\n- `after_all`\n- `before_each`\n- `after_each`\n- `before_each_validation`\n\nSee also the official [Hooks documentation][doc-hooks].\n\n  [doc-names]: http://dredd.readthedocs.org/en/latest/hooks/#getting-transaction-names\n  [doc-hooks]: https://dredd.readthedocs.org/en/latest/hooks\n\nChange log\n----------\n\nReleases are commented to provide a [brief change log][releases], details can be found in the [`CHANGELOG`][changelog] file.\n\n  [releases]: https://github.com/gonzalo-bulnes/dredd-hooks-ruby/releases\n  [changelog]: ./CHANGELOG.md\n\nDevelopment\n-----------\n\n### Testing\n\n```bash\n# Run the test suite\nrake\n```\n\nA set of [RSpec][rspec] specs provide both a granular documentation and a unit test harness. RSpec [tags][tags] are used to categorize the spec examples.\n\nSpec examples that are tagged as `public` describe aspects of the gem public API, and MAY be considered as its documentation.\n\nThe `private` or `protected` specs are written for development purpose only. Because they describe internal behaviour which may change at any moment without notice, they are only executed as a secondary task by the [continuous integration service][travis] and SHOULD be ignored.\n\nRun `rake spec:public` to print the gem public documentation.\n\n#### Behavioral Spec\n\nA few [Cucumber][cucumber] features from the [dredd-hooks-template] provide an end-to-end test harness. The test suite is provided as a [Node.js] package and needs to be installed by `npm`:\n\n```\nnpm install\n```\n\nThen the tests can be ran using the `npm test` command, but for the Ruby paths to be correctly set, an environment variable `BUNDLE_GEMFILE` needs to be set to the path to the `Gemfile`. An example how running the end-to-end tests can look like on macOS:\n\n```\nBUNDLE_GEMFILE=$(pwd)/Gemfile npm test\n```\n\n\n  [cucumber]: https://github.com/cucumber/cucumber-js/\n  [rspec]: https://www.relishapp.com/rspec\n  [tags]: https://www.relishapp.com/rspec/rspec-core/v/3-4/docs/command-line/tag-option\n  [travis]: https://travis-ci.org/gonzalo-bulnes/simple_token_authentication/builds\n  [dredd-hooks-template]: https://github.com/apiaryio/dredd-hooks-template/\n  [Node.js]: https://nodejs.org/en/\n\n### Maintenance\n\nExtending the DSL to support new hooks is meant to be easy, see the [maintenance documentation][doc-maintenance] for details. : )\n\n  [doc-maintenance]: ./doc/README.md\n\n\u003e Refactored with [love, internet style](https://www.youtube.com/watch?v=Xe1TZaElTAs).\n\nContributing\n------------\n\n1. Fork it\n1. Create your feature branch (`git checkout -b my-new-feature`)\n1. Commit your changes (`git commit -am 'Add some feature'`)\n1. Update the `CHANGELOG`\n1. Push to the branch (`git push origin my-new-feature`)\n1. Create a new Pull Request\n\nLicense\n-------\n\nSee [`LICENSE`][license].\n\n  [license]: ./LICENSE.txt\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiaryio%2Fdredd-hooks-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapiaryio%2Fdredd-hooks-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiaryio%2Fdredd-hooks-ruby/lists"}