rails_bootstrap_error_renderer 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +18 -7
- data/lib/rails_bootstrap_error_renderer/version.rb +1 -1
- data/lib/rails_bootstrap_error_renderer.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf2e26b0d1e42749178bfeed3fb5badc0c765f17afed9589ef69afdbd33f302
|
4
|
+
data.tar.gz: 0b31f95dc9d57056d93c74018428af4a8db9f7c50348df051a6e4e555774165d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e5f23c961e08d2de5748e091b7248831627f70f9e5bb357bc6f984601fbbaf776812f9499869da0654cbf14b378cc707bc9fcd004bdcb1f5aef7735957b39cc
|
7
|
+
data.tar.gz: 3b21dacce503fbd90be84df0c9263879aaaa3e2963df0e9108e295ded0cf9d6ea1720ea31ed3d9f10abddfa66941cf848e04b1f9a7e67d737007ae73f4227df8
|
data/Gemfile.lock
CHANGED
@@ -1,31 +1,41 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rails_bootstrap_error_renderer (1.
|
4
|
+
rails_bootstrap_error_renderer (1.2.0)
|
5
5
|
activesupport
|
6
6
|
nokogiri
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (7.
|
11
|
+
activesupport (7.1.3.4)
|
12
|
+
base64
|
13
|
+
bigdecimal
|
12
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
connection_pool (>= 2.2.5)
|
16
|
+
drb
|
13
17
|
i18n (>= 1.6, < 2)
|
14
18
|
minitest (>= 5.1)
|
19
|
+
mutex_m
|
15
20
|
tzinfo (~> 2.0)
|
16
21
|
ast (2.4.2)
|
17
|
-
|
18
|
-
|
22
|
+
base64 (0.2.0)
|
23
|
+
bigdecimal (3.1.8)
|
24
|
+
concurrent-ruby (1.3.3)
|
25
|
+
connection_pool (2.4.1)
|
26
|
+
drb (2.2.1)
|
27
|
+
i18n (1.14.5)
|
19
28
|
concurrent-ruby (~> 1.0)
|
20
29
|
json (2.6.2)
|
21
30
|
minitest (5.16.3)
|
22
31
|
mocha (1.14.0)
|
23
|
-
|
32
|
+
mutex_m (0.2.0)
|
33
|
+
nokogiri (1.16.6-arm64-darwin)
|
24
34
|
racc (~> 1.4)
|
25
35
|
parallel (1.22.1)
|
26
36
|
parser (3.1.2.1)
|
27
37
|
ast (~> 2.4.1)
|
28
|
-
racc (1.
|
38
|
+
racc (1.8.0)
|
29
39
|
rainbow (3.1.1)
|
30
40
|
rake (13.0.6)
|
31
41
|
regexp_parser (2.5.0)
|
@@ -49,12 +59,13 @@ GEM
|
|
49
59
|
standard (1.16.1)
|
50
60
|
rubocop (= 1.35.1)
|
51
61
|
rubocop-performance (= 1.14.3)
|
52
|
-
tzinfo (2.0.
|
62
|
+
tzinfo (2.0.6)
|
53
63
|
concurrent-ruby (~> 1.0)
|
54
64
|
unicode-display_width (2.3.0)
|
55
65
|
|
56
66
|
PLATFORMS
|
57
67
|
arm64-darwin-21
|
68
|
+
arm64-darwin-23
|
58
69
|
|
59
70
|
DEPENDENCIES
|
60
71
|
minitest (~> 5.0)
|
@@ -10,13 +10,18 @@ module RailsBootstrapErrorRenderer
|
|
10
10
|
def self.render(html, instance)
|
11
11
|
fragment = Nokogiri::HTML::DocumentFragment.parse(html)
|
12
12
|
element = fragment.children[0]
|
13
|
-
if element
|
13
|
+
if should_process_element?(element)
|
14
14
|
render_for_element(element, instance)
|
15
15
|
else
|
16
16
|
html
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.should_process_element?(element)
|
21
|
+
return unless element
|
22
|
+
element.attributes["data-render-errors"].to_s != "false"
|
23
|
+
end
|
24
|
+
|
20
25
|
def self.render_for_element(element, instance)
|
21
26
|
element.add_class("is-invalid")
|
22
27
|
if applicable_input? element
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_bootstrap_error_renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Sterba
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.4.10
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Simple renderer to display errors in Bootstrap styled Rails forms.
|