alf 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,28 +0,0 @@
1
- require 'alf'
2
- require 'mustache'
3
-
4
- rel = Alf.lispy.evaluate{
5
- (summarize \
6
- (join :suppliers, :supplies),
7
- [:city],
8
- total: sum{ qty },
9
- parts: collect{ {:pid => pid, :qty => qty} })
10
- }
11
-
12
- puts rel.to_s
13
-
14
- tpl = <<-EOF
15
- {{#tuples}}
16
- <p>In {{city}}, products have been sold for {{total}} euros.</p>
17
- <table>
18
- {{#parts}}
19
- <tr>
20
- <td>{{pid}}</td>
21
- <td>{{qty}}</td>
22
- </tr>
23
- {{/parts}}
24
- </table>
25
- {{/tuples}}
26
- EOF
27
-
28
- puts Mustache.render(tpl, :tuples => rel.to_a)