nice_partials 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/nice_partials/monkey_patch.rb +8 -1
- data/lib/nice_partials/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a2bc1c656f72b37d7766bd5353a4320fc516dd2bfa808352f8b96217991c78b
|
4
|
+
data.tar.gz: fefb7742857fec22b402f714ce10e5d4e6b33279b3fe7abdb84b1408b31cb38c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40b811eb0e0231da0ed04d023af718200400880dffac5e64cb8f8c80de2f30ae187fb0e4c43235d305f1a60e74c321b370c4ff6d07a18fc975becea8c5faa975
|
7
|
+
data.tar.gz: 9ae278eb935fc27bb1f7ae46bb71efcdbf84d3ef0157e0897f4412208a1c8864251a8f8cec5ea9961d01c1884f451b6695c2a8862d2456c4f7ee2698a124362a
|
data/README.md
CHANGED
@@ -50,7 +50,7 @@ Nice Partials is a lightweight and hopefully more Rails-native alternative to [V
|
|
50
50
|
|
51
51
|
## Benefits of Nice Partials
|
52
52
|
|
53
|
-
|
53
|
+
Nice Partials:
|
54
54
|
|
55
55
|
- is just regular Rails view partials like you're used to.
|
56
56
|
- reduces the friction when extracting components.
|
@@ -13,7 +13,14 @@ class ActionView::PartialRenderer
|
|
13
13
|
context.nice_partials_push_t_prefix ''
|
14
14
|
end
|
15
15
|
|
16
|
-
|
16
|
+
begin
|
17
|
+
result = original_render(partial, context, block)
|
18
|
+
rescue Exception => exception
|
19
|
+
# If there was some sort of exception thrown, we also need to pop the `t` prefix.
|
20
|
+
# This provides compatibility with other libraries that depend on catching exceptions from the view renderer.
|
21
|
+
context.nice_partials_pop_t_prefix
|
22
|
+
raise exception
|
23
|
+
end
|
17
24
|
|
18
25
|
# Whether there was a block or not, pop off whatever we put on the stack.
|
19
26
|
context.nice_partials_pop_t_prefix
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nice_partials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
- Dom Christie
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -70,7 +70,7 @@ homepage: https://github.com/bullet-train-co/nice_partials
|
|
70
70
|
licenses:
|
71
71
|
- MIT
|
72
72
|
metadata: {}
|
73
|
-
post_install_message:
|
73
|
+
post_install_message:
|
74
74
|
rdoc_options: []
|
75
75
|
require_paths:
|
76
76
|
- lib
|
@@ -85,8 +85,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
89
|
-
signing_key:
|
88
|
+
rubygems_version: 3.2.22
|
89
|
+
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: A little bit of magic to make partials perfect for components.
|
92
92
|
test_files:
|