rack-rscript 0.5.2 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69b2c2a785b26d274d4659dead3d26c3f5d1f109
4
- data.tar.gz: 97b2e95b823c128022d84dfa6978242e9e0dbf96
3
+ metadata.gz: 401363d046b8a5c4eada3e105544be9ecbdf2a31
4
+ data.tar.gz: af30cfa83751c42be73657aefd73f0ae288001f1
5
5
  SHA512:
6
- metadata.gz: 8c72839e8624b1788dccb2219d26dd0f67121a799224a63e7e5ad3a4044f624f2138093ef79575965b5311488085fef5d904398db57f7a5bfba67173d9c55b18
7
- data.tar.gz: 0a21a75df10b3bcdd49c22751cf9d794436fadc2df5099b2a6c238d10216b8c8faaba014c7d87a0cd66bbb345b84532bce21dae4a162f7aa029a1b9d3d445ab5
6
+ metadata.gz: cecf74657abfb025630531563181a0685cc9950336c9645548f5eaa84dc7b24c842b94f1219b41c2e0b35cc719a79a9dab882936dd086515e81abb4173f122dc
7
+ data.tar.gz: b98b728b0eb703f79eb9b96d421df7b186c2026d92e84ba0d1006a7ae13a88fe03bcf5f803b3d6a1e9255ec4934e32f1e362e649e04dd42742cd7dea8a47c705
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1 @@
1
- >���LGg��C�q����0$(@��0{�22r���AS38�=f$� �ѥA�?�lQ�$����m�g�� a�Oqe��@C�3ǝ���\��\Hǽ1�Xc&���
2
- �_�q�d[�b���d��
1
+ I����$����3�0��G���'
data/lib/rack-rscript.rb CHANGED
@@ -167,14 +167,21 @@ class RackRscript
167
167
 
168
168
  end
169
169
 
170
- def render(name,type, options={})
171
- layout = Tilt[type.to_s].new(options) {|x| @templates[:layout]}
172
- template = Tilt[type.to_s].new(options) {|x| @templates[name]}
170
+ def render(name, type, options={})
171
+ layout = Tilt[type.to_s].new(options) {|x| @templates[:layout][:content]}
172
+ template = Tilt[type.to_s].new(options) {|x| @templates[name][:content]}
173
173
  layout.render{ template.render }
174
174
  end
175
175
 
176
- def template(name,&blk)
177
- @templates.merge!({name => blk.call})
176
+ def template(name, type=nil, &blk)
177
+ @templates.merge!({name => {content: blk.call, type: type}})
178
178
  end
179
-
179
+
180
+ def tilt(name, options={})
181
+
182
+ layout = Tilt[@templates[:layout][:type].to_s].new(options) {|x| @templates[:layout][:content]}
183
+ template = Tilt[@templates[name][:type].to_s].new(options) {|x| @templates[name][:content]}
184
+ layout.render{ template.render }
185
+ end
180
186
  end
187
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-rscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  PrSIAHSciIEyWkxdvMiXuEOAU+cBA3uVHTfpn/QHpap2lC3rCNFDCt1jdNhsvPJW
30
30
  P8hoKd8f6iDnTJw4mqinZSTTIweaDo1s
31
31
  -----END CERTIFICATE-----
32
- date: 2013-08-19 00:00:00.000000000 Z
32
+ date: 2013-08-20 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rack
metadata.gz.sig CHANGED
Binary file