opulent 1.5.5 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +13 -0
- data/{LICENSE → LICENSE.md} +0 -0
- data/bin/opulent +0 -0
- data/lib/opulent.rb +10 -10
- data/lib/opulent/compiler.rb +15 -9
- data/lib/opulent/compiler/buffer.rb +123 -62
- data/lib/opulent/compiler/comment.rb +3 -4
- data/lib/opulent/compiler/control.rb +20 -26
- data/lib/opulent/compiler/define.rb +88 -36
- data/lib/opulent/compiler/doctype.rb +20 -22
- data/lib/opulent/compiler/eval.rb +23 -2
- data/lib/opulent/compiler/filter.rb +4 -5
- data/lib/opulent/compiler/node.rb +18 -12
- data/lib/opulent/compiler/root.rb +4 -5
- data/lib/opulent/compiler/text.rb +7 -2
- data/lib/opulent/compiler/yield.rb +2 -3
- data/lib/opulent/engine.rb +21 -20
- data/lib/opulent/exec.rb +21 -63
- data/lib/opulent/logger.rb +230 -3
- data/lib/opulent/parser.rb +14 -76
- data/lib/opulent/parser/comment.rb +45 -34
- data/lib/opulent/parser/control.rb +132 -111
- data/lib/opulent/parser/define.rb +15 -12
- data/lib/opulent/parser/doctype.rb +15 -15
- data/lib/opulent/parser/eval.rb +16 -6
- data/lib/opulent/parser/expression.rb +87 -84
- data/lib/opulent/parser/filter.rb +31 -25
- data/lib/opulent/parser/include.rb +38 -42
- data/lib/opulent/parser/node.rb +136 -118
- data/lib/opulent/parser/root.rb +24 -18
- data/lib/opulent/parser/text.rb +150 -123
- data/lib/opulent/parser/yield.rb +23 -23
- data/lib/opulent/settings.rb +70 -51
- data/lib/opulent/tokens.rb +17 -15
- data/lib/opulent/utils.rb +5 -4
- data/lib/opulent/version.rb +1 -1
- metadata +4 -43
- data/.libold/opulent.rb +0 -96
- data/.libold/opulent/context.rb +0 -80
- data/.libold/opulent/engine.rb +0 -88
- data/.libold/opulent/filter.rb +0 -101
- data/.libold/opulent/logger.rb +0 -67
- data/.libold/opulent/nodes.rb +0 -13
- data/.libold/opulent/nodes/block.rb +0 -29
- data/.libold/opulent/nodes/comment.rb +0 -35
- data/.libold/opulent/nodes/control.rb +0 -230
- data/.libold/opulent/nodes/define.rb +0 -42
- data/.libold/opulent/nodes/eval.rb +0 -41
- data/.libold/opulent/nodes/expression.rb +0 -28
- data/.libold/opulent/nodes/filter.rb +0 -70
- data/.libold/opulent/nodes/helper.rb +0 -69
- data/.libold/opulent/nodes/node.rb +0 -101
- data/.libold/opulent/nodes/root.rb +0 -62
- data/.libold/opulent/nodes/text.rb +0 -54
- data/.libold/opulent/nodes/theme.rb +0 -36
- data/.libold/opulent/parser.rb +0 -252
- data/.libold/opulent/parser/block.rb +0 -70
- data/.libold/opulent/parser/comment.rb +0 -32
- data/.libold/opulent/parser/control.rb +0 -83
- data/.libold/opulent/parser/define.rb +0 -39
- data/.libold/opulent/parser/eval.rb +0 -33
- data/.libold/opulent/parser/expression.rb +0 -350
- data/.libold/opulent/parser/filter.rb +0 -41
- data/.libold/opulent/parser/node.rb +0 -232
- data/.libold/opulent/parser/root.rb +0 -96
- data/.libold/opulent/parser/text.rb +0 -114
- data/.libold/opulent/parser/theme.rb +0 -36
- data/.libold/opulent/preprocessor.rb +0 -102
- data/.libold/opulent/runtime.rb +0 -144
- data/.libold/opulent/template.rb +0 -43
- data/.libold/opulent/tokens.rb +0 -276
- data/.libold/opulent/version.rb +0 -5
- data/.travis.yml +0 -4
- data/benchmark/benchmark.rb +0 -57
- data/benchmark/cases/node/node.haml +0 -7
- data/benchmark/cases/node/node.op +0 -7
- data/benchmark/cases/node/node.slim +0 -7
data/.libold/opulent/version.rb
DELETED
data/.travis.yml
DELETED
data/benchmark/benchmark.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'benchmark'
|
2
|
-
require_relative '../lib/opulent'
|
3
|
-
|
4
|
-
# Choose the benchmark you want to run
|
5
|
-
BENCHMARK = :node
|
6
|
-
|
7
|
-
# How many times each command should be run
|
8
|
-
N = 1000
|
9
|
-
|
10
|
-
# Templating engine initialization
|
11
|
-
puts "BENCHMARK\n--\n"
|
12
|
-
|
13
|
-
case BENCHMARK
|
14
|
-
when :node
|
15
|
-
case_folder = 'cases/node/'
|
16
|
-
opulent = Tilt.new("#{case_folder}node.op")
|
17
|
-
slim = Tilt.new("#{case_folder}node.slim")
|
18
|
-
haml = Tilt.new("#{case_folder}node.haml")
|
19
|
-
|
20
|
-
locals = {
|
21
|
-
a: 3,
|
22
|
-
b: 4,
|
23
|
-
c: 5
|
24
|
-
}
|
25
|
-
|
26
|
-
op = Opulent.new :"#{case_folder}node"
|
27
|
-
# op2 = Opulent.new :"#{case_folder}yield", def: op.def
|
28
|
-
|
29
|
-
puts op.render(op, locals){}
|
30
|
-
#
|
31
|
-
# puts op.render(op, locals){
|
32
|
-
# op2.render(op, locals){}
|
33
|
-
# }
|
34
|
-
|
35
|
-
puts "\n\n"
|
36
|
-
|
37
|
-
puts op.template
|
38
|
-
puts "\n\n"
|
39
|
-
|
40
|
-
Benchmark.bm do |x|
|
41
|
-
x.report("haml") do
|
42
|
-
N.times do
|
43
|
-
haml.render(Object.new, locals){}
|
44
|
-
end
|
45
|
-
end
|
46
|
-
x.report("opulent") do
|
47
|
-
N.times do
|
48
|
-
opulent.render(Object.new, locals){}
|
49
|
-
end
|
50
|
-
end
|
51
|
-
x.report("slim") do
|
52
|
-
N.times do
|
53
|
-
slim.render(Object.new, locals){}
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|