dynarex-blog 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dynarex-blog.rb +6 -4
  2. metadata +2 -2
data/lib/dynarex-blog.rb CHANGED
@@ -22,6 +22,9 @@ class DynarexBlog
22
22
  @hc_result = HashCache.new(size: 10)
23
23
  @hc_entry_file = HashCache.new(size: 10)
24
24
  @hc_lookup_a = HashCache.new(size: 10)
25
+
26
+ raw_tags = @entities.xpath "records/section[summary/name='tags']/records"
27
+ @tags = XPath.match(raw_tags, 'entity/summary').map{|tag| %w(name entry_count).map {|x| tag.text(x).to_s} }
25
28
  super()
26
29
  end
27
30
 
@@ -165,14 +168,13 @@ class DynarexBlog
165
168
  result
166
169
  end
167
170
 
168
- def tag(tag)
169
- @current_lookup = tag + '_lookup.xml'
171
+ def tag(tag)
172
+ @current_lookup = (@tags.assoc(tag) ? tag : '_404') + '_lookup.xml'
170
173
  self
171
174
  end
172
175
 
173
176
  def tags
174
- raw_tags = @entities.xpath "records/section[summary/name='tags']/records"
175
- XPath.match(raw_tags, 'entity/summary').map{|tag| %w(name entry_count).map {|x| tag.text(x).to_s} }
177
+ @tags
176
178
  end
177
179
 
178
180
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex-blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-07-30 00:00:00 +01:00
12
+ date: 2010-08-01 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency