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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0aa3994d0779dc0bada9d35a6125dafd4501070f780bd353384a1f72bd1be54
4
- data.tar.gz: 455373e852ca5f680adf28d7efe3198e34b97f84d1fb93d58ab32eac84bde61b
3
+ metadata.gz: b350bfc24a2bccc41291ffec1e28d213271685fd2ca27413fd5eb07d7d120a46
4
+ data.tar.gz: bae64f05c4a70a7b53656b6ec8aa88b0693c755e1c51e5fffff2c619b72d7fa9
5
5
  SHA512:
6
- metadata.gz: 9b37ea92fed79e50c3e67ee81e06dfd9daf8c969ee6b6901312b8a74295d73f7a82e7b1fa34555feccd9c877e4e6322cb27e22acd3a3fab30a0b145318bbf221
7
- data.tar.gz: 37a8dbcf0799f9cdf352bbe633d959ea6f5ec1ba082ba918d223794b0e00b5a2377f5d960f57d7d47dc5db756cb5a12636062359bfe3922878593cbf286b6299
6
+ metadata.gz: f4dd4fa55bbb9031a55e19da029a73e0f5bbb6b67735aef4cf24be5e009f9f2b186edcd6724b43151de6ccdd6547425befd146b22734d7dda39bf3836ebe035a
7
+ data.tar.gz: f1acbc71a92e58d1c229cbf7de524e7ac933f2547b48b551c81a44e552ae0298de8cffba6a6c77ff7c0c6507d3fc99b3999df80631832aaed9c224ccb0d2c495
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Serbea
2
- VERSION = "0.10.5"
2
+ VERSION = "0.11"
3
3
  end
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.10.5
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-09 00:00:00.000000000 Z
11
+ date: 2020-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport