rscript 0.1.2 → 0.1.3

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/rscript.rb +4 -1
  2. metadata +13 -4
@@ -22,10 +22,12 @@
22
22
 
23
23
 
24
24
  require 'rscript_base'
25
+ require 'hashcache'
25
26
 
26
27
  class RScript < RScriptBase
27
28
 
28
29
  def initialize()
30
+ @rsf_cache = HashCache.new(cache: 5)
29
31
  end
30
32
 
31
33
  def read(args=[])
@@ -61,7 +63,8 @@ class RScript < RScriptBase
61
63
  rsfile = args[0]; args.shift
62
64
 
63
65
  $rsfile = rsfile[/[a-zA-z0-9]+(?=\.rsf)/]
64
- yield(Document.new(read_sourcecode(rsfile)))
66
+ doc = @rsf_cache.read(rsfile) { Document.new(read_sourcecode(rsfile)) }
67
+ yield(doc)
65
68
  end
66
69
 
67
70
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,10 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-08-09 00:00:00 +01:00
12
+ date: 2011-02-15 00:00:00 +00:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hashcache
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
16
25
  description:
17
26
  email:
18
27
  executables: []