serbea 0.10.5 → 0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serbea/rails_support.rb +14 -0
- data/lib/serbea/template_engine.rb +6 -1
- data/lib/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: b350bfc24a2bccc41291ffec1e28d213271685fd2ca27413fd5eb07d7d120a46
|
4
|
+
data.tar.gz: bae64f05c4a70a7b53656b6ec8aa88b0693c755e1c51e5fffff2c619b72d7fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4dd4fa55bbb9031a55e19da029a73e0f5bbb6b67735aef4cf24be5e009f9f2b186edcd6724b43151de6ccdd6547425befd146b22734d7dda39bf3836ebe035a
|
7
|
+
data.tar.gz: f1acbc71a92e58d1c229cbf7de524e7ac933f2547b48b551c81a44e552ae0298de8cffba6a6c77ff7c0c6507d3fc99b3999df80631832aaed9c224ccb0d2c495
|
data/lib/serbea/rails_support.rb
CHANGED
@@ -45,6 +45,20 @@ Serbea::TemplateEngine.directive :form, ->(code, buffer) do
|
|
45
45
|
buffer << " %}"
|
46
46
|
end
|
47
47
|
|
48
|
+
Serbea::TemplateEngine.directive :frame, ->(code, buffer) do
|
49
|
+
buffer << "{%= turbo_frame_tag "
|
50
|
+
buffer << code
|
51
|
+
buffer << " %}"
|
52
|
+
end
|
53
|
+
|
54
|
+
%i(append prepend update replace remove).each do |action|
|
55
|
+
Serbea::TemplateEngine.directive action, ->(code, buffer) do
|
56
|
+
buffer << "{%= turbo_stream.#{action} "
|
57
|
+
buffer << code
|
58
|
+
buffer << " %}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
48
62
|
Serbea::TemplateEngine.directive :_, ->(code, buffer) do
|
49
63
|
tag_name, space, params = code.lstrip.partition(%r(\s)m)
|
50
64
|
|
@@ -44,6 +44,11 @@ module Serbea
|
|
44
44
|
pieces.last << ")"
|
45
45
|
buffer << "{%= render#{pieces.join(" ")} %}"
|
46
46
|
end
|
47
|
+
end,
|
48
|
+
"`" => ->(code, buffer) do
|
49
|
+
buffer << "{%= %`"
|
50
|
+
buffer << code.gsub(%r("([^\\]?)\#{(.*?)}"), "\"\\1\#{h(\\2)}\"")
|
51
|
+
buffer << ".strip %}"
|
47
52
|
end
|
48
53
|
}
|
49
54
|
end
|
@@ -167,7 +172,7 @@ module Serbea
|
|
167
172
|
string = buff
|
168
173
|
buff = ""
|
169
174
|
until string.empty?
|
170
|
-
text, code, string = string.partition(/{%@([a-z_]+)?(.*?)%}/m)
|
175
|
+
text, code, string = string.partition(/{%@([a-z_`]+)?(.*?)%}/m)
|
171
176
|
|
172
177
|
buff << text
|
173
178
|
if code.length > 0
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serbea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|