alf 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +14 -1
- data/Gemfile +11 -1
- data/Gemfile.lock +6 -6
- data/Rakefile +0 -8
- data/alf.noespec +4 -2
- data/lib/alf-sequel/alf/sequel/environment.rb +5 -1
- data/lib/alf.rb +21 -0
- data/lib/alf/ext/relation.rb +2 -2
- data/lib/alf/iterator.rb +5 -4
- data/lib/alf/tools/to_lispy.rb +4 -4
- data/lib/alf/version.rb +1 -1
- data/spec/integration/alf/example.rash +1 -0
- data/spec/integration/alf/test_Relation.rb +32 -0
- data/spec/unit/alf-core/tools/test_to_lispy.rb +10 -10
- data/spec/unit/alf-core/tools/test_to_relation.rb +2 -1
- data/spec/unit/alf-sequel/test_environment.rb +6 -1
- metadata +740 -740
- data/examples/alf-mustache.rb +0 -28
data/examples/alf-mustache.rb
DELETED
@@ -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)
|