rbexy 2.0.0.beta7 → 2.0.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rbexy/nodes/expression_group.rb +17 -3
- data/lib/rbexy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e6c7e84344a63e1d1992827aedcafdd968ce9372e35bb6a8d01e66b46be34e0
|
4
|
+
data.tar.gz: 497be0f074210d5f43efe9a38e72d41972b309fc8294fa413db097afdf0cb8e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c18d3a259f7ce7ad630e2a39a8241ad0b6ce6bde8ea9ac55bd601cd6378b39e3201c011f8b6348bd4aaf86b780817a6b52db45cfa86a851e854b7c62cfb4285
|
7
|
+
data.tar.gz: dcf0db849b73ef8c817247c53812359273ed23f4016325288f91d066c449e41ddfc98cb94a924c2dc06ddf1f3d4e56f1998cc91728619c8ddd66c30f2f4faab2
|
data/Gemfile.lock
CHANGED
@@ -7,19 +7,27 @@ module Rbexy
|
|
7
7
|
attr_accessor :members
|
8
8
|
attr_reader :outer_template, :inner_template
|
9
9
|
|
10
|
+
DEBUGGERS = %w[debugger binding.pry]
|
11
|
+
|
10
12
|
OUTPUT_UNSAFE = "@output_buffer.concat(Rbexy::Runtime.expr_out(%s));"
|
11
13
|
OUTPUT_SAFE = "@output_buffer.safe_concat(Rbexy::Runtime.expr_out(%s));"
|
12
|
-
|
14
|
+
RAW = "%s"
|
15
|
+
DEBUGGER = "#{RAW}\n"
|
16
|
+
SUB_EXPR = RAW
|
13
17
|
SUB_EXPR_OUT = "Rbexy::Runtime.expr_out(%s)"
|
14
18
|
|
15
|
-
def initialize(members, outer_template: OUTPUT_UNSAFE, inner_template:
|
19
|
+
def initialize(members, outer_template: OUTPUT_UNSAFE, inner_template: RAW)
|
16
20
|
@members = members
|
17
21
|
@outer_template = outer_template
|
18
22
|
@inner_template = inner_template
|
19
23
|
end
|
20
24
|
|
21
25
|
def precompile
|
22
|
-
[
|
26
|
+
[if debugger?
|
27
|
+
ExpressionGroup.new(precompile_members, outer_template: DEBUGGER, inner_template: RAW)
|
28
|
+
else
|
29
|
+
ExpressionGroup.new(precompile_members, outer_template: outer_template, inner_template: inner_template)
|
30
|
+
end]
|
23
31
|
end
|
24
32
|
|
25
33
|
def compile
|
@@ -50,6 +58,12 @@ module Rbexy
|
|
50
58
|
Expression.new("+")
|
51
59
|
end
|
52
60
|
end
|
61
|
+
|
62
|
+
def debugger?
|
63
|
+
members.length == 1 &&
|
64
|
+
members.first.is_a?(Expression) &&
|
65
|
+
DEBUGGERS.include?(members.first.content.strip)
|
66
|
+
end
|
53
67
|
end
|
54
68
|
end
|
55
69
|
end
|
data/lib/rbexy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbexy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Giancola
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|