{"id":20080554,"url":"https://github.com/nakiostudio/stubify","last_synced_at":"2025-05-05T23:31:19.374Z","repository":{"id":56896798,"uuid":"84807146","full_name":"nakiostudio/stubify","owner":"nakiostudio","description":"Create stub environments the easy way","archived":false,"fork":false,"pushed_at":"2019-02-06T18:58:18.000Z","size":13,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T03:16:18.994Z","etag":null,"topics":["environment","gem","integration-tests","mock","mocked-server","ruby-gem","server","sinatra","stub","stub-environment","tests","thin"],"latest_commit_sha":null,"homepage":"","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/nakiostudio.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":"2017-03-13T09:21:10.000Z","updated_at":"2025-02-07T17:03:35.000Z","dependencies_parsed_at":"2022-08-21T01:20:38.926Z","dependency_job_id":null,"html_url":"https://github.com/nakiostudio/stubify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakiostudio%2Fstubify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakiostudio%2Fstubify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakiostudio%2Fstubify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakiostudio%2Fstubify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nakiostudio","download_url":"https://codeload.github.com/nakiostudio/stubify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252593014,"owners_count":21773387,"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":["environment","gem","integration-tests","mock","mocked-server","ruby-gem","server","sinatra","stub","stub-environment","tests","thin"],"created_at":"2024-11-13T15:28:58.648Z","updated_at":"2025-05-05T23:31:19.053Z","avatar_url":"https://github.com/nakiostudio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stubify\n\n[![Twitter: @carlostify](https://img.shields.io/badge/contact-@carlostify-blue.svg?style=flat)](https://twitter.com/carlostify)\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/nakiostudio/xcov/blob/master/LICENSE)\n[![Gem](https://img.shields.io/gem/v/stubify.svg?style=flat)](http://rubygems.org/gems/stubify)\n\n**stubify** allows you to stub real environments without really doing anything. It runs a [Sinatra](https://github.com/sinatra/sinatra)\napplication locally and, given a host, it forwards all the calls received caching the real responses, that way, next time the local\nenvironment receives a request the cached response is returned.\n\n## Example\n\nBy running the gem with the following command:\n```bash\nstubify server --host https://easy-peasy.io --directory fixtures\n```\n\nIt will create a local environment with address `http://localhost:4567`. Every request received will be recreated against the host\nprovided, therefore a request to `http://localhost:4567/rest_api/user/32325` will return whatever `https://easy-peasy.io/rest_api/user/32325`\nreturns and, in addition, that response will be cached in the directory `fixtures`.\n\nNext time a request to `http://localhost:4567/rest_api/user/32325` is made the cached payload will be returned.\n\n## Features\n\n* Accepts `GET`, `POST`, `PUT` and `DELETE` requests.\n* HTTP headers, query parameters and request bodies are taken into account.\n\n## Installation\n\n```\nsudo gem install stubify\n```\n\n## Usage\n\n```\nstubify server --host https://real-host.com --directory path_to_cached_response\n\nACTIONS:\n\n    server [options]\n\nOPTIONS:\n\n    --host STRING\n    Host the requests will be redirected to. i.e. https://easy-peasy.io\n\n    --port STRING\n    Port the local environment will listen to. Default is 4567\n\n    --directory DIR\n    Path where fixtures will be stored. i.e. fixtures/\n\n    --whitelist DIR\n    Path to the .yml file with the whitelisted paths\n\n    --verbose\n    Increases the amount of information logged\n```\n\n### Whitelisting endpoints\n\n**stubify** allows you to skip the caching of some endpoints, to do so, provide the file path to\na `yaml` file with the url paths to exclude, i.e.:\n\n```yaml\n- /rest_api/oauth2/token/\n- /rest_api/account/profile/\n```\n\n## Author\n\n[Carlos Vidal](https://twitter.com/carlostify)\n\n## License\n\nThis project is licensed under the terms of the MIT license. See the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakiostudio%2Fstubify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnakiostudio%2Fstubify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakiostudio%2Fstubify/lists"}