profanity_filter 0.1.0 → 0.1.1
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/README.rdoc +3 -1
- data/VERSION +1 -1
- data/lib/profanity_filter.rb +4 -1
- data/profanity_filter.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -92,5 +92,7 @@ Created by Adam Bair (adam@intridea.com) of Intridea (http://www.intridea.com) i
|
|
92
92
|
* Neil Ang - punctionation delimited profanity
|
93
93
|
* Flinn Mueller - dynamic word list from method
|
94
94
|
* Scott Stewert - additional dictionary words
|
95
|
-
* Nola Stowe - added stars
|
95
|
+
* Nola Stowe - added stars filter
|
96
|
+
* Nick Wientge - removed dependency on ActiveRecord (now ORM agnostic)
|
97
|
+
* Jean Regisser - lazily load the dictionary
|
96
98
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/profanity_filter.rb
CHANGED
@@ -36,9 +36,12 @@ module ProfanityFilter
|
|
36
36
|
cattr_accessor :replacement_text, :dictionary_file, :dictionary
|
37
37
|
@@replacement_text = '@#$%'
|
38
38
|
@@dictionary_file = File.join(File.dirname(__FILE__), '../config/dictionary.yml')
|
39
|
-
@@dictionary = YAML.load_file(@@dictionary_file)
|
40
39
|
|
41
40
|
class << self
|
41
|
+
def dictionary
|
42
|
+
@@dictionary ||= YAML.load_file(@@dictionary_file)
|
43
|
+
end
|
44
|
+
|
42
45
|
def banned?(word = '')
|
43
46
|
dictionary.include?(word.downcase) if word
|
44
47
|
end
|
data/profanity_filter.gemspec
CHANGED