superglue 0.53.0 → 0.53.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/rails/templates/edit.json.props +2 -2
- data/lib/generators/rails/templates/new.json.props +2 -2
- data/lib/generators/rails/templates/web/edit.js +4 -4
- data/lib/generators/rails/templates/web/new.js +4 -4
- data/lib/install/templates/web/application.json.props +1 -1
- data/lib/superglue/helpers.rb +3 -19
- data/lib/superglue.rb +0 -1
- metadata +2 -86
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 280ae24037b8a75c5173d9b4ed191d1e6661d25dfea3ddc21987ca8f39464f18
|
4
|
+
data.tar.gz: a94b4fa59affad9b246e0561c58ee6fc4012c4a3c08d73557cd92f032d957b32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db0beb0224b67b309a846825ac6ee40634661b51eedf3e7f686cd6e6fed2fd253c8b4510a9c0c5dafe4bf51b5544413286a8f3c7f7e935c6b245f211429c724
|
7
|
+
data.tar.gz: 2c1a8bd715494f92e9ffeae54bec3555b1b5731ae137da606979d52bbfac7775a694772d8a0274131174799995d62442bb3a37471a27d8786372877398c44d40
|
@@ -1,6 +1,6 @@
|
|
1
|
-
if
|
1
|
+
if @<%= singular_table_name %>.errors.any?
|
2
2
|
json.errors({
|
3
|
-
explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this
|
3
|
+
explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:",
|
4
4
|
messages: @<%= singular_table_name %>.errors.full_messages.map{|msg| {body: msg}}
|
5
5
|
})
|
6
6
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
if
|
1
|
+
if @<%= singular_table_name %>.errors.any?
|
2
2
|
json.errors({
|
3
|
-
explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this
|
3
|
+
explanation: "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:",
|
4
4
|
messages: @<%= singular_table_name %>.errors.full_messages.map{|msg| {body: msg}}
|
5
5
|
})
|
6
6
|
end
|
@@ -5,14 +5,14 @@ export default function <%= plural_table_name.camelize %>Edit ({
|
|
5
5
|
// visit,
|
6
6
|
// remote,
|
7
7
|
form,
|
8
|
-
|
8
|
+
errors,
|
9
9
|
<%= singular_table_name.camelize(:lower) %>Path,
|
10
10
|
<%= plural_table_name.camelize(:lower) %>Path,
|
11
11
|
}) {
|
12
|
-
const messagesEl =
|
12
|
+
const messagesEl = errors && (
|
13
13
|
<div id="error_explanation">
|
14
|
-
<h2>{
|
15
|
-
<ul>{
|
14
|
+
<h2>{ errors.explanation }</h2>
|
15
|
+
<ul>{ errors.messages.map(({body})=> <li key={body}>{body}</li>) }</ul>
|
16
16
|
</div>
|
17
17
|
)
|
18
18
|
|
@@ -5,13 +5,13 @@ export default function <%= plural_table_name.camelize %>New({
|
|
5
5
|
// visit,
|
6
6
|
// remote
|
7
7
|
form,
|
8
|
-
|
8
|
+
errors,
|
9
9
|
<%= plural_table_name.camelize(:lower) %>Path,
|
10
10
|
}) {
|
11
|
-
const messagesEl =
|
11
|
+
const messagesEl = errors && (
|
12
12
|
<div id="error_explanation">
|
13
|
-
<h2>{
|
14
|
-
<ul>{
|
13
|
+
<h2>{ errors.explanation }</h2>
|
14
|
+
<ul>{ errors.messages.map(({body})=> <li key={body}>{body}</li>) }</ul>
|
15
15
|
</div>
|
16
16
|
)
|
17
17
|
|
data/lib/superglue/helpers.rb
CHANGED
@@ -16,27 +16,11 @@ module Superglue
|
|
16
16
|
|
17
17
|
def param_to_search_path(param)
|
18
18
|
if param
|
19
|
-
param
|
19
|
+
param
|
20
|
+
.gsub(/[^\da-zA-Z_=.]+/, "")
|
21
|
+
.squeeze(".")
|
20
22
|
.split(".")
|
21
|
-
.map do |part|
|
22
|
-
if /^-?[0-9]+$/.match?(part)
|
23
|
-
part.to_i
|
24
|
-
else
|
25
|
-
part
|
26
|
-
end
|
27
|
-
end
|
28
23
|
end
|
29
24
|
end
|
30
|
-
|
31
|
-
def search_path_to_camelized_param(path)
|
32
|
-
path.map do |part|
|
33
|
-
if part.include? "="
|
34
|
-
key, rest = part.split("=")
|
35
|
-
[key.camelize(:lower), rest].join("=")
|
36
|
-
else
|
37
|
-
part.camelize(:lower)
|
38
|
-
end
|
39
|
-
end.join(".")
|
40
|
-
end
|
41
25
|
end
|
42
26
|
end
|
data/lib/superglue.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superglue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.53.
|
4
|
+
version: 0.53.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johny Ho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -52,90 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.0.5
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: activerecord
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '7.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '7.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rake
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '12.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '12.0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: sqlite3
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.3'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.3'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: minitest
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '5.10'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '5.10'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: capybara
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '3.0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '3.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: selenium-webdriver
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '3.11'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '3.11'
|
139
55
|
description: Rails integration for SuperglueJS
|
140
56
|
email: jho406@gmail.com
|
141
57
|
executables: []
|