streamlined 0.5.1 → 0.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcc0a9b6b0ecfe8dea09c22adf936d6de78a260fc5948670b7d5f650d08f2a9c
4
- data.tar.gz: 340bb32a6e17eb18b34d9ceeda061890cf1209f7d9777451542e98e612057a7e
3
+ metadata.gz: 64c3e44e98c33631cefb78810cd8aff9b92847b0a8a4ef7c858c4bc06f3475a7
4
+ data.tar.gz: d97b35a710c00a1965f5e0f7cfedc53417b951eef53afcf70d3410e0b2892921
5
5
  SHA512:
6
- metadata.gz: 13c5d919ca388018eaade16466e3e74f58a289a6fbfc632d948ec45c22f40d784b5a657e1c61f76780263766c22fc896a12f06e2d593a3c3874a1bafeeb1683e
7
- data.tar.gz: 8bdbf7d17cec2924d09e3597844080bba08c01d962f3c0d3bbf3ac9cb4ad89a7fde4feedc83b49d0fd05de22a3ce6b7b62acf4ca6a57577b819a0142595c7264
6
+ metadata.gz: 701443af9bddfeb173d728631918854bde0b32f00cf9dce963220ac9624490564fa613d4f2199b9011f9dc1cd3e75dea8e8039269028c40e37b93bc58b2a3fcc
7
+ data.tar.gz: 5c2030736d89340f207944ce0ea1db48990310eed4a6c3146f840d55ff89c6d51cd0219fb8872095a830d133203cd27f6ae0c6227f0f89b2c625d710bc8fbe96
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.5.2] - 2024-04-06
6
+
7
+ - And we need that same fix for `text` too
8
+
5
9
  ## [0.5.1] - 2024-04-06
6
10
 
7
11
  - Fix logic bug in `html`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- streamlined (0.5.1)
4
+ streamlined (0.5.2)
5
5
  serbea (>= 2.1)
6
6
  zeitwerk (~> 2.5)
7
7
 
@@ -7,6 +7,12 @@ module Streamlined
7
7
  module TouchableProc
8
8
  attr_accessor :touched
9
9
 
10
+ def self.run_through_pipeline(in_context_binding, input, callback)
11
+ Serbea::Pipeline.new(in_context_binding, input).tap { _1.instance_exec(&callback) }.then do |pipeline|
12
+ -> { pipeline.value }
13
+ end
14
+ end
15
+
10
16
  def touch
11
17
  self.touched = true
12
18
  self
@@ -79,7 +85,7 @@ module Streamlined
79
85
  end
80
86
 
81
87
  def text(callback, piping = nil)
82
- callback = Serbea::Pipeline.new(binding, callback).tap { _1.instance_exec(&piping) } if piping
88
+ callback = TouchableProc.run_through_pipeline(binding, callback, piping) if piping
83
89
 
84
90
  (callback.is_a?(Proc) ? callback.touch : callback).to_s.then do |str|
85
91
  next str if str.html_safe?
@@ -89,11 +95,7 @@ module Streamlined
89
95
  end
90
96
 
91
97
  def html(callback, piping = nil)
92
- if piping
93
- callback = Serbea::Pipeline.new(binding, callback).tap { _1.instance_exec(&piping) }.then do |pipeline|
94
- -> { pipeline.value }
95
- end
96
- end
98
+ callback = TouchableProc.run_through_pipeline(binding, callback, piping) if piping
97
99
 
98
100
  callback.html_safe.touch
99
101
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Streamlined
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streamlined
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team