keyword-filter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/keyword-filter.rb +3 -1
- metadata +1 -1
data/lib/keyword-filter.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
|
-
# file: keywords-
|
3
|
+
# file: keywords-filte.rb
|
4
4
|
|
5
5
|
require 'rexml/document'
|
6
6
|
include REXML
|
@@ -20,6 +20,8 @@ class KeywordFilter
|
|
20
20
|
filtered_words.empty? ? raw_s : doc.root
|
21
21
|
end
|
22
22
|
|
23
|
+
private
|
24
|
+
|
23
25
|
def open(s)
|
24
26
|
if s[/^https?:\/\//] then # open a file from a url
|
25
27
|
buffer = Kernel.open(s, 'UserAgent' => 'KeywordsFilter-Reader').read
|