dynarex-tags 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex-tags.rb +10 -4
- metadata +2 -2
data/lib/dynarex-tags.rb
CHANGED
@@ -19,10 +19,13 @@ class DynarexTags
|
|
19
19
|
h = {}
|
20
20
|
category_dynarex = Dynarex.new category_url
|
21
21
|
|
22
|
-
category_dynarex.to_h.each do |item|
|
23
|
-
|
22
|
+
category_dynarex.to_h.each do |item|
|
23
|
+
|
24
24
|
url, title = item.values[0..1]
|
25
|
-
title.scan(/#(\w+)/)
|
25
|
+
fields = title.scan(/#(\w+)/)
|
26
|
+
next unless fields
|
27
|
+
|
28
|
+
fields.flatten.each {|tag| save_tag(h, tag, title, url)}
|
26
29
|
end
|
27
30
|
|
28
31
|
save_dynarex_index(h)
|
@@ -30,6 +33,9 @@ class DynarexTags
|
|
30
33
|
|
31
34
|
def save_title_tags(title, url)
|
32
35
|
|
36
|
+
fields = title.scan(/#(\w+)/)
|
37
|
+
return unless fields
|
38
|
+
|
33
39
|
if File.exists? @index_filename then
|
34
40
|
dynarex = Dynarex.new @index_filename
|
35
41
|
else
|
@@ -41,7 +47,7 @@ class DynarexTags
|
|
41
47
|
r.merge({x[:keyword] => x[:count].to_i})
|
42
48
|
end
|
43
49
|
|
44
|
-
|
50
|
+
fields.flatten.each {|tag| save_tag(h,tag, title, url)}
|
45
51
|
save_dynarex_index(h)
|
46
52
|
end
|
47
53
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dynarex-tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-11-
|
13
|
+
date: 2012-11-24 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: dynarex
|