keyword-filter 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. data/lib/keyword-filter.rb +2 -1
  2. metadata +1 -1
@@ -12,7 +12,8 @@ class KeywordFilter
12
12
  end
13
13
 
14
14
  def filter(raw_s)
15
- s = raw_s.gsub(/\b(#{@keywords.join('|')})\b/i,'<f>\0</f>')
15
+ regexp = @keywords.join('|')
16
+ s = raw_s.gsub(/\b(#{regexp})\b/i,'<f>\0</f>')
16
17
  doc = Document.new("<root>#{s}</root>")
17
18
  filtered_words = XPath.match(doc.root, '*')
18
19
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keyword-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors: []
7
7