{"id":24394433,"url":"https://github.com/leipeleon/warner","last_synced_at":"2026-04-28T00:33:18.611Z","repository":{"id":56897784,"uuid":"104260612","full_name":"LeipeLeon/warner","owner":"LeipeLeon","description":"Annotate your code w/ custom deprecation warnings to the $stderr when a newer version of a gem or rails is installed. Especially useful for monkeypatching.","archived":false,"fork":false,"pushed_at":"2023-10-16T12:38:36.000Z","size":33,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-08T15:34:54.174Z","etag":null,"topics":["logging","monkey-patching","monkeypatching","rails"],"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/LeipeLeon.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-20T19:46:04.000Z","updated_at":"2023-01-27T14:45:31.000Z","dependencies_parsed_at":"2024-08-22T21:34:23.724Z","dependency_job_id":"ca24203f-4624-401e-ba93-bca83a4d06cb","html_url":"https://github.com/LeipeLeon/warner","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":0.3870967741935484,"last_synced_commit":"417f90faef79cd8b72f9aafcb9a62b4db8d0b4b3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeipeLeon%2Fwarner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeipeLeon%2Fwarner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeipeLeon%2Fwarner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeipeLeon%2Fwarner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeipeLeon","download_url":"https://codeload.github.com/LeipeLeon/warner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243325066,"owners_count":20273213,"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":["logging","monkey-patching","monkeypatching","rails"],"created_at":"2025-01-19T19:24:40.520Z","updated_at":"2026-04-28T00:33:18.585Z","avatar_url":"https://github.com/LeipeLeon.png","language":"Ruby","readme":"# Warner\n\n[![Gem Version](https://badge.fury.io/rb/warner.svg)](https://badge.fury.io/rb/warner) [![Codeship Status for LeipeLeon/warner](https://app.codeship.com/projects/951314e0-806a-0135-5d58-6a64ad6118ad/status?branch=master)](https://app.codeship.com/projects/246699)\n\nAnnotate your code w/ custom deprecation warnings to the `$stderr` when a newer version of a gem or rails is installed.\n\n\nEspecially useful for a controlled (rails) monkeypatching workflow:\n\nSay you found a bug in a gem and waiting for a new release wil ltake to long.\nAdd a monkeypatch in `app/monkeypatches/` (e.g. `app/monkeypatches/bootstrap_form.rb` and maybe write a spec for it.)\nWhen you update the flawed gem, `Warner` will check the supplied version against the installed version and will put out a deprecation warning (w/ `ActiveSupport::Deprecation`) so you can act upon it.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'warner'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install warner\n\n## Usage\n\n```ruby\n# app/monkeypatches/bootstrap_form.rb\nWarner.gem_version_warning('bootstrap_form', \"1.2\", \"upgrade to latest version\")\nWarner.rails_version_warning(\"5.0\", \"Remove this monkeypatch b/c it's fixed in 5.1 (see issue #99999)\")\nWarner.colored_warning(\"Somebody look at this piece of code please!\")\n```\n\nwill output:\n\n```log\nDEPRECATION WARNING: [gem:bootstrap_form] 2.7.0 \u003e 1.2 : upgrade to latest version (called from \u003ctop (required)\u003e at /Users/berl/Clients/bwh/core/app/monkeypatches/bootstrap_form.rb:1)\nDEPRECATION WARNING: [RAILS] 5.1.6 \u003e 5.0 : Remove this monkeypatch b/c it's fixed in 5.1 (see issue #99999) (called from \u003ctop (required)\u003e at /Users/berl/Clients/bwh/core/app/monkeypatches/bootstrap_form.rb:2)\nDEPRECATION WARNING: Somebody look at this piece of code please! (called from \u003ctop (required)\u003e at /Users/berl/Clients/bwh/core/app/monkeypatches/bootstrap_form.rb:3)\n```\n\n## Bonus material: make deprecations stand out in the logfile\n\n```ruby\n# config/environments/development.rb\nconfig.active_support.deprecation = -\u003e (message, callstack) {\n  $stderr.puts \"\\e[41;37;1m#{message}\\e[0m\"\n}\n```\n\n## Development\n\nTo release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/LeipeLeon/warner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Warner project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/LeipeLeon/warner/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleipeleon%2Fwarner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleipeleon%2Fwarner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleipeleon%2Fwarner/lists"}