arbo 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/arbo/context.rb +7 -2
- data/lib/arbo/rails/template_handler.rb +12 -7
- data/lib/arbo/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: 9fc8f9df79eaf407fe50152a5f444651cd0129cfd042f2093fb7afa482eb03d1
|
4
|
+
data.tar.gz: 9580449853d83c9b810c8c09f7df489ca935de09c699d79afb982f30d73a5310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc89f575d5e3c056864185ce33ba2967fb360e54251910bd4c96bcc3dfc8de4f78138cce2f173ccc6e6514ee333f0207e46213c65628a89afc63b7078008192
|
7
|
+
data.tar.gz: 7086a9c362056322b207faa3074a3fec9a7046f29cebd545daeb1cecdb908b5090d29f27c79cd75e69a2b5e29144d6547c2304a359dcf1ce6093a56becacd0a4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.3.1 [☰](https://github.com/varyonic/arbo/compare/v1.3.0...v1.3.1)
|
4
|
+
|
5
|
+
* Fix patch of ActionView capture: OutputBuffer. [#5] by [@varyonic]
|
6
|
+
|
3
7
|
## 1.3.0 [☰](https://github.com/varyonic/arbo/compare/v1.2.0...v1.3.0)
|
4
8
|
|
5
9
|
* Support Rails 7.1. [#3] by [@varyonic]
|
@@ -85,6 +89,7 @@ Initial release and extraction from Active Admin
|
|
85
89
|
[#2]: https://github.com/varyonic/arbo/pull/2
|
86
90
|
[#3]: https://github.com/varyonic/arbo/pull/3
|
87
91
|
[#4]: https://github.com/varyonic/arbo/pull/4
|
92
|
+
[#5]: https://github.com/varyonic/arbo/pull/5
|
88
93
|
|
89
94
|
[@aramvisser]: https://github.com/aramvisser
|
90
95
|
[@deivid-rodriguez]: https://github.com/deivid-rodriguez
|
data/lib/arbo/context.rb
CHANGED
@@ -11,7 +11,7 @@ module Arbo
|
|
11
11
|
# h1 "Hello World"
|
12
12
|
# end
|
13
13
|
#
|
14
|
-
# html.
|
14
|
+
# html.render_in #=> "<h1>Hello World</h1>"
|
15
15
|
#
|
16
16
|
# The contents of the block are instance eval'd within the Context
|
17
17
|
# object. This means that you lose context to the outside world from
|
@@ -22,7 +22,7 @@ module Arbo
|
|
22
22
|
# h1 "Your number #{one}"
|
23
23
|
# end
|
24
24
|
#
|
25
|
-
# html.
|
25
|
+
# html.render_in #=> "Your number 1"
|
26
26
|
#
|
27
27
|
class Context < Element
|
28
28
|
|
@@ -46,6 +46,11 @@ module Arbo
|
|
46
46
|
instance_eval(&block) if block_given?
|
47
47
|
end
|
48
48
|
|
49
|
+
# Override default implementation, which would call deprecated Element#to_s
|
50
|
+
def inspect
|
51
|
+
"#<#{self.class}:0x#{(object_id << 1).to_s(16)}"
|
52
|
+
end
|
53
|
+
|
49
54
|
def arbo_context
|
50
55
|
self
|
51
56
|
end
|
@@ -5,13 +5,18 @@ ActionView::Base.class_eval do
|
|
5
5
|
value = nil
|
6
6
|
buffer = with_output_buffer { value = yield(*args) }
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
case string = buffer.presence || value
|
9
|
+
when ActionView::OutputBuffer
|
10
|
+
string.to_s
|
11
|
+
when ActiveSupport::SafeBuffer
|
12
|
+
string
|
13
|
+
when Arbo::Element
|
14
|
+
# Override to handle Arbo elements inside helper blocks.
|
15
|
+
# See https://github.com/rails/rails/issues/17661
|
16
|
+
# and https://github.com/rails/rails/pull/18024#commitcomment-8975180
|
17
|
+
value.render_in
|
18
|
+
when String
|
19
|
+
ERB::Util.html_escape(string)
|
15
20
|
end
|
16
21
|
end
|
17
22
|
end
|
data/lib/arbo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arbo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piers Chambers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|