{"id":25949787,"url":"https://github.com/grantbirki/ruby-template","last_synced_at":"2026-04-10T12:31:09.923Z","repository":{"id":279698907,"uuid":"939660689","full_name":"GrantBirki/ruby-template","owner":"GrantBirki","description":"A template for building Ruby applications, services, or gems","archived":false,"fork":false,"pushed_at":"2025-02-26T22:50:20.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T23:27:54.825Z","etag":null,"topics":["ruby","template"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/GrantBirki.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-26T22:35:16.000Z","updated_at":"2025-02-26T22:51:27.000Z","dependencies_parsed_at":"2025-02-26T23:45:43.255Z","dependency_job_id":null,"html_url":"https://github.com/GrantBirki/ruby-template","commit_stats":null,"previous_names":["grantbirki/ruby-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Fruby-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Fruby-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Fruby-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Fruby-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrantBirki","download_url":"https://codeload.github.com/GrantBirki/ruby-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241847465,"owners_count":20030257,"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":["ruby","template"],"created_at":"2025-03-04T12:29:06.818Z","updated_at":"2025-12-02T12:04:34.480Z","avatar_url":"https://github.com/GrantBirki.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ruby-template 🧰\n\n[![test](https://github.com/GrantBirki/ruby-template/actions/workflows/test.yml/badge.svg)](https://github.com/GrantBirki/ruby-template/actions/workflows/test.yml)\n[![lint](https://github.com/GrantBirki/ruby-template/actions/workflows/lint.yml/badge.svg)](https://github.com/GrantBirki/ruby-template/actions/workflows/lint.yml)\n[![build](https://github.com/GrantBirki/ruby-template/actions/workflows/build.yml/badge.svg)](https://github.com/GrantBirki/ruby-template/actions/workflows/build.yml)\n[![tarball](https://github.com/GrantBirki/ruby-template/actions/workflows/tarball.yml/badge.svg)](https://github.com/GrantBirki/ruby-template/actions/workflows/tarball.yml)\n\n## About ⭐\n\nA template repository for building Ruby applications, services, and libraries.\n\nThis project heavily leverages GitHub's architecture patterns such as:\n\n- [Scripts to Rule them All](https://github.blog/engineering/scripts-to-rule-them-all/)\n- Dependency Vendoring ([`vendor/cache/`](vendor/cache/))\n- Usage of [rbenv](https://github.com/rbenv/rbenv)\n\n## Usage 💻\n\nAll of the scripts defined below follow GitHub's [Scripts to Rule them All](https://github.blog/engineering/scripts-to-rule-them-all/) pattern. This pattern is a set of well-defined scripts that are used to perform common tasks such as bootstrapping, testing, linting, and more. These scripts are defined in the [`script/`](script/) directory.\n\n### Bootstrapping\n\n\u003e First, ensure you have [rbenv](https://github.com/rbenv/rbenv) installed\n\nTo bootstrap the project and install all dependencies (RubyGems), run the following command:\n\n```bash\nscript/bootstrap\n```\n\nYou can also alter this command to only install gems for production builds/environments:\n\n```bash\nscript/bootstrap --production\n```\n\nGems will be installed locally into the `vendor/gems/` directory at the root of this repository.\n\n### Testing\n\nAfter bootstrapping the project, you can run the test suite:\n\n```bash\nscript/test\n```\n\nBy default, this project enforces 100% code coverage. After running `script/test`, you can view the code coverage report in the `coverage/` directory at the root of the repository.\n\n### Linting\n\nTo lint the project, run the following command:\n\n```bash\nscript/lint\n```\n\nThe linter that this project uses is [rubocop](https://github.com/rubocop/rubocop) and its configuration is defined in the [`.rubocop.yml`](.rubocop.yml) file.\n\n### Docker Builds\n\nBuild a Docker image:\n\n```bash\nscript/docker-build\n```\n\nThe result of this command will be a Docker image built with the name `ruby-template:latest`.\n\nThis script:\n\n1. Builds a Docker image using the `Dockerfile` in the root of the repository.\n2. Tags the image with the `latest` tag.\n\n### Building Tarballs\n\nTo build a tarball of the application for deployment, run the following command:\n\n```bash\nscript/tarball\n```\n\nThis will build a docker container and run the `script/build-deploy-tarball` script inside the container. The result will be a tarball in the `tarballs/` directory at the root of the repository.\n\nTarballs are popular for atomic deployments where the deployment is a simple matter of extracting the tarball to the correct location on the target machine and running the new version of the application. Tarball deploys help to shift the complexity of the deployment process from the target machine to the build server (in this case, the CI server - Actions).\n\nThis script:\n\n1. Builds a Docker image using the `Dockerfile` in the root of the repository.\n2. Inside of the Docker container it:\n    1. Install all dependencies\n    2. Creates a compressed tarball with all the source code and dependencies. The dependenices are even pre-installed to save time when deploying the application. This means that the `vendor/cache/*.gem` files have been installed via bundler into the `vendor/gems/` directory.\n    3. Adds commit metadata to the tarball by dropping `BUILD_SHA` and `BUILD_BRANCH` files in the root of the tarball\n3. Drops the tarball in the `tarballs/` directory at the root of the repository.\n\nFrom this point, you would have a file named `tarballs/linux-aarch64-bookworm-sha123abc.tar.gz` (just an example) that would exist either on your local machine (or in a CI system) that you could use to deploy the application to a server.\n\nSee the [Dockerfile.tarball](spec/acceptance/Dockerfile.tarball) file for an example of how to unpack this pre-built tarball and run the application. It doesn't even require `script/bootstrap` to be called or `apt-get` packages to be installed (in most cases) - neat!\n\n### Running the Application/Server\n\nRemember, this is just a template repository so this command won't really do anything. This template is a simple app that adds the numbers `1` and `2` together. Run it with the following command:\n\n```bash\nscript/server # result: 3\n```\n\nIf you bootstrapped the project for a production environment, you need to run the server in production mode:\n\n\u003e Example shows bootstrapping the project for production and then running the server in production mode.\n\n```bash\n# if you want to run the server in production mode, you must first bootstrap the project for production\n# this will install only the production dependencies and skip development dependencies\nscript/bootstrap --production\n\n# then you must also run the server in production mode\nscript/server --production\n```\n\n### Build\n\nDefine the specific build steps in the `script/build` script.\n\nA build script for Ruby might look something [like this](https://github.com/runwaylab/issue-db/blob/a6f8889e661bf4d2afc46366b8b4095fd9941ecf/.github/workflows/build.yml#L32-L45).\n\n### Releasing\n\nThe `script/release` script is a starting point for pushing and tagging new releases on GitHub.\n\n## Vendoring\n\nThis project adopts a \"vendor everything\" approach to dependencies. This means that all dependencies are vendored into the repository. This is done to ensure that the build is reproducible and that the build is not dependent on the availability of external dependencies (e.g. RubyGems.org).\n\nAll Ruby Gems are committed to version control and stored in the [`vendor/cache/`](vendor/cache/) directory.\n\nThis behavior is further controlled by the [`.bundle/config`](./.bundle/config) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantbirki%2Fruby-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantbirki%2Fruby-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantbirki%2Fruby-template/lists"}