{"id":13508133,"url":"https://github.com/stnly/plug_ribbon","last_synced_at":"2025-03-30T09:33:24.507Z","repository":{"id":34127983,"uuid":"37959885","full_name":"stnly/plug_ribbon","owner":"stnly","description":":ribbon: Injects a ribbon into your web application depending on the environment","archived":false,"fork":false,"pushed_at":"2015-08-13T07:18:31.000Z","size":753,"stargazers_count":23,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-01T07:33:26.547Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://git.io/plug_ribbon","language":"Elixir","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/stnly.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":"2015-06-24T03:26:04.000Z","updated_at":"2023-09-01T08:52:02.000Z","dependencies_parsed_at":"2022-08-17T21:50:54.368Z","dependency_job_id":null,"html_url":"https://github.com/stnly/plug_ribbon","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/stnly%2Fplug_ribbon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnly%2Fplug_ribbon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnly%2Fplug_ribbon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stnly%2Fplug_ribbon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stnly","download_url":"https://codeload.github.com/stnly/plug_ribbon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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":[],"created_at":"2024-08-01T02:00:48.686Z","updated_at":"2025-03-30T09:33:24.223Z","avatar_url":"https://github.com/stnly.png","language":"Elixir","funding_links":[],"categories":["Framework Components"],"sub_categories":[],"readme":"# plug_ribbon\n\n[![Build Status](https://travis-ci.org/stnly/plug_ribbon.svg?branch=master)](https://travis-ci.org/stnly/plug_ribbon)\n[![Hex Version](https://img.shields.io/hexpm/v/plug_ribbon.svg)](https://hex.pm/packages/plug_ribbon)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis [Plug](https://github.com/elixir-lang/plug) module injects a ribbon to your web application in the configured environment.\n\nUsed to differentiate between environments.\n\n![](priv/static/screenshot.png)\n\n## Motivation\n\nInspired by [rack-dev-mark](https://github.com/dtaniwaki/rack-dev-mark)\n\n## Setup\n\nTo use plug_ribbon in your projects, edit your `mix.exs` file and add plug_ribbon as a dependency:\n\n```elixir\ndefp deps do\n  [\n    {:plug_ribbon, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n## Usage\n\nThis plug should be one of the last ones in your pipeline.\n\nAdd the plug and specify a list of environment atoms that you want the ribbon to be shown.\n\n```elixir\ndefmodule MyPhoenixApp.Router do\n  use MyPhoenixApp.Web, :router\n\n  pipeline :browser do\n    plug :accepts, [\"html\"]\n    plug :fetch_session\n    plug :fetch_flash\n    plug :protect_from_forgery\n    plug Plug.Ribbon, [:dev, :staging, :test]\n  end\n\n  pipeline :api do\n    plug :accepts, [\"json\"]\n  end\n\n  scope \"/\", MyPhoenixApp do\n    pipe_through :browser # Use the default browser stack\n\n    get \"/\", PageController, :index\n  end\n\n  # Other scopes may use custom stacks.\n  # scope \"/api\", Observes do\n  #   pipe_through :api\n  # end\nend\n```\n\nAfter you are done, run `mix deps.get` in your shell to fetch the dependencies.\n\nThe ribbon will display a label with your current environment in capital letters.\n`Mix.env |\u003e Atom.to_string |\u003e String.upcase`\n\n## Testing\n\n```bash\n$ mix test\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstnly%2Fplug_ribbon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstnly%2Fplug_ribbon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstnly%2Fplug_ribbon/lists"}