bad_word_detector 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -67,6 +67,11 @@ class BadWordDetector
67
67
  end
68
68
  @library = PrefixTree.new library
69
69
  @whitelist = Whitelist.new whitelist
70
+ @library.freeze
71
+ @whitelist.freeze
72
+ @rule_sets.freeze
73
+ @string_sets.freeze
74
+ self.freeze
70
75
  true
71
76
  end
72
77
 
@@ -99,6 +104,9 @@ class BadWordDetector
99
104
  index += 1
100
105
  end
101
106
  end
107
+ def inspect
108
+ "#<#{self.class.name}:#{self.object_id}>"
109
+ end
102
110
 
103
111
  private
104
112
  def find_part(text, index)
@@ -1,4 +1,8 @@
1
1
  class PrefixTree
2
+ def inspect
3
+ "#<#{self.class.name}:#{self.object_id}>"
4
+ end
5
+
2
6
  def initialize(items = [], hash_tree = {})
3
7
  @hash_tree = hash_tree.clone
4
8
  unless items.empty?
@@ -1,3 +1,3 @@
1
1
  class BadWordDetector
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -21,6 +21,10 @@ class Whitelist
21
21
  self.check_substring(word.source, word.index, word.word.length)
22
22
  end
23
23
 
24
+ def inspect
25
+ "#<#{self.class.name}:#{self.object_id}>"
26
+ end
27
+
24
28
  end
25
29
 
26
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bad_word_detector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: