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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97a3fcda88057f9554949f70bbc5dcd30910354e6eb4a4cd1a83e0b53bd30322
4
- data.tar.gz: fe5f40ad4f4820233e2c555e9c0d13852774c75e40d03e1ac6357157e87d6a22
3
+ metadata.gz: 1e6c7e84344a63e1d1992827aedcafdd968ce9372e35bb6a8d01e66b46be34e0
4
+ data.tar.gz: 497be0f074210d5f43efe9a38e72d41972b309fc8294fa413db097afdf0cb8e5
5
5
  SHA512:
6
- metadata.gz: d819a2cdd14c75b73b0fc88aabb57cff4666232601a0cf7aeb554a7841313bfdb9f6a56f43d672bec493e14b4a5fcd6f01613ead04ea1609d36e75368352576a
7
- data.tar.gz: 18c2566b9851268b689e43800dd0a9876224c181cd089750416fc2202c65613cc57717c3a354c5da90cecbd6cb2258ec911e56aff59dc44739ee1bf14b5bccce
6
+ metadata.gz: 8c18d3a259f7ce7ad630e2a39a8241ad0b6ce6bde8ea9ac55bd601cd6378b39e3201c011f8b6348bd4aaf86b780817a6b52db45cfa86a851e854b7c62cfb4285
7
+ data.tar.gz: dcf0db849b73ef8c817247c53812359273ed23f4016325288f91d066c449e41ddfc98cb94a924c2dc06ddf1f3d4e56f1998cc91728619c8ddd66c30f2f4faab2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbexy (2.0.0.beta7)
4
+ rbexy (2.0.0.beta8)
5
5
  actionview (>= 6.0, < 7.0)
6
6
  activesupport (>= 6.0, < 7.0)
7
7
 
@@ -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
- SUB_EXPR = "%s"
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: "%s")
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
- [ExpressionGroup.new(precompile_members, outer_template: outer_template, inner_template: inner_template)]
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
@@ -1,3 +1,3 @@
1
1
  module Rbexy
2
- VERSION = "2.0.0.beta7"
2
+ VERSION = "2.0.0.beta8"
3
3
  end
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.beta7
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-18 00:00:00.000000000 Z
11
+ date: 2021-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport