opulent 1.5.5 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/CODE_OF_CONDUCT.md +13 -0
  3. data/{LICENSE → LICENSE.md} +0 -0
  4. data/bin/opulent +0 -0
  5. data/lib/opulent.rb +10 -10
  6. data/lib/opulent/compiler.rb +15 -9
  7. data/lib/opulent/compiler/buffer.rb +123 -62
  8. data/lib/opulent/compiler/comment.rb +3 -4
  9. data/lib/opulent/compiler/control.rb +20 -26
  10. data/lib/opulent/compiler/define.rb +88 -36
  11. data/lib/opulent/compiler/doctype.rb +20 -22
  12. data/lib/opulent/compiler/eval.rb +23 -2
  13. data/lib/opulent/compiler/filter.rb +4 -5
  14. data/lib/opulent/compiler/node.rb +18 -12
  15. data/lib/opulent/compiler/root.rb +4 -5
  16. data/lib/opulent/compiler/text.rb +7 -2
  17. data/lib/opulent/compiler/yield.rb +2 -3
  18. data/lib/opulent/engine.rb +21 -20
  19. data/lib/opulent/exec.rb +21 -63
  20. data/lib/opulent/logger.rb +230 -3
  21. data/lib/opulent/parser.rb +14 -76
  22. data/lib/opulent/parser/comment.rb +45 -34
  23. data/lib/opulent/parser/control.rb +132 -111
  24. data/lib/opulent/parser/define.rb +15 -12
  25. data/lib/opulent/parser/doctype.rb +15 -15
  26. data/lib/opulent/parser/eval.rb +16 -6
  27. data/lib/opulent/parser/expression.rb +87 -84
  28. data/lib/opulent/parser/filter.rb +31 -25
  29. data/lib/opulent/parser/include.rb +38 -42
  30. data/lib/opulent/parser/node.rb +136 -118
  31. data/lib/opulent/parser/root.rb +24 -18
  32. data/lib/opulent/parser/text.rb +150 -123
  33. data/lib/opulent/parser/yield.rb +23 -23
  34. data/lib/opulent/settings.rb +70 -51
  35. data/lib/opulent/tokens.rb +17 -15
  36. data/lib/opulent/utils.rb +5 -4
  37. data/lib/opulent/version.rb +1 -1
  38. metadata +4 -43
  39. data/.libold/opulent.rb +0 -96
  40. data/.libold/opulent/context.rb +0 -80
  41. data/.libold/opulent/engine.rb +0 -88
  42. data/.libold/opulent/filter.rb +0 -101
  43. data/.libold/opulent/logger.rb +0 -67
  44. data/.libold/opulent/nodes.rb +0 -13
  45. data/.libold/opulent/nodes/block.rb +0 -29
  46. data/.libold/opulent/nodes/comment.rb +0 -35
  47. data/.libold/opulent/nodes/control.rb +0 -230
  48. data/.libold/opulent/nodes/define.rb +0 -42
  49. data/.libold/opulent/nodes/eval.rb +0 -41
  50. data/.libold/opulent/nodes/expression.rb +0 -28
  51. data/.libold/opulent/nodes/filter.rb +0 -70
  52. data/.libold/opulent/nodes/helper.rb +0 -69
  53. data/.libold/opulent/nodes/node.rb +0 -101
  54. data/.libold/opulent/nodes/root.rb +0 -62
  55. data/.libold/opulent/nodes/text.rb +0 -54
  56. data/.libold/opulent/nodes/theme.rb +0 -36
  57. data/.libold/opulent/parser.rb +0 -252
  58. data/.libold/opulent/parser/block.rb +0 -70
  59. data/.libold/opulent/parser/comment.rb +0 -32
  60. data/.libold/opulent/parser/control.rb +0 -83
  61. data/.libold/opulent/parser/define.rb +0 -39
  62. data/.libold/opulent/parser/eval.rb +0 -33
  63. data/.libold/opulent/parser/expression.rb +0 -350
  64. data/.libold/opulent/parser/filter.rb +0 -41
  65. data/.libold/opulent/parser/node.rb +0 -232
  66. data/.libold/opulent/parser/root.rb +0 -96
  67. data/.libold/opulent/parser/text.rb +0 -114
  68. data/.libold/opulent/parser/theme.rb +0 -36
  69. data/.libold/opulent/preprocessor.rb +0 -102
  70. data/.libold/opulent/runtime.rb +0 -144
  71. data/.libold/opulent/template.rb +0 -43
  72. data/.libold/opulent/tokens.rb +0 -276
  73. data/.libold/opulent/version.rb +0 -5
  74. data/.travis.yml +0 -4
  75. data/benchmark/benchmark.rb +0 -57
  76. data/benchmark/cases/node/node.haml +0 -7
  77. data/benchmark/cases/node/node.op +0 -7
  78. data/benchmark/cases/node/node.slim +0 -7
@@ -1,5 +0,0 @@
1
- module Opulent
2
- # Opulent version string
3
- # @api public
4
- VERSION = '0.0.1'
5
- end
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2.0
4
- before_install: gem install bundler -v 1.10.5
@@ -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
@@ -1,7 +0,0 @@
1
- - a = "hello"
2
- - kls = ['a', 'b', 'c']
3
-
4
- %html(hello=a)
5
- %head
6
- %body(class=kls)
7
- %p Hello world!
@@ -1,7 +0,0 @@
1
- - a = "hello"
2
- - kls = ['a', 'b', 'c']
3
-
4
- html hello=a
5
- head
6
- body class=kls
7
- p Hello world!
@@ -1,7 +0,0 @@
1
- - a = "hello"
2
- - kls = ['a', 'b', 'c']
3
-
4
- html hello=a
5
- head
6
- body class=kls
7
- p Hello world!