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 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 profane filter
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.0
1
+ 0.1.1
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{profanity_filter}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Adam Bair}]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: profanity_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: