bootstrap_form 5.2.1 → 5.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -4
- data/README.md +4 -5
- data/RELEASING.md +25 -10
- data/Rakefile +4 -12
- data/lib/bootstrap_form/components/labels.rb +1 -1
- data/lib/bootstrap_form/components/validation.rb +6 -4
- data/lib/bootstrap_form/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa5d9dae3c70df57395c553031c50a7ef314615c1c3971d475df2490ad954673
|
4
|
+
data.tar.gz: d0ae0a83e29e3023ac4914374844c75f205ff6acffad3b24761a3a16044bf106
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d4d49a3b0169cb307a11e838fe3723b9432417ab065e972ec6a70ec345ec9939e4277db9df3a9eeddcc23aa23eefef1082a7dc07399860c038498a965ae6481
|
7
|
+
data.tar.gz: ca23ffac8e041961259b3e04a6cadd8f37e4d9d470f823e3b4ae63f6be37221606c91618426a7025f3e06f8c36d67b80ca3d5ff40bcdd112b68971a3fe1b76d3
|
data/CHANGELOG.md
CHANGED
@@ -6,13 +6,16 @@ https://github.com/bootstrap-ruby/bootstrap_form/releases
|
|
6
6
|
|
7
7
|
## Diffs
|
8
8
|
|
9
|
-
- [
|
9
|
+
- [5.2.2](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.2.2...v5.2.3)
|
10
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-05-28T16%3A00..2023-06-18T07%3A00)
|
11
|
+
- [5.2.2](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.2.1...v5.2.2)
|
12
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-05-23T10%3A00..2023-05-28T16%3A00)
|
10
13
|
- [5.2.1](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.2.0...v5.2.1)
|
11
|
-
[
|
14
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2023-05-20T23%3A59..2023-05-23T10%3A00)
|
12
15
|
- [5.2.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.1.0...v5.2.0)
|
13
|
-
[
|
16
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2022-06-25T17%3A22..2023-05-20T23%3A59)
|
14
17
|
- [5.1.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v5.0.0...v5.1.0)
|
15
|
-
[
|
18
|
+
[Closed issues](https://github.com/bootstrap-ruby/bootstrap_form/issues?q=closed%3A2021-11-12T05%3A58..2022-06-25T17%3A22)
|
16
19
|
- [5.0.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v4.5.0...v5.0.0)
|
17
20
|
- [4.5.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v4.4.0...v4.5.0)
|
18
21
|
- [4.4.0](https://github.com/bootstrap-ruby/bootstrap_form/compare/v4.3.0...v4.4.0)
|
data/README.md
CHANGED
@@ -284,7 +284,7 @@ Or you can add the label as input placeholder instead (this automatically hides
|
|
284
284
|
|
285
285
|
![Example 6](demo/doc/screenshots/bootstrap/readme/06_example.png "Example 6")
|
286
286
|
```erb
|
287
|
-
<%= f.text_field :email, label_as_placeholder: true %>
|
287
|
+
<%= f.text_field :email, value: '', label_as_placeholder: true %>
|
288
288
|
```
|
289
289
|
|
290
290
|
This generates:
|
@@ -292,7 +292,7 @@ This generates:
|
|
292
292
|
```html
|
293
293
|
<div class="mb-3">
|
294
294
|
<label class="form-label visually-hidden required" for="user_email">Email</label>
|
295
|
-
<input aria-required="true" class="form-control" id="user_email" name="user[email]" placeholder="Email" required="required" type="text" value="
|
295
|
+
<input aria-required="true" class="form-control" id="user_email" name="user[email]" placeholder="Email" required="required" type="text" value="">
|
296
296
|
</div>
|
297
297
|
```
|
298
298
|
|
@@ -1049,11 +1049,11 @@ This generates:
|
|
1049
1049
|
```html
|
1050
1050
|
<form accept-charset="UTF-8" action="/users" class="new_user row row-cols-auto g-3 align-items-center" id="new_user" method="post">
|
1051
1051
|
<div class="col">
|
1052
|
-
<label class="form-label visually-hidden
|
1052
|
+
<label class="form-label visually-hidden me-sm-2 required" for="user_email">Email</label>
|
1053
1053
|
<input aria-required="true" class="form-control" id="user_email" name="user[email]" required="required" type="email" value="steve@example.com">
|
1054
1054
|
</div>
|
1055
1055
|
<div class="col">
|
1056
|
-
<label class="form-label visually-hidden
|
1056
|
+
<label class="form-label visually-hidden me-sm-2" for="user_password">Password</label>
|
1057
1057
|
<input class="form-control" id="user_password" name="user[password]" type="password">
|
1058
1058
|
</div>
|
1059
1059
|
<div class="form-check form-check-inline mb-3">
|
@@ -1130,7 +1130,6 @@ This generates:
|
|
1130
1130
|
</div>
|
1131
1131
|
</div>
|
1132
1132
|
</div>
|
1133
|
-
|
1134
1133
|
<div class="mb-3 row">
|
1135
1134
|
<div class="col-sm-10 offset-sm-2">
|
1136
1135
|
<input class="btn btn-secondary" data-disable-with="Create User" name="commit" type="submit" value="Create User">
|
data/RELEASING.md
CHANGED
@@ -10,22 +10,37 @@ Follow these steps to release a new version of bootstrap_form to rubygems.org.
|
|
10
10
|
|
11
11
|
## How to release
|
12
12
|
|
13
|
-
1.
|
14
|
-
2.
|
13
|
+
1. Determine which would be the correct next version number according to [semver](http://semver.org/).
|
14
|
+
2. Update the version in `./lib/bootstrap_form/version.rb`.
|
15
|
+
3. Make sure that you have all the gems necessary for testing and releasing.
|
16
|
+
|
17
|
+
BUNDLE_GEMFILE=gemfiles/7.0.gemfile bundle update
|
18
|
+
|
19
|
+
4. **Ensure the tests are passing by running the tests**
|
15
20
|
|
16
21
|
(There should be no errors or warnings.)
|
17
22
|
|
18
23
|
BUNDLE_GEMFILE=gemfiles/7.0.gemfile bundle exec rake test
|
19
24
|
|
20
|
-
|
25
|
+
5. **Ensure the demo tests are passing by running**
|
21
26
|
|
22
27
|
cd demo
|
23
28
|
bundle update
|
24
29
|
bundle exec rake test:all
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
cd -
|
31
|
+
|
32
|
+
6. Update the GitHub diff links at the beginning of `CHANGELOG.md` (The pattern should be obvious when you look at them).
|
33
|
+
7. Update the installation instructions in `README.md` to use the new version.
|
34
|
+
8. Commit the CHANGELOG and version changes in a single commit; the message should be "Preparing vX.Y.Z" where `X.Y.Z` is the version being released.
|
35
|
+
9. Tag, push to GitHub, and publish to rubygems.org:
|
36
|
+
|
37
|
+
bundle exec rake release
|
38
|
+
|
39
|
+
10. Go to https://github.com/bootstrap-ruby/bootstrap_form/releases and create the new release and add release notes by clicking the "Generate release notes" button.
|
40
|
+
Add the link of closed issues from CHANGELOG.
|
41
|
+
Group the commits in sections:
|
42
|
+
* ### New features
|
43
|
+
* ### Bugfixes
|
44
|
+
* ### Performance
|
45
|
+
* ### Documentation
|
46
|
+
* ### Development
|
data/Rakefile
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
begin
|
2
2
|
require 'bundler/setup'
|
3
|
+
|
4
|
+
require 'bundler/gem_tasks'
|
5
|
+
require "minitest/test_task"
|
6
|
+
require 'rdoc/task'
|
3
7
|
require 'rubocop/rake_task'
|
4
8
|
rescue LoadError
|
5
9
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
10
|
end
|
7
11
|
|
8
|
-
require 'rdoc/task'
|
9
|
-
|
10
12
|
RDoc::Task.new(:rdoc) do |rdoc|
|
11
13
|
rdoc.rdoc_dir = 'rdoc'
|
12
14
|
rdoc.title = 'BootstrapForm'
|
@@ -15,10 +17,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
15
17
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
18
|
end
|
17
19
|
|
18
|
-
require 'bundler/gem_tasks'
|
19
|
-
|
20
|
-
require "minitest/test_task"
|
21
|
-
|
22
20
|
Minitest::TestTask.create(:test) do |t|
|
23
21
|
t.libs << "test"
|
24
22
|
t.libs << "lib"
|
@@ -26,12 +24,6 @@ Minitest::TestTask.create(:test) do |t|
|
|
26
24
|
t.test_globs = ["test/**/*_test.rb"]
|
27
25
|
end
|
28
26
|
|
29
|
-
# This automatically updates GitHub Releases whenever we `rake release` the gem
|
30
|
-
task "release:rubygem_push" do
|
31
|
-
require "chandler/tasks"
|
32
|
-
Rake.application.invoke_task("chandler:push")
|
33
|
-
end
|
34
|
-
|
35
27
|
desc 'Run RuboCop checks'
|
36
28
|
RuboCop::RakeTask.new(:rubocop)
|
37
29
|
|
@@ -26,7 +26,7 @@ module BootstrapForm
|
|
26
26
|
target = obj.instance_of?(Class) ? obj : obj.class
|
27
27
|
return false unless target.respond_to? :validators_on
|
28
28
|
|
29
|
-
presence_validator?(
|
29
|
+
presence_validator?(target_unconditional_validators(target, attribute)) ||
|
30
30
|
required_association?(target, attribute)
|
31
31
|
end
|
32
32
|
|
@@ -35,12 +35,14 @@ module BootstrapForm
|
|
35
35
|
next unless a.is_a?(ActiveRecord::Reflection::BelongsToReflection)
|
36
36
|
next unless a.foreign_key == attribute.to_s
|
37
37
|
|
38
|
-
presence_validator?(
|
38
|
+
presence_validator?(target_unconditional_validators(target, name))
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
43
|
-
target.validators_on(attribute)
|
42
|
+
def target_unconditional_validators(target, attribute)
|
43
|
+
target.validators_on(attribute)
|
44
|
+
.reject { |validator| validator.options[:if].present? || validator.options[:unless].present? }
|
45
|
+
.map(&:class)
|
44
46
|
end
|
45
47
|
|
46
48
|
def presence_validator?(target_validators)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Potenza
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|