serbea 0.11.2 → 0.11.3

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: 11c2a260e37cfdb74aafdaebaac141b8b6ba8b5aea0d563456eb2a9dfacc0f67
4
- data.tar.gz: 0f57a10d64a9175fd7e5a343c53b619d15f4ac11a9454e2378e6f4ecfe3c7b7f
3
+ metadata.gz: c5c25c113b633bbeaaca37974b02ab662c34c803609966124ed390fccfb14440
4
+ data.tar.gz: e1126de9ab8506745882c2410d64146ac98e88d7b22fe7fa13bdbdc4afc0a1be
5
5
  SHA512:
6
- metadata.gz: 70270db753f5b0074ef1c29c0f8e7c1432732a2727bd52a009438e12dbe2b4b0b1d2149461083dfd55c6563b850f152d16cf6d921e90a5c6d474d17ffe7692fc
7
- data.tar.gz: a17429ee53917bada380a0f544c039304b29b7d7f56725e62c2a22aa5f31b8a4c9a576da6fcaaea0a13c1b7830d9243292e93057771b020850fa3384958aca8f
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]
@@ -9,7 +9,8 @@ module Serbea
9
9
  def capture(*args)
10
10
  previous_buffer_state = @_erbout
11
11
  @_erbout = Serbea::OutputBuffer.new
12
- result = yield(*args)
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Serbea
2
- VERSION = "0.11.2"
2
+ VERSION = "0.11.3"
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.11.2
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-02-20 00:00:00.000000000 Z
11
+ date: 2021-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport