{"id":18234624,"url":"https://github.com/rameerez/moderate","last_synced_at":"2025-07-04T03:05:56.660Z","repository":{"id":261116688,"uuid":"882751853","full_name":"rameerez/moderate","owner":"rameerez","description":"👮‍♂️ Moderate and block bad words from your Rails app","archived":false,"fork":false,"pushed_at":"2024-11-03T20:31:07.000Z","size":12,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T03:04:45.212Z","etag":null,"topics":["bad-word-filter","bad-words","badword-filter","badwords","content-filter","content-filtering","cuss","cusswords","moderation","moderation-bot","obscenity","profanity","profanity-check","profanity-detection","rails","ruby","ruby-gem","ruby-on-rails","swear","swear-filter"],"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/rameerez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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":"2024-11-03T17:05:31.000Z","updated_at":"2025-06-08T04:14:36.000Z","dependencies_parsed_at":"2024-11-04T19:52:52.337Z","dependency_job_id":"85f73ce3-19ba-417a-9c79-c7fdbf250d5f","html_url":"https://github.com/rameerez/moderate","commit_stats":null,"previous_names":["rameerez/moderate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rameerez/moderate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fmoderate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fmoderate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fmoderate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fmoderate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rameerez","download_url":"https://codeload.github.com/rameerez/moderate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fmoderate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263437325,"owners_count":23466363,"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":["bad-word-filter","bad-words","badword-filter","badwords","content-filter","content-filtering","cuss","cusswords","moderation","moderation-bot","obscenity","profanity","profanity-check","profanity-detection","rails","ruby","ruby-gem","ruby-on-rails","swear","swear-filter"],"created_at":"2024-11-04T23:04:26.060Z","updated_at":"2025-07-04T03:05:56.634Z","avatar_url":"https://github.com/rameerez.png","language":"Ruby","readme":"# 👮‍♂️ `moderate` - Block profanities in text fields\n\n`moderate` is a Ruby gem that moderates user-generated text content by adding a simple validation to block bad words in any text field (profanities, cussing, swearing, obscenity, etc.)\n\nSimply add this to your model:\n\n```ruby\nvalidates :text_field, moderate: true\n```\n\nThat's it! You're done. `moderate` will work seamlessly with your existing validations and error messages.\n\n\u003e [!WARNING]\n\u003e This gem is under development. It currently only supports a limited set of English profanity words. Word matching is very basic now, and it may be prone to false positives, and false negatives. I use it for very simple things like preventing new submissions if they contain bad words, but the gem can be improved for more complex use cases and sophisticated matching and content moderation. Please consider contributing if you can improve the gem, or have good ideas for additional features.\n\n# Why\n\nAny text field where users can input text may be a place where bad words can be used. This gem blocks records from being created if they contain bad words, profanity, naughty / obscene words, etc.\n\nIt's good for Rails applications where you need to maintain a clean and respectful environment in comments, posts, or any other user input.\n\n# How\n\n`moderate` currently downloads a list of ~1k English profanity words from the [google-profanity-words](https://github.com/coffee-and-fun/google-profanity-words) repository and caches it in your Rails app's tmp directory.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'moderate'\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\nThen, just add the `moderate` validation to any model with a text field:\n\n```ruby\nvalidates :text_field, moderate: true\n```\n\n`moderate` will raise an error if a bad word is found in the text field, preventing the record from being saved.\n\nIt works seamlessly with your existing validations and error messages.\n\n## Configuration\n\nYou can configure the `moderate` gem behavior by adding a `config/initializers/moderate.rb` file:\n```ruby\nModerate.configure do |config|\n  # Custom error message when bad words are found\n  config.error_message = \"contains inappropriate language\"\n\n  # Add your own words to the blacklist\n  config.additional_words = [\"badword1\", \"badword2\"]\n\n  # Exclude words from the default list (false positives)\n  config.excluded_words = [\"good\"]\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rameerez/moderate. Our code of conduct is: just be nice and make your mom proud of what you do and post online.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameerez%2Fmoderate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frameerez%2Fmoderate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameerez%2Fmoderate/lists"}