view_component 2.59.0 → 2.60.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of view_component might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +6 -0
- data/lib/view_component/render_preview_helper.rb +11 -1
- data/lib/view_component/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: b74cdfd2d8306224e0fc89d244d70f08fbf779ec9a892affd0fe766b16a4ac6d
|
4
|
+
data.tar.gz: d401c34f06238713ba43d97e5b50b9db647f946f8937e964c57578918b3418fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3c56fb2399e387fb57f6976264ea7aa3d3ce9e4490a741cf660876fe90fb5265bf80a865887a082cf282259a04b8477416546bdd21a2be08ac21744aa8316b5
|
7
|
+
data.tar.gz: 71049fb1fcc3cd1a09404feb9ab7a5aee6b2c9e5dc88c377233472953ee3e498f4a95a973033d717413e8d128a0ea3e95d955885692581b9e62c26fb66a18d0f
|
data/docs/CHANGELOG.md
CHANGED
@@ -15,11 +15,21 @@ module ViewComponent
|
|
15
15
|
#
|
16
16
|
# MyComponentTest -> MyComponentPreview etc.
|
17
17
|
#
|
18
|
+
# In RSpec, `Preview` is appended to `described_class`.
|
19
|
+
#
|
18
20
|
# @param preview [String] The name of the preview to be rendered.
|
19
21
|
# @return [Nokogiri::HTML]
|
20
22
|
def render_preview(name)
|
21
23
|
begin
|
22
|
-
preview_klass =
|
24
|
+
preview_klass = if respond_to?(:described_class)
|
25
|
+
if described_class.nil?
|
26
|
+
raise "`render_preview` expected a described_class, but it is nil."
|
27
|
+
end
|
28
|
+
|
29
|
+
"#{described_class}Preview"
|
30
|
+
else
|
31
|
+
self.class.name.gsub("Test", "Preview")
|
32
|
+
end
|
23
33
|
preview_klass = preview_klass.constantize
|
24
34
|
rescue NameError
|
25
35
|
raise NameError.new(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.60.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|