obscenity2 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/README.md +13 -9
- data/lib/obscenity/version.rb +1 -1
- data/obscenity.gemspec +3 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c837c06c1a6840ed00d612ed2f42319a17796375
|
4
|
+
data.tar.gz: c7cb419fd2983acec215ffd34b4a6700d7215d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ce12acd7a6ddda1fe69481b5856561b23988be5dcf4bc0e134b2b6c27d2617d21703014285c45a83997afa419d99dce89e999b2a0bbc16536f96f0c5cb490a
|
7
|
+
data.tar.gz: b4d599092e3ff767f31121712d2b1e559a0b97db156faa7075095a1e2eab178f270d29b13612917dde990fd2740ecd5322bd9739dbbdb88bc51a7c9c97bd17c4
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# Obscenity
|
1
|
+
# Obscenity
|
2
|
+
|
3
|
+
Due to the unmaintaince from the [obscenity][obscenity] gem, i fork and update to make it work with
|
2
4
|
|
3
5
|
Obscenity is a profanity filter gem for Ruby/Rubinius, Rails (through ActiveModel), and Rack middleware.
|
4
6
|
|
@@ -7,7 +9,7 @@ Obscenity is a profanity filter gem for Ruby/Rubinius, Rails (through ActiveMode
|
|
7
9
|
Add this line to your application's Gemfile:
|
8
10
|
|
9
11
|
```ruby
|
10
|
-
gem 'obscenity'
|
12
|
+
gem 'obscenity2', require: 'obscenity'
|
11
13
|
```
|
12
14
|
|
13
15
|
And then execute:
|
@@ -19,12 +21,12 @@ bundle install
|
|
19
21
|
Or install it yourself as:
|
20
22
|
|
21
23
|
```ruby
|
22
|
-
gem install
|
24
|
+
gem install obscenity2
|
23
25
|
```
|
24
26
|
|
25
27
|
## Compatibility
|
26
28
|
|
27
|
-
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.
|
29
|
+
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.
|
28
30
|
|
29
31
|
## Using Obscenity
|
30
32
|
|
@@ -86,7 +88,7 @@ Obscenity.sanitize("simple text")
|
|
86
88
|
Obscenity.sanitize("text with shit")
|
87
89
|
=> "text with $@!#%"
|
88
90
|
```
|
89
|
-
|
91
|
+
|
90
92
|
`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.
|
91
93
|
|
92
94
|
```ruby
|
@@ -123,7 +125,7 @@ Obscenity.offensive("text with shit and another biatch")
|
|
123
125
|
|
124
126
|
The ActiveModel component provides easy profanity validation for your models.
|
125
127
|
|
126
|
-
First, you need to explicitly require the ActiveModel component:
|
128
|
+
First, you need to explicitly require the ActiveModel component:
|
127
129
|
|
128
130
|
```ruby
|
129
131
|
require 'obscenity/active_model'
|
@@ -134,7 +136,7 @@ Then you can use it in your models as such:
|
|
134
136
|
```ruby
|
135
137
|
# ActiveRecord example
|
136
138
|
class Post < ActiveRecord::Base
|
137
|
-
|
139
|
+
|
138
140
|
validates :title, obscenity: true
|
139
141
|
validates :body, obscenity: { sanitize: true, replacement: "[censored]" }
|
140
142
|
end
|
@@ -276,7 +278,7 @@ user.username.should_not be_profane
|
|
276
278
|
```
|
277
279
|
|
278
280
|
## Contributing to obscenity
|
279
|
-
|
281
|
+
|
280
282
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
281
283
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
282
284
|
* Fork the project.
|
@@ -288,8 +290,10 @@ user.username.should_not be_profane
|
|
288
290
|
## Authors
|
289
291
|
|
290
292
|
* Thiago Jackiw: [@tjackiw](http://twitter.com/tjackiw)
|
293
|
+
* Minh Quy: [@MQuy90][MQuy90]
|
291
294
|
|
292
295
|
## Copyright
|
293
296
|
|
294
297
|
Copyright (c) 2012 Thiago Jackiw. See LICENSE.txt for further details.
|
295
|
-
|
298
|
+
[obscenity]: https://github.com/tjackiw/obscenity
|
299
|
+
[MQuy90]: https://twitter.com/MQuy90
|
data/lib/obscenity/version.rb
CHANGED
data/obscenity.gemspec
CHANGED
@@ -7,11 +7,11 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.name = "obscenity2"
|
8
8
|
s.version = Obscenity::VERSION
|
9
9
|
|
10
|
-
s.authors = ["Thiago Jackiw"]
|
10
|
+
s.authors = ["Thiago Jackiw", 'Minh Quy']
|
11
11
|
s.description = " Obscenity is a profanity filter gem for Ruby/Rubinius, Rails (through ActiveModel), and Rack middleware "
|
12
|
-
s.email = "
|
12
|
+
s.email = "sugiacupit@gmail.com"
|
13
13
|
s.files = `git ls-files`.split($/)
|
14
|
-
s.homepage = "http://github.com/
|
14
|
+
s.homepage = "http://github.com/MQuy/obscenity"
|
15
15
|
s.licenses = ["MIT"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.summary = "Obscenity is a profanity filter gem for Ruby/Rubinius, Rails (through ActiveModel), and Rack middleware"
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obscenity2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thiago Jackiw
|
8
|
+
- Minh Quy
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -12,7 +13,7 @@ date: 2016-03-04 00:00:00.000000000 Z
|
|
12
13
|
dependencies: []
|
13
14
|
description: " Obscenity is a profanity filter gem for Ruby/Rubinius, Rails (through
|
14
15
|
ActiveModel), and Rack middleware "
|
15
|
-
email:
|
16
|
+
email: sugiacupit@gmail.com
|
16
17
|
executables: []
|
17
18
|
extensions: []
|
18
19
|
extra_rdoc_files: []
|
@@ -43,7 +44,7 @@ files:
|
|
43
44
|
- test/test_obscenity.rb
|
44
45
|
- test/test_rack.rb
|
45
46
|
- test/test_version.rb
|
46
|
-
homepage: http://github.com/
|
47
|
+
homepage: http://github.com/MQuy/obscenity
|
47
48
|
licenses:
|
48
49
|
- MIT
|
49
50
|
metadata: {}
|