protos-protoform 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d87996776d7c98ac20d0f3f043bda6364cfe22be19ed00820e5c48df504837a5
4
- data.tar.gz: 506204d5092faccefb7eaab6506e437f43faa8b741322e84533589e8f5cd7334
3
+ metadata.gz: 3bc26745e32d0e8702d9fdb3606083afbe57843fa28ccd02672bf9e03e9d2e03
4
+ data.tar.gz: 44765738946f4fdd500bbb9e120ba9fa0d744206606bdac925a7abae9fa19ade
5
5
  SHA512:
6
- metadata.gz: d6d4dad661cafa7395860cd52f131f8a536311f2a8c150f4c673d0136c6fa9dd69b66b144d06dec171c72d868ac5b00e8b890eb693073bf4c530d938e1d470c1
7
- data.tar.gz: f25ccd64a68b57a41be47590cc5d3ed4d4cc39f3f8f055fb69bf6ed60008aff768fef68158030313ffb2aa0df4b1d6250b1e26c8779120b0308d12b7cb2ebd55
6
+ metadata.gz: a4268976b1a3658b4f2de87f45570c78d92867931a2712c855bd45022471fda6981e8c2c06ef146bab9b4d740a69984d71cd22c77c3723e59dc0b5f2fefeeb7b
7
+ data.tar.gz: f39dda31e9dd6527326b09e23111630f407d4c1adb53c2d21e113c668f5684691f78f142a9a43603d40abcd96f18a8b14c319a657aaccc9215de0e27d61b9bd6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2025-01-26
4
+
5
+ - Bumps `protos` to `~> 0.7`
6
+ - Bumps `activerecord` and `activesupport` requirements to `~> 8.0`
7
+ - Hides authenticity token and method field when the form has a GET method
8
+ automatically
9
+ - Fixes passing symbol values to labels
10
+ - Fixes passing wrong values to radio button components
11
+
3
12
  ## [0.1.0] - 2024-09-04
4
13
 
5
14
  - Adds tests for all Rails components
data/Gemfile.lock CHANGED
@@ -2,40 +2,40 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  protos-protoform (0.1.0)
5
- activerecord (~> 7.0)
6
- activesupport (~> 7.0)
5
+ activerecord (~> 8.0)
6
+ activesupport (~> 8.0)
7
7
  phlex-rails (~> 1.0)
8
- protos (~> 0.6)
9
- zeitwerk (~> 2.6)
8
+ protos (~> 0.7)
9
+ zeitwerk (~> 2.7)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actionpack (7.2.1)
15
- actionview (= 7.2.1)
16
- activesupport (= 7.2.1)
14
+ actionpack (8.0.1)
15
+ actionview (= 8.0.1)
16
+ activesupport (= 8.0.1)
17
17
  nokogiri (>= 1.8.5)
18
- racc
19
- rack (>= 2.2.4, < 3.2)
18
+ rack (>= 2.2.4)
20
19
  rack-session (>= 1.0.1)
21
20
  rack-test (>= 0.6.3)
22
21
  rails-dom-testing (~> 2.2)
23
22
  rails-html-sanitizer (~> 1.6)
24
23
  useragent (~> 0.16)
25
- actionview (7.2.1)
26
- activesupport (= 7.2.1)
24
+ actionview (8.0.1)
25
+ activesupport (= 8.0.1)
27
26
  builder (~> 3.1)
28
27
  erubi (~> 1.11)
29
28
  rails-dom-testing (~> 2.2)
30
29
  rails-html-sanitizer (~> 1.6)
31
- activemodel (7.2.1)
32
- activesupport (= 7.2.1)
33
- activerecord (7.2.1)
34
- activemodel (= 7.2.1)
35
- activesupport (= 7.2.1)
30
+ activemodel (8.0.1)
31
+ activesupport (= 8.0.1)
32
+ activerecord (8.0.1)
33
+ activemodel (= 8.0.1)
34
+ activesupport (= 8.0.1)
36
35
  timeout (>= 0.4.0)
37
- activesupport (7.2.1)
36
+ activesupport (8.0.1)
38
37
  base64
38
+ benchmark (>= 0.3)
39
39
  bigdecimal
40
40
  concurrent-ruby (~> 1.0, >= 1.3.1)
41
41
  connection_pool (>= 2.2.5)
@@ -45,11 +45,13 @@ GEM
45
45
  minitest (>= 5.1)
46
46
  securerandom (>= 0.3)
47
47
  tzinfo (~> 2.0, >= 2.0.5)
48
+ uri (>= 0.13.1)
48
49
  addressable (2.8.7)
49
50
  public_suffix (>= 2.0.2, < 7.0)
50
51
  ast (2.4.2)
51
52
  base64 (0.2.0)
52
- bigdecimal (3.1.8)
53
+ benchmark (0.4.0)
54
+ bigdecimal (3.1.9)
53
55
  builder (3.3.0)
54
56
  capybara (3.40.0)
55
57
  addressable
@@ -60,99 +62,107 @@ GEM
60
62
  rack-test (>= 0.6.3)
61
63
  regexp_parser (>= 1.5, < 3.0)
62
64
  xpath (~> 3.2)
63
- concurrent-ruby (1.3.4)
64
- connection_pool (2.4.1)
65
+ concurrent-ruby (1.3.5)
66
+ connection_pool (2.5.0)
65
67
  crass (1.0.6)
66
- debug (1.9.2)
68
+ date (3.4.1)
69
+ debug (1.10.0)
67
70
  irb (~> 1.10)
68
71
  reline (>= 0.3.8)
69
72
  diff-lcs (1.5.1)
70
73
  drb (2.2.1)
71
- dry-core (1.0.1)
74
+ dry-core (1.1.0)
72
75
  concurrent-ruby (~> 1.0)
76
+ logger
73
77
  zeitwerk (~> 2.6)
74
- dry-inflector (1.1.0)
75
- dry-initializer (3.1.1)
76
- dry-logic (1.5.0)
78
+ dry-inflector (1.2.0)
79
+ dry-initializer (3.2.0)
80
+ dry-logic (1.6.0)
81
+ bigdecimal
77
82
  concurrent-ruby (~> 1.0)
78
- dry-core (~> 1.0, < 2)
83
+ dry-core (~> 1.1)
79
84
  zeitwerk (~> 2.6)
80
- dry-types (1.7.2)
85
+ dry-types (1.8.1)
81
86
  bigdecimal (~> 3.0)
82
87
  concurrent-ruby (~> 1.0)
83
88
  dry-core (~> 1.0)
84
89
  dry-inflector (~> 1.0)
85
90
  dry-logic (~> 1.4)
86
91
  zeitwerk (~> 2.6)
87
- erubi (1.13.0)
88
- i18n (1.14.5)
92
+ erubi (1.13.1)
93
+ i18n (1.14.7)
89
94
  concurrent-ruby (~> 1.0)
90
- io-console (0.7.2)
91
- irb (1.14.0)
95
+ io-console (0.8.0)
96
+ irb (1.15.1)
97
+ pp (>= 0.6.0)
92
98
  rdoc (>= 4.0.0)
93
99
  reline (>= 0.4.2)
94
- json (2.7.2)
100
+ json (2.9.1)
95
101
  language_server-protocol (3.17.0.3)
96
- logger (1.6.1)
97
- loofah (2.22.0)
102
+ logger (1.6.5)
103
+ loofah (2.24.0)
98
104
  crass (~> 1.0.2)
99
105
  nokogiri (>= 1.12.0)
100
- lru_redux (1.1.0)
101
106
  matrix (0.4.2)
102
107
  mini_mime (1.1.5)
103
- minitest (5.25.1)
104
- nokogiri (1.16.7-aarch64-linux)
108
+ mini_portile2 (2.8.8)
109
+ minitest (5.25.4)
110
+ nokogiri (1.18.2)
111
+ mini_portile2 (~> 2.8.2)
105
112
  racc (~> 1.4)
106
- nokogiri (1.16.7-arm-linux)
113
+ nokogiri (1.18.2-aarch64-linux-gnu)
107
114
  racc (~> 1.4)
108
- nokogiri (1.16.7-arm64-darwin)
115
+ nokogiri (1.18.2-arm-linux-gnu)
109
116
  racc (~> 1.4)
110
- nokogiri (1.16.7-x86-linux)
117
+ nokogiri (1.18.2-arm64-darwin)
111
118
  racc (~> 1.4)
112
- nokogiri (1.16.7-x86_64-darwin)
119
+ nokogiri (1.18.2-x86_64-darwin)
113
120
  racc (~> 1.4)
114
- nokogiri (1.16.7-x86_64-linux)
121
+ nokogiri (1.18.2-x86_64-linux-gnu)
115
122
  racc (~> 1.4)
116
123
  parallel (1.26.3)
117
- parser (3.3.5.0)
124
+ parser (3.3.7.0)
118
125
  ast (~> 2.4.1)
119
126
  racc
120
127
  phlex (1.11.0)
121
- phlex-rails (1.1.1)
122
- phlex (~> 1.9)
123
- railties (>= 6.1, < 8)
124
- zeitwerk (~> 2.6)
128
+ phlex-rails (1.2.2)
129
+ phlex (>= 1.10, < 2)
130
+ railties (>= 6.1, < 9)
125
131
  phlex-testing-capybara (0.1.0)
126
132
  capybara (~> 3.38)
127
133
  phlex (>= 0.5)
128
- protos (0.6.0)
134
+ pp (0.6.2)
135
+ prettyprint
136
+ prettyprint (0.2.0)
137
+ protos (0.7.0)
129
138
  dry-core (~> 1.0)
130
139
  dry-initializer (~> 3.1)
131
140
  dry-types (~> 1.7)
132
141
  phlex (~> 1.10)
133
142
  tailwind_merge (~> 0.10)
134
- psych (5.1.2)
143
+ psych (5.2.3)
144
+ date
135
145
  stringio
136
146
  public_suffix (6.0.1)
137
147
  racc (1.8.1)
138
- rack (3.1.7)
139
- rack-session (2.0.0)
148
+ rack (3.1.8)
149
+ rack-session (2.1.0)
150
+ base64 (>= 0.1.0)
140
151
  rack (>= 3.0.0)
141
- rack-test (2.1.0)
152
+ rack-test (2.2.0)
142
153
  rack (>= 1.3)
143
- rackup (2.1.0)
154
+ rackup (2.2.1)
144
155
  rack (>= 3)
145
- webrick (~> 1.8)
146
156
  rails-dom-testing (2.2.0)
147
157
  activesupport (>= 5.0.0)
148
158
  minitest
149
159
  nokogiri (>= 1.6)
150
- rails-html-sanitizer (1.6.0)
160
+ rails-html-sanitizer (1.6.2)
151
161
  loofah (~> 2.21)
152
- nokogiri (~> 1.14)
153
- railties (7.2.1)
154
- actionpack (= 7.2.1)
155
- activesupport (= 7.2.1)
162
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
163
+ railties (8.0.1)
164
+ actionpack (= 8.0.1)
165
+ activesupport (= 8.0.1)
156
166
  irb (~> 1.13)
157
167
  rackup (>= 1.0.0)
158
168
  rake (>= 12.2)
@@ -160,41 +170,41 @@ GEM
160
170
  zeitwerk (~> 2.6)
161
171
  rainbow (3.1.1)
162
172
  rake (13.2.1)
163
- rdoc (6.7.0)
173
+ rdoc (6.11.0)
164
174
  psych (>= 4.0.0)
165
- regexp_parser (2.9.2)
166
- reline (0.5.9)
175
+ regexp_parser (2.10.0)
176
+ reline (0.6.0)
167
177
  io-console (~> 0.5)
168
178
  rspec (3.13.0)
169
179
  rspec-core (~> 3.13.0)
170
180
  rspec-expectations (~> 3.13.0)
171
181
  rspec-mocks (~> 3.13.0)
172
- rspec-core (3.13.1)
182
+ rspec-core (3.13.2)
173
183
  rspec-support (~> 3.13.0)
174
- rspec-expectations (3.13.2)
184
+ rspec-expectations (3.13.3)
175
185
  diff-lcs (>= 1.2.0, < 2.0)
176
186
  rspec-support (~> 3.13.0)
177
- rspec-mocks (3.13.1)
187
+ rspec-mocks (3.13.2)
178
188
  diff-lcs (>= 1.2.0, < 2.0)
179
189
  rspec-support (~> 3.13.0)
180
- rspec-support (3.13.1)
181
- rubocop (1.66.1)
190
+ rspec-support (3.13.2)
191
+ rubocop (1.71.0)
182
192
  json (~> 2.3)
183
193
  language_server-protocol (>= 3.17.0)
184
194
  parallel (~> 1.10)
185
195
  parser (>= 3.3.0.2)
186
196
  rainbow (>= 2.2.2, < 4.0)
187
- regexp_parser (>= 2.4, < 3.0)
188
- rubocop-ast (>= 1.32.2, < 2.0)
197
+ regexp_parser (>= 2.9.3, < 3.0)
198
+ rubocop-ast (>= 1.36.2, < 2.0)
189
199
  ruby-progressbar (~> 1.7)
190
- unicode-display_width (>= 2.4.0, < 3.0)
191
- rubocop-ast (1.32.2)
200
+ unicode-display_width (>= 2.4.0, < 4.0)
201
+ rubocop-ast (1.37.0)
192
202
  parser (>= 3.3.1.0)
193
203
  rubocop-capybara (2.21.0)
194
204
  rubocop (~> 1.41)
195
205
  rubocop-factory_bot (2.26.1)
196
206
  rubocop (~> 1.61)
197
- rubocop-inhouse (0.2.0)
207
+ rubocop-inhouse (0.2.2)
198
208
  rubocop (>= 1.5)
199
209
  rubocop-capybara (>= 2.1)
200
210
  rubocop-factory_bot (>= 2.2)
@@ -203,36 +213,39 @@ GEM
203
213
  rubocop-rake (>= 0.6)
204
214
  rubocop-rspec (>= 2.2)
205
215
  rubocop-rspec_rails (>= 2.2)
206
- rubocop-performance (1.21.1)
216
+ rubocop-performance (1.23.1)
207
217
  rubocop (>= 1.48.1, < 2.0)
208
218
  rubocop-ast (>= 1.31.1, < 2.0)
209
- rubocop-rails (2.26.0)
219
+ rubocop-rails (2.29.1)
210
220
  activesupport (>= 4.2.0)
211
221
  rack (>= 1.1)
212
222
  rubocop (>= 1.52.0, < 2.0)
213
223
  rubocop-ast (>= 1.31.1, < 2.0)
214
224
  rubocop-rake (0.6.0)
215
225
  rubocop (~> 1.0)
216
- rubocop-rspec (3.0.4)
226
+ rubocop-rspec (3.4.0)
217
227
  rubocop (~> 1.61)
218
228
  rubocop-rspec_rails (2.30.0)
219
229
  rubocop (~> 1.61)
220
230
  rubocop-rspec (~> 3, >= 3.0.1)
221
231
  ruby-progressbar (1.13.0)
222
- securerandom (0.3.1)
223
- stringio (3.1.1)
224
- tailwind_merge (0.13.0)
225
- lru_redux (~> 1.1)
232
+ securerandom (0.4.1)
233
+ sin_lru_redux (2.5.0)
234
+ stringio (3.1.2)
235
+ tailwind_merge (0.16.0)
236
+ sin_lru_redux (~> 2.5)
226
237
  thor (1.3.2)
227
- timeout (0.4.1)
238
+ timeout (0.4.3)
228
239
  tzinfo (2.0.6)
229
240
  concurrent-ruby (~> 1.0)
230
- unicode-display_width (2.5.0)
231
- useragent (0.16.10)
232
- webrick (1.8.1)
241
+ unicode-display_width (3.1.4)
242
+ unicode-emoji (~> 4.0, >= 4.0.4)
243
+ unicode-emoji (4.0.4)
244
+ uri (1.0.2)
245
+ useragent (0.16.11)
233
246
  xpath (3.2.0)
234
247
  nokogiri (~> 1.8)
235
- zeitwerk (2.6.18)
248
+ zeitwerk (2.7.1)
236
249
 
237
250
  PLATFORMS
238
251
  aarch64-linux
@@ -252,4 +265,4 @@ DEPENDENCIES
252
265
  rubocop-inhouse
253
266
 
254
267
  BUNDLED WITH
255
- 2.5.6
268
+ 2.6.2
@@ -16,7 +16,7 @@ module Protoform
16
16
  def label_id
17
17
  return dom.id unless value
18
18
 
19
- [dom.id, value.parameterize.underscore].join("_")
19
+ [dom.id, value.to_s.parameterize.underscore].join("_")
20
20
  end
21
21
 
22
22
  def default_attrs
@@ -11,9 +11,7 @@ module Protoform
11
11
  private
12
12
 
13
13
  def radio_id
14
- return dom.id if dom.value.nil?
15
-
16
- [dom.id, dom.value.parameterize.underscore].join("_")
14
+ [dom.id, value.to_s.parameterize.underscore].join("_")
17
15
  end
18
16
 
19
17
  def checked?
@@ -24,7 +22,7 @@ module Protoform
24
22
  {
25
23
  id: radio_id,
26
24
  name: dom.name,
27
- value: dom.value,
25
+ value:,
28
26
  type: "radio",
29
27
  checked: checked? ? "checked" : false
30
28
  }
@@ -47,9 +47,9 @@ module Protoform
47
47
 
48
48
  def around_template(&block)
49
49
  form_tag do
50
- authenticity_token_field if @authenticity_token
50
+ authenticity_token_field if authenticity_token?
51
+ _method_field if method_field?
51
52
 
52
- _method_field
53
53
  super
54
54
  end
55
55
  end
@@ -83,6 +83,19 @@ module Protoform
83
83
 
84
84
  protected
85
85
 
86
+ def authenticity_token?
87
+ return false if _method_field_value == :get
88
+
89
+ @authenticity_token
90
+ end
91
+
92
+ def method_field?
93
+ return false if _method_field_value == :post
94
+ return false if _method_field_value == :get
95
+
96
+ true
97
+ end
98
+
86
99
  def authenticity_token_field
87
100
  input(
88
101
  name: "authenticity_token",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Protoform
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -42,10 +42,10 @@ Gem::Specification.new do |spec|
42
42
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
43
43
  spec.require_paths = ["lib"]
44
44
 
45
- spec.add_dependency "activerecord", "~> 7.0"
46
- spec.add_dependency "activesupport", "~> 7.0"
45
+ spec.add_dependency "activerecord", "~> 8.0"
46
+ spec.add_dependency "activesupport", "~> 8.0"
47
47
  spec.add_dependency "phlex-rails", "~> 1.0"
48
- spec.add_dependency "protos", "~> 0.6"
49
- spec.add_dependency "zeitwerk", "~> 2.6"
48
+ spec.add_dependency "protos", "~> 0.7"
49
+ spec.add_dependency "zeitwerk", "~> 2.7"
50
50
  spec.metadata["rubygems_mfa_required"] = "true"
51
51
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protos-protoform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nolan Tait
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-04 00:00:00.000000000 Z
10
+ date: 2025-01-27 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -16,28 +15,28 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '7.0'
18
+ version: '8.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '7.0'
25
+ version: '8.0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: activesupport
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '7.0'
32
+ version: '8.0'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: '7.0'
39
+ version: '8.0'
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: phlex-rails
43
42
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +57,28 @@ dependencies:
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '0.6'
60
+ version: '0.7'
62
61
  type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '0.6'
67
+ version: '0.7'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: zeitwerk
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: '2.6'
74
+ version: '2.7'
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: '2.6'
81
+ version: '2.7'
83
82
  description: Build phlex based forms using Rails conventions
84
83
  email:
85
84
  - nolanjtait@gmail.com
@@ -133,7 +132,6 @@ metadata:
133
132
  source_code_uri: https://github.com/inhouse-work/protos-protoform
134
133
  changelog_uri: https://github.com/inhouse-work/protos-protoform
135
134
  rubygems_mfa_required: 'true'
136
- post_install_message:
137
135
  rdoc_options: []
138
136
  require_paths:
139
137
  - lib
@@ -148,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
146
  - !ruby/object:Gem::Version
149
147
  version: '0'
150
148
  requirements: []
151
- rubygems_version: 3.5.18
152
- signing_key:
149
+ rubygems_version: 3.6.2
153
150
  specification_version: 4
154
151
  summary: Phlex based form builder for Rails
155
152
  test_files: []