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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/streamlined/helpers.rb +8 -6
- data/lib/streamlined/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64c3e44e98c33631cefb78810cd8aff9b92847b0a8a4ef7c858c4bc06f3475a7
|
4
|
+
data.tar.gz: d97b35a710c00a1965f5e0f7cfedc53417b951eef53afcf70d3410e0b2892921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 701443af9bddfeb173d728631918854bde0b32f00cf9dce963220ac9624490564fa613d4f2199b9011f9dc1cd3e75dea8e8039269028c40e37b93bc58b2a3fcc
|
7
|
+
data.tar.gz: 5c2030736d89340f207944ce0ea1db48990310eed4a6c3146f840d55ff89c6d51cd0219fb8872095a830d133203cd27f6ae0c6227f0f89b2c625d710bc8fbe96
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/streamlined/helpers.rb
CHANGED
@@ -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 =
|
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
|
data/lib/streamlined/version.rb
CHANGED