saintly 0.1.8 → 0.1.9

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.
data/History.txt CHANGED
@@ -29,3 +29,8 @@
29
29
  === 0.1.8 / 2010-07-13
30
30
 
31
31
  * Allows words matching "(l|m)ass." (massachusetts)
32
+
33
+
34
+ === 0.1.9 / 2010-07-13
35
+
36
+ * Disallow words like assclown, asshat, asswipe
data/lib/saintly.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Saintly
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
 
4
4
  def self.sanitize(text)
5
5
  return if text.nil?
@@ -25,11 +25,13 @@ module Saintly
25
25
  'fuck',
26
26
  'shit',
27
27
  'nigger',
28
- 'cunt'
28
+ 'cunt',
29
+ 'ass(hole|hat|clown|wipe)',
30
+ '(dumb|jack)ass',
29
31
  ]
30
32
 
31
33
  RESTRICTED_WORDS = [
32
- 'twat', 'ass', 'dumbass', 'jackass', 'asshole'
34
+ 'twat', 'ass'
33
35
  ]
34
36
 
35
37
  module Rails
data/test/saintly_test.rb CHANGED
@@ -15,10 +15,17 @@ class SaintlyTest < Test::Unit::TestCase
15
15
  assert_equal '******', Saintly.sanitize('nigger')
16
16
  assert_equal '*******', Saintly.sanitize('dumbass')
17
17
  assert_equal '*******', Saintly.sanitize('jackass')
18
+ assert_equal '*******', Saintly.sanitize('asshole')
19
+ assert_equal '********', Saintly.sanitize('assholes')
20
+
21
+ assert_equal '******', Saintly.sanitize('asshat')
22
+ assert_equal '********', Saintly.sanitize('assclown')
23
+ assert_equal '*******', Saintly.sanitize('asswipe')
24
+
25
+
18
26
  end
19
27
  should "sanitize partial words" do
20
28
  assert_equal '*******', Saintly.sanitize('fucking')
21
- assert_equal '*******', Saintly.sanitize('asshole')
22
29
  assert_equal '********', Saintly.sanitize('shithead')
23
30
 
24
31
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saintly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Kvamme