govuk_design_system_formbuilder 2.8.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84999693662af580363425f17c82d516d675c30d000ccd7e46a3d4607b63b32e
4
- data.tar.gz: fe9b2a8f8cd05ec1eb56d915223a387ba4d86390dbee1e771f9c32263afd054a
3
+ metadata.gz: 9bec1bab9191040f7f1c63377dd36f9a662de2f46f29cbaf79722a51fffbb044
4
+ data.tar.gz: f99522c38fc58a1ec28b5041c6e934415a44e16a8bdc3e9891a009d8822efdca
5
5
  SHA512:
6
- metadata.gz: f48bdf7f824047df1dccc6b53412cb454f3f30af9805ba5b6fafa91d89454e03ef929d534919b0695ca0db0804d84de18a01779074382d96e7c457c2e4a727cf
7
- data.tar.gz: c5d24743fa044cf0b71b3b3609239c0787ed0551a6993f74f238385217782f4167439470070c4dd0f4d24b1bdcb1446cb6c996d3aef51f001c016dde55945800
6
+ metadata.gz: f007e7563e95ff2d4e45ffb393248b7cc268575940787545f9cd6de5ea70fd1a46326c71ffbfd0b213e8c385723f2b024d6c0de9d4f1c519df665a391096fe21
7
+ data.tar.gz: 44a373662b919477b9434151f3d1268781878d4bf428381870561b177219ee2b3d7c950fdd1ffb2f86d329e522912b442dc7833606332b791aaef4b030c02de6
data/README.md CHANGED
@@ -5,10 +5,10 @@
5
5
  [![Gem Version](https://badge.fury.io/rb/govuk_design_system_formbuilder.svg)](https://badge.fury.io/rb/govuk_design_system_formbuilder)
6
6
  [![Gem](https://img.shields.io/gem/dt/govuk_design_system_formbuilder?logo=rubygems)](https://rubygems.org/gems/govuk_design_system_formbuilder)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/110136fb22341d3ba646/test_coverage)](https://codeclimate.com/github/DFE-Digital/govuk-formbuilder/test_coverage)
8
- [![GitHub license](https://img.shields.io/github/license/DFE-Digital/govuk_design_system_formbuilder)](https://github.com/DFE-Digital/govuk-formbuilder/blob/master/LICENSE)
8
+ [![GitHub license](https://img.shields.io/github/license/DFE-Digital/govuk_design_system_formbuilder)](https://github.com/DFE-Digital/govuk-formbuilder/blob/main/LICENSE)
9
9
  [![GOV.UK Design System Version](https://img.shields.io/badge/GOV.UK%20Design%20System-3.14.0-brightgreen)](https://design-system.service.gov.uk)
10
- [![Rails](https://img.shields.io/badge/Rails-6.0.4.1%20%E2%95%B1%206.1.4.1-E16D6D)](https://weblog.rubyonrails.org/releases/)
11
- [![Ruby](https://img.shields.io/badge/Ruby-2.6.8%20%E2%95%B1%202.7.4%20%E2%95%B1%203.0.2-E16D6D)](https://www.ruby-lang.org/en/downloads/)
10
+ [![Rails](https://img.shields.io/badge/Rails-6.1.4.4%20%E2%95%B1%207.0.1-E16D6D)](https://weblog.rubyonrails.org/releases/)
11
+ [![Ruby](https://img.shields.io/badge/Ruby-2.7.5%20%20%E2%95%B1%203.0.3%20%20%E2%95%B1%203.1.0-E16D6D)](https://www.ruby-lang.org/en/downloads/)
12
12
 
13
13
  This library provides an easy-to-use form builder for the [GOV.UK Design System](https://design-system.service.gov.uk/).
14
14
 
@@ -8,7 +8,7 @@ module GOVUKDesignSystemFormBuilder
8
8
  def html
9
9
  return unless has_errors?
10
10
 
11
- tag.span(class: %(#{brand}-error-message), id: error_id) do
11
+ tag.p(class: %(#{brand}-error-message), id: error_id) do
12
12
  safe_join([hidden_prefix, message])
13
13
  end
14
14
  end
@@ -27,7 +27,7 @@ module GOVUKDesignSystemFormBuilder
27
27
  def html
28
28
  return unless active?
29
29
 
30
- content_tag(hint_tag, **hint_options, **@html_attributes) { hint_body }
30
+ tag.div(**hint_options, **@html_attributes) { hint_body }
31
31
  end
32
32
 
33
33
  def hint_id
@@ -42,10 +42,6 @@ module GOVUKDesignSystemFormBuilder
42
42
  { class: classes, id: hint_id }
43
43
  end
44
44
 
45
- def hint_tag
46
- @raw.presence ? 'div' : 'span'
47
- end
48
-
49
45
  def hint_body
50
46
  @raw || @text
51
47
  end
@@ -6,31 +6,8 @@ module GOVUKDesignSystemFormBuilder
6
6
  # Rails' class_names, but recreated here as that returns a string
7
7
  # where we want an array.
8
8
  def build_classes(*args, **kwargs)
9
- # FIXME: we need to handle the arguments differently for Ruby 2.6.x because
10
- # Ruby 2.7.0 brought the separation of positional and keyword
11
- # arguments.
12
- #
13
- # This can be removed once support for 2.6.x is dropped.
14
- #
15
- # https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
16
- return ruby_2_6_build_classes_fallback(*args) if RUBY_VERSION < "2.7.0"
17
-
18
9
  (args + kwargs.map { |k, v| k if v }).compact
19
10
  end
20
-
21
- private
22
-
23
- def ruby_2_6_build_classes_fallback(*args)
24
- [].tap do |classes|
25
- args.each do |arg|
26
- if arg.is_a?(Hash)
27
- arg.each { |k, v| classes.append(k) if v }
28
- else
29
- classes.append(arg)
30
- end
31
- end
32
- end
33
- end
34
11
  end
35
12
  end
36
13
  end
@@ -1,3 +1,3 @@
1
1
  module GOVUKDesignSystemFormBuilder
2
- VERSION = '2.8.0'.freeze
2
+ VERSION = '3.0.1'.freeze
3
3
  end
@@ -57,8 +57,8 @@ module GOVUKDesignSystemFormBuilder
57
57
  # * +:default_error_summary_turbo_prefix+ is used to disable turbo/turbolinks from
58
58
  # handling clicks on links in the error summary. When it's a string (eg,
59
59
  # turbo), that will result in links with the attribute 'data-turbo=false'.
60
- # When nil, no data attribute will be added. Defaults to 'turbolinks' for
61
- # compatibilitiy's sake; this will change to 'turbo' when Rails 7 is released
60
+ # When nil, no data attribute will be added. Defaults to turbo since Rails 7,
61
+ # change to 'turbolinks' for Rails 6.1
62
62
  #
63
63
  # * +:localisation_schema_fallback+ sets the prefix elements for the array
64
64
  # used to build the localisation string. The final two elements are always
@@ -88,7 +88,7 @@ module GOVUKDesignSystemFormBuilder
88
88
  default_error_summary_title: 'There is a problem',
89
89
  default_error_summary_presenter: Presenters::ErrorSummaryPresenter,
90
90
  default_error_summary_error_order_method: nil,
91
- default_error_summary_turbo_prefix: 'turbolinks',
91
+ default_error_summary_turbo_prefix: 'turbo',
92
92
  default_collection_check_boxes_include_hidden: true,
93
93
  default_collection_radio_buttons_include_hidden: true,
94
94
  default_submit_validate: false,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_design_system_formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Yates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-01 00:00:00.000000000 Z
11
+ date: 2022-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
@@ -30,56 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '6.0'
33
+ version: '6.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '6.0'
40
+ version: '6.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activemodel
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '6.0'
47
+ version: '6.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '6.0'
54
+ version: '6.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '6.0'
61
+ version: '6.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '6.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop-govuk
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 4.1.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 4.1.0
68
+ version: '6.1'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: pry
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +128,20 @@ dependencies:
142
128
  - - "~>"
143
129
  - !ruby/object:Gem::Version
144
130
  version: '5.0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rubocop-govuk
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 4.2.0
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 4.2.0
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: simplecov
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -162,14 +162,14 @@ dependencies:
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: 1.3.1
165
+ version: 1.4.1
166
166
  type: :development
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: 1.3.1
172
+ version: 1.4.1
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: nanoc
175
175
  requirement: !ruby/object:Gem::Requirement
@@ -213,33 +213,33 @@ dependencies:
213
213
  - !ruby/object:Gem::Version
214
214
  version: 0.7.0
215
215
  - !ruby/object:Gem::Dependency
216
- name: sassc
216
+ name: sass
217
217
  requirement: !ruby/object:Gem::Requirement
218
218
  requirements:
219
- - - "~>"
219
+ - - ">="
220
220
  - !ruby/object:Gem::Version
221
- version: 2.4.0
221
+ version: '0'
222
222
  type: :development
223
223
  prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
- - - "~>"
226
+ - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: 2.4.0
228
+ version: '0'
229
229
  - !ruby/object:Gem::Dependency
230
- name: sass
230
+ name: sassc
231
231
  requirement: !ruby/object:Gem::Requirement
232
232
  requirements:
233
- - - ">="
233
+ - - "~>"
234
234
  - !ruby/object:Gem::Version
235
- version: '0'
235
+ version: 2.4.0
236
236
  type: :development
237
237
  prerelease: false
238
238
  version_requirements: !ruby/object:Gem::Requirement
239
239
  requirements:
240
- - - ">="
240
+ - - "~>"
241
241
  - !ruby/object:Gem::Version
242
- version: '0'
242
+ version: 2.4.0
243
243
  - !ruby/object:Gem::Dependency
244
244
  name: slim
245
245
  requirement: !ruby/object:Gem::Requirement
@@ -255,33 +255,33 @@ dependencies:
255
255
  - !ruby/object:Gem::Version
256
256
  version: 4.1.0
257
257
  - !ruby/object:Gem::Dependency
258
- name: webrick
258
+ name: slim_lint
259
259
  requirement: !ruby/object:Gem::Requirement
260
260
  requirements:
261
261
  - - "~>"
262
262
  - !ruby/object:Gem::Version
263
- version: 1.7.0
263
+ version: 0.22.0
264
264
  type: :development
265
265
  prerelease: false
266
266
  version_requirements: !ruby/object:Gem::Requirement
267
267
  requirements:
268
268
  - - "~>"
269
269
  - !ruby/object:Gem::Version
270
- version: 1.7.0
270
+ version: 0.22.0
271
271
  - !ruby/object:Gem::Dependency
272
- name: slim_lint
272
+ name: webrick
273
273
  requirement: !ruby/object:Gem::Requirement
274
274
  requirements:
275
275
  - - "~>"
276
276
  - !ruby/object:Gem::Version
277
- version: 0.22.0
277
+ version: 1.7.0
278
278
  type: :development
279
279
  prerelease: false
280
280
  version_requirements: !ruby/object:Gem::Requirement
281
281
  requirements:
282
282
  - - "~>"
283
283
  - !ruby/object:Gem::Version
284
- version: 0.22.0
284
+ version: 1.7.0
285
285
  description: A Rails form builder that generates form inputs adhering to the GOV.UK
286
286
  Design System
287
287
  email: