serbea 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/serbea/bridgetown_support.rb +0 -2
- data/lib/serbea/helpers.rb +4 -3
- data/lib/serbea/pipeline.rb +8 -0
- 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: c5c25c113b633bbeaaca37974b02ab662c34c803609966124ed390fccfb14440
|
4
|
+
data.tar.gz: e1126de9ab8506745882c2410d64146ac98e88d7b22fe7fa13bdbdc4afc0a1be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7daa83b85d6674c5e0a5ea657ba7fa8baaae33a5651c09983cd62a56ccd8420752283b04a0f06c26bad4350f48a964126abd1a8e3613a62015b48fe293ffe3c
|
7
|
+
data.tar.gz: acce221b376b93ce9956bf6928877c9f504ada4b31e8df1b4d5b82cdbb5a9dfd15e6e07aefcc55536a2466fbbc7a5acc5b38434813a05099b01ceb49595f9531
|
@@ -3,9 +3,7 @@ require "bridgetown-core"
|
|
3
3
|
|
4
4
|
module Bridgetown
|
5
5
|
class SerbeaView < ERBView
|
6
|
-
alias_method :_erb_capture, :capture
|
7
6
|
include Serbea::Helpers
|
8
|
-
alias_method :capture, :_erb_capture
|
9
7
|
|
10
8
|
def partial(partial_name, options = {}, &block)
|
11
9
|
options.merge!(options[:locals]) if options[:locals]
|
data/lib/serbea/helpers.rb
CHANGED
@@ -9,7 +9,8 @@ module Serbea
|
|
9
9
|
def capture(*args)
|
10
10
|
previous_buffer_state = @_erbout
|
11
11
|
@_erbout = Serbea::OutputBuffer.new
|
12
|
-
|
12
|
+
yield(*args)
|
13
|
+
result = @_erbout
|
13
14
|
@_erbout = previous_buffer_state
|
14
15
|
|
15
16
|
result&.html_safe
|
@@ -20,10 +21,10 @@ module Serbea
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def helper(name, &helper_block)
|
23
|
-
self.class.define_method(name) do |*args, &block|
|
24
|
+
self.class.define_method(name) do |*args, **kwargs, &block|
|
24
25
|
previous_buffer_state = @_erbout
|
25
26
|
@_erbout = Serbea::OutputBuffer.new
|
26
|
-
result = helper_block.call(*args, &block)
|
27
|
+
result = helper_block.call(*args, **kwargs, &block)
|
27
28
|
@_erbout = previous_buffer_state
|
28
29
|
|
29
30
|
result.is_a?(String) ? result.html_safe : result
|
data/lib/serbea/pipeline.rb
CHANGED
@@ -3,6 +3,11 @@ require "active_support/core_ext/object/blank"
|
|
3
3
|
|
4
4
|
module Serbea
|
5
5
|
class Pipeline
|
6
|
+
# Exec the pipes!
|
7
|
+
# @param template [String]
|
8
|
+
# @param locals [Hash]
|
9
|
+
# @param include_helpers [Module]
|
10
|
+
# @param kwargs [Hash]
|
6
11
|
def self.exec(template, locals = {}, include_helpers: nil, **kwargs)
|
7
12
|
anon = Class.new do
|
8
13
|
include Serbea::Helpers
|
@@ -24,9 +29,12 @@ module Serbea
|
|
24
29
|
pipeline_obj.output
|
25
30
|
end
|
26
31
|
|
32
|
+
# @param processor [Proc]
|
27
33
|
def self.output_processor=(processor)
|
28
34
|
@output_processor = processor
|
29
35
|
end
|
36
|
+
|
37
|
+
# @return [Proc]
|
30
38
|
def self.output_processor
|
31
39
|
@output_processor ||= lambda do |input|
|
32
40
|
(!input.html_safe? && self.autoescape) ? ERB::Util.h(input) : input.html_safe
|
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.11.
|
4
|
+
version: 0.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|