cuba 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cuba"
3
- s.version = "0.0.1"
3
+ s.version = "0.0.2"
4
4
  s.summary = "Rum based microframework for web applications."
5
5
  s.description = "Cuba is a light wrapper for Rum, a microframework for Rack applications."
6
6
  s.authors = ["Michel Martens"]
@@ -4,8 +4,14 @@ require "tilt"
4
4
 
5
5
  module Cuba
6
6
  class Ron < Rum
7
+ def _cache
8
+ Thread.current[:_cache] ||= Tilt::Cache.new
9
+ end
10
+
7
11
  def haml(template, locals = {})
8
- res.write Tilt::HamlTemplate.new("#{template}.haml").render(self, locals)
12
+ _cache.fetch(template, locals) {
13
+ Tilt::HamlTemplate.new("#{template}.haml")
14
+ }.render(self, locals)
9
15
  end
10
16
  end
11
17
  end
@@ -1,3 +1,3 @@
1
1
  module Cuba
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michel Martens
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-25 00:00:00 -03:00
17
+ date: 2010-04-26 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency