dynarex-blog 0.3.15 → 0.3.16

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 +9 -2
  2. metadata +2 -2
data/lib/dynarex-blog.rb CHANGED
@@ -19,8 +19,8 @@ class DynarexBlog
19
19
  @hc_lookup = HashCache.new(size: 15)
20
20
  @hc_lookup.read(@current_lookup) { Document.new File.open(@file_path + @current_lookup,'r').read }
21
21
 
22
- @hc_result = HashCache.new(size: 5)
23
- @hc_entry_file = HashCache.new(size: 5)
22
+ @hc_result = HashCache.new(size: 10)
23
+ @hc_entry_file = HashCache.new(size: 10)
24
24
  super()
25
25
  end
26
26
 
@@ -42,6 +42,13 @@ class DynarexBlog
42
42
  create_record(record, @id.to_s, name=tag, type='tags')
43
43
  end
44
44
 
45
+ end
46
+
47
+ def entry(id)
48
+ doc_lookup = @hc_lookup.read(@current_lookup) { Document.new File.open(@file_path + @current_lookup,'r').read }
49
+ file = XPath.first(doc_lookup.root, "records/entry[id='#{id}']/file")
50
+ doc_entries = Document.new(@hc_entry_file.read(file) { File.open(@file_path + file,'r').read })
51
+ XPath.first(doc_entries.root, "records/entry[@id='#{id}']")
45
52
  end
46
53
 
47
54
  def delete(id=0)
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.3.15
4
+ version: 0.3.16
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-20 00:00:00 +01:00
12
+ date: 2010-07-21 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency