README.md in obscenity2-0.0.1 vs README.md in obscenity2-0.0.2
- old
+ new
@@ -1,15 +1,17 @@
-# Obscenity [![Build Status](https://secure.travis-ci.org/tjackiw/obscenity.png)](http://travis-ci.org/tjackiw/obscenity)
+# Obscenity
+Due to the unmaintaince from the [obscenity][obscenity] gem, i fork and update to make it work with
+
Obscenity is a profanity filter gem for Ruby/Rubinius, Rails (through ActiveModel), and Rack middleware.
## Installation
Add this line to your application's Gemfile:
```ruby
-gem 'obscenity'
+gem 'obscenity2', require: 'obscenity'
```
And then execute:
```ruby
@@ -17,16 +19,16 @@
```
Or install it yourself as:
```ruby
-gem install obscenity
+gem install obscenity2
```
## Compatibility
-Obscenity is compatible with Ruby 1.9.X, Ruby 2.0.X, Rubinius 1.9, Rails 3.X, and Rack as a middleware. Starting with Rails 3, the profanity validation works with any ORM supported by ActiveModel, e.g: ActiveRecord, MongoMapper, Mongoid, etc.
+Obscenity is compatible with Ruby 1.9.X, Ruby 2.0.X, Rubinius 1.9, Rails 3.X, Rails 4.X and Rack as a middleware. Starting with Rails 3 and 4, the profanity validation works with any ORM supported by ActiveModel, e.g: ActiveRecord, MongoMapper, Mongoid, etc.
## Using Obscenity
The following methods are available to use with Obscenity:
@@ -84,11 +86,11 @@
=> "simple text"
Obscenity.sanitize("text with shit")
=> "text with $@!#%"
```
-
+
`Obscenity.replacement(style).sanitize(text)` allows you to pass the replacement method to be used when sanitizing the given content. Available replacement values are `:default`, `:garbled`, `:stars`, `:vowels`, and a custom string.
```ruby
Obscenity.replacement(:default).sanitize("text with shit")
=> "text with $@!#%"
@@ -121,22 +123,22 @@
### ActiveModel
The ActiveModel component provides easy profanity validation for your models.
-First, you need to explicitly require the ActiveModel component:
+First, you need to explicitly require the ActiveModel component:
```ruby
require 'obscenity/active_model'
```
Then you can use it in your models as such:
```ruby
# ActiveRecord example
class Post < ActiveRecord::Base
-
+
validates :title, obscenity: true
validates :body, obscenity: { sanitize: true, replacement: "[censored]" }
end
# MongoMapper example
@@ -274,11 +276,11 @@
```ruby
user.username.should_not be_profane
```
## Contributing to obscenity
-
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
* Fork the project.
* Start a feature/bugfix branch.
* Commit and push until you are happy with your contribution.
@@ -286,10 +288,12 @@
* Please try not to mess with the Rakefile, version, or history.
## Authors
* Thiago Jackiw: [@tjackiw](http://twitter.com/tjackiw)
+* Minh Quy: [@MQuy90][MQuy90]
## Copyright
Copyright (c) 2012 Thiago Jackiw. See LICENSE.txt for further details.
-
+[obscenity]: https://github.com/tjackiw/obscenity
+[MQuy90]: https://twitter.com/MQuy90