arbre 1.2.0 → 1.2.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 +6 -0
- data/Gemfile.lock +4 -4
- data/lib/arbre/element.rb +1 -10
- data/lib/arbre/rails/template_handler.rb +0 -18
- data/lib/arbre/version.rb +1 -1
- data/spec/rails/integration/rendering_spec.rb +0 -15
- metadata +2 -3
- data/spec/rails/templates/arbre/page_with_helpers.arb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27066f3cf1264e3ec0cb4e5498c05b706565055fe69fbc25afe98825c90915bd
|
4
|
+
data.tar.gz: efe323ea9b3faddac096ca11d796231fd5d0872f8f4e1ffec71c2bbf452a5cd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d40b99ace19107c5b2d9089d183cce4b2eebc5229475f1ac8965df1fb6a31412d5dc0787ad618063d966ef4821ce679bd0d77ddf16a38048f13dde26192d3acc
|
7
|
+
data.tar.gz: 2346922bcc1c31da78a980ca68f20f7c8335a4fdf14c6cd90e766c23fea5cd70f0ec44aabf3ab989b9ae2f863f3b332c1e351fdb2096b59df56bef656ef324f6
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Master (unreleased)
|
4
4
|
|
5
|
+
## 1.2.1 [☰](https://github.com/activeadmin/arbre/compare/v1.2.0...v1.2.1)
|
6
|
+
|
7
|
+
* Revert [#64][] to fix several regressions, at the cost of reintroducing [#46][]. [#121][] by [@deivid-rodriguez][]
|
8
|
+
|
5
9
|
## 1.2.0 [☰](https://github.com/activeadmin/arbre/compare/v1.2.0.rc1...v1.2.0)
|
6
10
|
|
7
11
|
_No changes_.
|
@@ -72,11 +76,13 @@ Initial release and extraction from Active Admin
|
|
72
76
|
[#36]: https://github.com/activeadmin/arbre/issues/36
|
73
77
|
[#39]: https://github.com/activeadmin/arbre/issues/39
|
74
78
|
[#40]: https://github.com/activeadmin/arbre/issues/40
|
79
|
+
[#46]: https://github.com/activeadmin/arbre/issues/46
|
75
80
|
[#49]: https://github.com/activeadmin/arbre/issues/49
|
76
81
|
[#59]: https://github.com/activeadmin/arbre/issues/59
|
77
82
|
[#64]: https://github.com/activeadmin/arbre/pull/64
|
78
83
|
[#78]: https://github.com/activeadmin/arbre/pull/78
|
79
84
|
[#110]: https://github.com/activeadmin/arbre/pull/110
|
85
|
+
[#121]: https://github.com/activeadmin/arbre/pull/121
|
80
86
|
|
81
87
|
[@aramvisser]: https://github.com/aramvisser
|
82
88
|
[@LTe]: https://github.com/LTe
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
arbre (1.2.
|
4
|
+
arbre (1.2.1)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -104,8 +104,8 @@ GEM
|
|
104
104
|
nokogiri (1.10.2-java)
|
105
105
|
octokit (4.13.0)
|
106
106
|
sawyer (~> 0.8.0, >= 0.5.3)
|
107
|
-
parallel (1.
|
108
|
-
parser (2.6.
|
107
|
+
parallel (1.17.0)
|
108
|
+
parser (2.6.2.1)
|
109
109
|
ast (~> 2.4.0)
|
110
110
|
pry (0.12.2)
|
111
111
|
coderay (~> 1.1.0)
|
@@ -169,7 +169,7 @@ GEM
|
|
169
169
|
rspec-mocks (~> 3.8.0)
|
170
170
|
rspec-support (~> 3.8.0)
|
171
171
|
rspec-support (3.8.0)
|
172
|
-
rubocop (0.
|
172
|
+
rubocop (0.67.2)
|
173
173
|
jaro_winkler (~> 1.5.1)
|
174
174
|
parallel (~> 1.10)
|
175
175
|
parser (>= 2.5, != 2.5.1.1)
|
data/lib/arbre/element.rb
CHANGED
@@ -178,20 +178,11 @@ module Arbre
|
|
178
178
|
elsif assigns && assigns.has_key?(name)
|
179
179
|
assigns[name]
|
180
180
|
elsif helpers.respond_to?(name)
|
181
|
-
|
181
|
+
helpers.send(name, *args, &block)
|
182
182
|
else
|
183
183
|
super
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
-
# The helper might have a block that builds Arbre elements
|
188
|
-
# which will be rendered (#to_s) inside ActionView::Base#capture.
|
189
|
-
# We do not want such elements added to self, so we push a dummy
|
190
|
-
# current_arbre_element.
|
191
|
-
def helper_capture(name, *args, &block)
|
192
|
-
s = ""
|
193
|
-
within(Element.new) { s = helpers.send(name, *args, &block) }
|
194
|
-
s.is_a?(Element) ? s.to_s : s
|
195
|
-
end
|
196
187
|
end
|
197
188
|
end
|
@@ -1,21 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
ActionView::Base.class_eval do
|
4
|
-
def capture(*args)
|
5
|
-
value = nil
|
6
|
-
buffer = with_output_buffer { value = yield(*args) }
|
7
|
-
|
8
|
-
# Override to handle Arbre 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?(Arbre::Element)
|
12
|
-
|
13
|
-
if (string = buffer.presence || value) && string.is_a?(String)
|
14
|
-
ERB::Util.html_escape string
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
1
|
module Arbre
|
20
2
|
module Rails
|
21
3
|
class TemplateHandler
|
data/lib/arbre/version.rb
CHANGED
@@ -30,10 +30,6 @@ class TestController < ActionController::Base
|
|
30
30
|
@my_instance_var = "From Instance Var"
|
31
31
|
render "arbre/page_with_arb_partial_and_assignment"
|
32
32
|
end
|
33
|
-
|
34
|
-
def render_page_with_helpers
|
35
|
-
render "arbre/page_with_helpers"
|
36
|
-
end
|
37
33
|
end
|
38
34
|
|
39
35
|
|
@@ -100,15 +96,4 @@ describe TestController, "Rendering with Arbre", type: :request do
|
|
100
96
|
expect(body).to have_selector("p", text: "Partial: From Instance Var")
|
101
97
|
end
|
102
98
|
|
103
|
-
it "should render a page with helpers" do
|
104
|
-
get "/test/render_page_with_helpers"
|
105
|
-
expect(response).to be_successful
|
106
|
-
expect(body).to eq <<~HTML
|
107
|
-
<span>before h1 link</span>
|
108
|
-
<h1><a href="/h1_link_path">h1 link text</a></h1>
|
109
|
-
<span>before link_to block</span>
|
110
|
-
<a href="/link_path"> <i class=\"link-class\">Link text</i>
|
111
|
-
</a><span>at end</span>
|
112
|
-
HTML
|
113
|
-
end
|
114
99
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arbre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Bell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,7 +94,6 @@ files:
|
|
94
94
|
- spec/rails/templates/arbre/page_with_arb_partial_and_assignment.arb
|
95
95
|
- spec/rails/templates/arbre/page_with_assignment.arb
|
96
96
|
- spec/rails/templates/arbre/page_with_erb_partial.arb
|
97
|
-
- spec/rails/templates/arbre/page_with_helpers.arb
|
98
97
|
- spec/rails/templates/arbre/page_with_partial.arb
|
99
98
|
- spec/rails/templates/arbre/simple_page.arb
|
100
99
|
- spec/rails/templates/erb/_partial.erb
|