dynarex-blog 0.2.6 → 0.2.7

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/dynarex-blog.rb +3 -1
  2. metadata +1 -1
data/lib/dynarex-blog.rb CHANGED
@@ -15,6 +15,7 @@ class DynarexBlog
15
15
  @file_path = file_path[/\/$/] ? file_path : file_path + '/'
16
16
  if File.exists? (@file_path + 'index.xml') then open(@file_path) else fresh_start() end
17
17
  @current_lookup = '_entry_lookup.xml'
18
+ @hashcache = HashCache.new(size: 5)
18
19
  super()
19
20
  end
20
21
 
@@ -140,7 +141,8 @@ class DynarexBlog
140
141
 
141
142
  def select_page(lookup, number)
142
143
 
143
- doc = Document.new File.open(@file_path + lookup,'r').read
144
+ #doc = Document.new File.open(@file_path + lookup,'r').read
145
+ doc = @hashcache.read(lookup) { Document.new File.open(@file_path + lookup,'r').read }
144
146
  x1 = (number - 1) * 10
145
147
  x2 = x1 + 9
146
148
 
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.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors: []
7
7