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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9c0a3eb2a4490fa5d3b138183059102e6d1a15c7847ef5edb04e63e8e1d6fbe
4
- data.tar.gz: 17a4bde22b028a37aa8965414e3d0817b746bcc8b2013721094797579248e40b
3
+ metadata.gz: 9fc8f9df79eaf407fe50152a5f444651cd0129cfd042f2093fb7afa482eb03d1
4
+ data.tar.gz: 9580449853d83c9b810c8c09f7df489ca935de09c699d79afb982f30d73a5310
5
5
  SHA512:
6
- metadata.gz: 93a735d6096c6ba7665e4c6b201ee155d1abae7faf4f5d135dc90ad725800669be7780894a4ce050444989720afe835e6af317dd84d09a8c25fb7891a926288d
7
- data.tar.gz: f29cc81e17e22569d4c1030b8dd0e628ed14c52e5aca7d56bf30fbbaa8941938be3e13e957466227f68e2112a02c92d733cad6dc01002ccba0c592d7a8e15f21
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.to_s #=> "<h1>Hello World</h1>"
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.to_s #=> "Your number 1"
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
- # Override to handle Arbo elements inside helper blocks.
9
- # See https://github.com/rails/rails/issues/17661
10
- # and https://github.com/rails/rails/pull/18024#commitcomment-8975180
11
- value = value.to_s if value.is_a?(Arbo::Element)
12
-
13
- if (string = buffer.presence || value) && string.is_a?(String)
14
- ERB::Util.html_escape string
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
@@ -1,3 +1,3 @@
1
1
  module Arbo
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
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.0
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-06 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport