{"id":16656367,"url":"https://github.com/wnuqui/rack-app_version","last_synced_at":"2026-04-23T15:33:45.733Z","repository":{"id":56196896,"uuid":"97013779","full_name":"wnuqui/rack-app_version","owner":"wnuqui","description":"Middleware that sets the version of an app via response header.","archived":false,"fork":false,"pushed_at":"2020-11-21T04:36:53.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T01:36:22.583Z","etag":null,"topics":["app-version","rack-middleware"],"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/wnuqui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-12T13:53:58.000Z","updated_at":"2023-03-10T09:29:28.000Z","dependencies_parsed_at":"2022-08-15T14:31:10.177Z","dependency_job_id":null,"html_url":"https://github.com/wnuqui/rack-app_version","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wnuqui/rack-app_version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Frack-app_version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Frack-app_version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Frack-app_version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Frack-app_version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wnuqui","download_url":"https://codeload.github.com/wnuqui/rack-app_version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wnuqui%2Frack-app_version/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32187083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T15:28:30.493Z","status":"ssl_error","status_checked_at":"2026-04-23T15:28:29.972Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["app-version","rack-middleware"],"created_at":"2024-10-12T09:57:09.841Z","updated_at":"2026-04-23T15:33:45.715Z","avatar_url":"https://github.com/wnuqui.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rack::AppVersion Middleware\n[![Build Status](https://wnuqui.semaphoreci.com/badges/rack-app_version/branches/master.svg?style=shields)](https://wnuqui.semaphoreci.com/projects/rack-app_version) [![SourceLevel](https://app.sourcelevel.io/github/wnuqui/rack-app_version.svg)](https://app.sourcelevel.io/github/wnuqui/rack-app_version) \u003ca href=\"https://codeclimate.com/github/wnuqui/rack-app_version\"\u003e\u003cimg src=\"https://codeclimate.com/github/wnuqui/rack-app_version/badges/gpa.svg\" /\u003e\u003c/a\u003e \u003ca href=\"https://codeclimate.com/github/wnuqui/rack-app_version\"\u003e\u003cimg src=\"https://codeclimate.com/github/wnuqui/rack-app_version/badges/issue_count.svg\" /\u003e\u003c/a\u003e \u003ca href=\"https://codeclimate.com/github/wnuqui/rack-app_version/coverage\"\u003e\u003cimg src=\"https://codeclimate.com/github/wnuqui/rack-app_version/badges/coverage.svg\" /\u003e\u003c/a\u003e\n\n`Rack::AppVersion` is a middleware that sets the version of an app (Rack compatible web applications) via response header.\n\n## Setup\n\n### 1. In your Gemfile\n\n```ruby\ngem 'rack-app_version'\n```\n\n### 2. In `config/application.rb` of your Rails application, put the code below.\n\n```ruby\nmodule YourApp\n  class Application \u003c Rails::Application\n\n    # ...\n\n    config.middleware.use Rack::AppVersion\n\n  end\nend\n```\n\n### 3. In `Rakefile` of your Rails application, put the code below.\n\n```ruby\nmodule Rack\n  class AppVersion\n    def self.generate_version\n      # Implement logic of getting application version here.\n    end\n  end\nend\n\nrequire 'rack/app_version/rake_task'\nRack::AppVersion.load_tasks\n```\n\nDoing `bundle exec rake -T | grep app_version` will give you the following which you can use:\n\n```bash\nrake app_version:generate               # generate app version and write it in .app_version file\nrake app_version:init                   # generate .app_version file that will contain application version\n```\n\n### 4. Use `have_app_version` matcher to ensure everything is setup (optional).\n\nThis rspec matcher can be used by the application to ensure that everything is properly configured.\n\n```ruby\nit 'has app version in response headers' do\n  expect(env).to have_app_version\nend\n```\n\n## Common Gotchas\n\nTo determine where to put the `Rack::AppVersion` middleware in the Rack stack, run the following command:\n\n```bash\nbundle exec rake middleware\n```\n\nIn many cases, the Rack stack will be different running in production environment. Run the following command to see the middleware stack in production:\n\n```bash\nRAILS_ENV=production bundle exec rake middleware\n```\n\nSee The [Rails Guide to Rack](http://guides.rubyonrails.org/rails_on_rack.html) for more details on rack middlewares or watch the [railscast](http://railscasts.com/episodes/151-rack-middleware).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnuqui%2Frack-app_version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwnuqui%2Frack-app_version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwnuqui%2Frack-app_version/lists"}