formtastic 2.1.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitattributes +1 -0
- data/.github/workflows/test.yml +61 -0
- data/.gitignore +4 -2
- data/CHANGELOG.md +52 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +105 -0
- data/MIT-LICENSE +1 -1
- data/{README.textile → README.md} +204 -219
- data/RELEASE_PROCESS +3 -1
- data/Rakefile +27 -29
- data/app/assets/stylesheets/formtastic.css +3 -2
- data/bin/appraisal +8 -0
- data/formtastic.gemspec +11 -14
- data/gemfiles/rails_5.2/Gemfile +5 -0
- data/gemfiles/rails_6.0/Gemfile +5 -0
- data/gemfiles/rails_6.1/Gemfile +5 -0
- data/gemfiles/rails_edge/Gemfile +13 -0
- data/lib/formtastic/action_class_finder.rb +18 -0
- data/lib/formtastic/actions/button_action.rb +55 -60
- data/lib/formtastic/actions/input_action.rb +59 -57
- data/lib/formtastic/actions/link_action.rb +68 -67
- data/lib/formtastic/actions.rb +6 -3
- data/lib/formtastic/deprecation.rb +5 -0
- data/lib/formtastic/engine.rb +3 -1
- data/lib/formtastic/form_builder.rb +35 -16
- data/lib/formtastic/helpers/action_helper.rb +34 -28
- data/lib/formtastic/helpers/enum.rb +13 -0
- data/lib/formtastic/helpers/errors_helper.rb +2 -2
- data/lib/formtastic/helpers/fieldset_wrapper.rb +16 -12
- data/lib/formtastic/helpers/form_helper.rb +19 -16
- data/lib/formtastic/helpers/input_helper.rb +69 -97
- data/lib/formtastic/helpers/inputs_helper.rb +35 -25
- data/lib/formtastic/helpers/reflection.rb +4 -4
- data/lib/formtastic/helpers.rb +1 -2
- data/lib/formtastic/html_attributes.rb +12 -1
- data/lib/formtastic/i18n.rb +1 -1
- data/lib/formtastic/input_class_finder.rb +18 -0
- data/lib/formtastic/inputs/base/choices.rb +2 -2
- data/lib/formtastic/inputs/base/collections.rb +46 -14
- data/lib/formtastic/inputs/base/database.rb +7 -2
- data/lib/formtastic/inputs/base/datetime_pickerish.rb +85 -0
- data/lib/formtastic/inputs/base/errors.rb +7 -7
- data/lib/formtastic/inputs/base/hints.rb +2 -2
- data/lib/formtastic/inputs/base/html.rb +10 -9
- data/lib/formtastic/inputs/base/labelling.rb +5 -8
- data/lib/formtastic/inputs/base/naming.rb +4 -4
- data/lib/formtastic/inputs/base/numeric.rb +1 -1
- data/lib/formtastic/inputs/base/options.rb +3 -4
- data/lib/formtastic/inputs/base/stringish.rb +10 -2
- data/lib/formtastic/inputs/base/timeish.rb +34 -22
- data/lib/formtastic/inputs/base/validations.rb +41 -13
- data/lib/formtastic/inputs/base/wrapping.rb +29 -26
- data/lib/formtastic/inputs/base.rb +22 -15
- data/lib/formtastic/inputs/boolean_input.rb +26 -12
- data/lib/formtastic/inputs/check_boxes_input.rb +39 -31
- data/lib/formtastic/inputs/color_input.rb +41 -0
- data/lib/formtastic/inputs/country_input.rb +24 -5
- data/lib/formtastic/inputs/datalist_input.rb +41 -0
- data/lib/formtastic/inputs/date_picker_input.rb +93 -0
- data/lib/formtastic/inputs/{date_input.rb → date_select_input.rb} +1 -1
- data/lib/formtastic/inputs/datetime_picker_input.rb +103 -0
- data/lib/formtastic/inputs/{datetime_input.rb → datetime_select_input.rb} +1 -1
- data/lib/formtastic/inputs/file_input.rb +2 -2
- data/lib/formtastic/inputs/hidden_input.rb +2 -6
- data/lib/formtastic/inputs/radio_input.rb +28 -22
- data/lib/formtastic/inputs/select_input.rb +36 -39
- data/lib/formtastic/inputs/time_picker_input.rb +99 -0
- data/lib/formtastic/inputs/{time_input.rb → time_select_input.rb} +6 -2
- data/lib/formtastic/inputs/time_zone_input.rb +16 -6
- data/lib/formtastic/inputs.rb +32 -21
- data/lib/formtastic/localized_string.rb +1 -1
- data/lib/formtastic/localizer.rb +24 -24
- data/lib/formtastic/namespaced_class_finder.rb +99 -0
- data/lib/formtastic/version.rb +1 -1
- data/lib/formtastic.rb +20 -10
- data/lib/generators/formtastic/form/form_generator.rb +10 -4
- data/lib/generators/formtastic/input/input_generator.rb +46 -0
- data/lib/generators/formtastic/install/install_generator.rb +5 -19
- data/lib/generators/templates/_form.html.slim +2 -2
- data/lib/generators/templates/formtastic.rb +46 -25
- data/lib/generators/templates/input.rb +19 -0
- data/sample/basic_inputs.html +23 -3
- data/script/integration-template.rb +74 -0
- data/script/integration.sh +19 -0
- data/spec/action_class_finder_spec.rb +12 -0
- data/spec/actions/button_action_spec.rb +8 -8
- data/spec/actions/generic_action_spec.rb +92 -56
- data/spec/actions/input_action_spec.rb +7 -7
- data/spec/actions/link_action_spec.rb +10 -10
- data/spec/builder/custom_builder_spec.rb +36 -20
- data/spec/builder/error_proc_spec.rb +4 -4
- data/spec/builder/semantic_fields_for_spec.rb +28 -29
- data/spec/fast_spec_helper.rb +12 -0
- data/spec/generators/formtastic/form/form_generator_spec.rb +45 -32
- data/spec/generators/formtastic/input/input_generator_spec.rb +124 -0
- data/spec/generators/formtastic/install/install_generator_spec.rb +9 -9
- data/spec/helpers/action_helper_spec.rb +75 -103
- data/spec/helpers/actions_helper_spec.rb +17 -17
- data/spec/helpers/form_helper_spec.rb +84 -33
- data/spec/helpers/input_helper_spec.rb +333 -285
- data/spec/helpers/inputs_helper_spec.rb +167 -121
- data/spec/helpers/reflection_helper_spec.rb +3 -3
- data/spec/helpers/semantic_errors_helper_spec.rb +23 -23
- data/spec/i18n_spec.rb +26 -26
- data/spec/input_class_finder_spec.rb +10 -0
- data/spec/inputs/base/collections_spec.rb +76 -0
- data/spec/inputs/base/validations_spec.rb +480 -0
- data/spec/inputs/boolean_input_spec.rb +100 -65
- data/spec/inputs/check_boxes_input_spec.rb +200 -101
- data/spec/inputs/color_input_spec.rb +85 -0
- data/spec/inputs/country_input_spec.rb +20 -20
- data/spec/inputs/custom_input_spec.rb +3 -4
- data/spec/inputs/datalist_input_spec.rb +61 -0
- data/spec/inputs/date_picker_input_spec.rb +449 -0
- data/spec/inputs/date_select_input_spec.rb +249 -0
- data/spec/inputs/datetime_picker_input_spec.rb +490 -0
- data/spec/inputs/datetime_select_input_spec.rb +209 -0
- data/spec/inputs/email_input_spec.rb +5 -5
- data/spec/inputs/file_input_spec.rb +6 -6
- data/spec/inputs/hidden_input_spec.rb +22 -35
- data/spec/inputs/include_blank_spec.rb +11 -11
- data/spec/inputs/label_spec.rb +62 -25
- data/spec/inputs/number_input_spec.rb +112 -112
- data/spec/inputs/password_input_spec.rb +5 -5
- data/spec/inputs/phone_input_spec.rb +5 -5
- data/spec/inputs/placeholder_spec.rb +6 -6
- data/spec/inputs/radio_input_spec.rb +99 -55
- data/spec/inputs/range_input_spec.rb +66 -66
- data/spec/inputs/readonly_spec.rb +50 -0
- data/spec/inputs/search_input_spec.rb +5 -5
- data/spec/inputs/select_input_spec.rb +170 -170
- data/spec/inputs/string_input_spec.rb +68 -16
- data/spec/inputs/text_input_spec.rb +16 -16
- data/spec/inputs/time_picker_input_spec.rb +455 -0
- data/spec/inputs/time_select_input_spec.rb +261 -0
- data/spec/inputs/time_zone_input_spec.rb +54 -28
- data/spec/inputs/url_input_spec.rb +5 -5
- data/spec/inputs/with_options_spec.rb +7 -7
- data/spec/localizer_spec.rb +39 -17
- data/spec/namespaced_class_finder_spec.rb +79 -0
- data/spec/schema.rb +21 -0
- data/spec/spec_helper.rb +254 -221
- data/spec/support/custom_macros.rb +128 -95
- data/spec/support/shared_examples.rb +12 -0
- data/spec/support/specialized_class_finder_shared_example.rb +27 -0
- data/spec/support/test_environment.rb +26 -10
- metadata +177 -238
- data/.travis.yml +0 -8
- data/Appraisals +0 -11
- data/CHANGELOG +0 -371
- data/gemfiles/rails-3.0.gemfile +0 -7
- data/gemfiles/rails-3.1.gemfile +0 -7
- data/gemfiles/rails-3.2.gemfile +0 -7
- data/lib/formtastic/helpers/buttons_helper.rb +0 -310
- data/lib/formtastic/inputs/base/grouped_collections.rb +0 -77
- data/lib/formtastic/util.rb +0 -25
- data/lib/tasks/verify_rcov.rb +0 -44
- data/spec/helpers/buttons_helper_spec.rb +0 -166
- data/spec/helpers/commit_button_helper_spec.rb +0 -530
- data/spec/inputs/date_input_spec.rb +0 -227
- data/spec/inputs/datetime_input_spec.rb +0 -185
- data/spec/inputs/time_input_spec.rb +0 -267
- data/spec/support/deferred_garbage_collection.rb +0 -21
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cb44ea01df970135604cdddd0ac7b762ea56077f915810c4c8fe6be3487cafa3
|
4
|
+
data.tar.gz: 18630a8282b76e40d0c6e9faad19f99112dfd9e22ba22e7b025d8730ebf26ace
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 73a3ad17e91765150e4e15e03d3031f5b9efd975a09bbb21c7f404709b7d2462e9cf16c708beaf2745b783def3a631ca1b3bd47278d79c16012d79ba1f549fc0
|
7
|
+
data.tar.gz: d418a7e65f928dedfd36627c3ece7c4fe7e371984500ddc4bcb6c5929087264541476c469be6520270000a0e8348bc2cd41415e94d46c86da2e48021bf54d4be
|
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
CHANGELOG merge=union
|
@@ -0,0 +1,61 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
runs-on: ubuntu-20.04
|
10
|
+
|
11
|
+
strategy:
|
12
|
+
fail-fast: false
|
13
|
+
|
14
|
+
matrix:
|
15
|
+
gemfile:
|
16
|
+
- gemfiles/rails_5.2/Gemfile
|
17
|
+
- gemfiles/rails_6.0/Gemfile
|
18
|
+
- gemfiles/rails_6.1/Gemfile
|
19
|
+
- gemfiles/rails_edge/Gemfile
|
20
|
+
|
21
|
+
ruby:
|
22
|
+
- 2.4.10
|
23
|
+
- 2.5.8
|
24
|
+
- 2.6.6
|
25
|
+
- 2.7.2
|
26
|
+
- 3.0.0
|
27
|
+
|
28
|
+
exclude:
|
29
|
+
- ruby: 2.4.10
|
30
|
+
gemfile: gemfiles/rails_6.0/Gemfile
|
31
|
+
|
32
|
+
- ruby: 2.4.10
|
33
|
+
gemfile: gemfiles/rails_6.1/Gemfile
|
34
|
+
|
35
|
+
- ruby: 2.4.10
|
36
|
+
gemfile: gemfiles/rails_edge/Gemfile
|
37
|
+
|
38
|
+
- ruby: 3.0.0
|
39
|
+
gemfile: gemfiles/rails_5.2/Gemfile
|
40
|
+
|
41
|
+
env:
|
42
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
43
|
+
|
44
|
+
steps:
|
45
|
+
- uses: actions/checkout@v2
|
46
|
+
|
47
|
+
- uses: actions/setup-node@v2
|
48
|
+
with:
|
49
|
+
node-version: 11
|
50
|
+
|
51
|
+
- name: Set up Ruby
|
52
|
+
uses: ruby/setup-ruby@v1
|
53
|
+
with:
|
54
|
+
ruby-version: ${{ matrix.ruby }}
|
55
|
+
bundler-cache: true
|
56
|
+
|
57
|
+
- name: Run tests
|
58
|
+
run: |
|
59
|
+
bundle exec rake spec
|
60
|
+
script/integration.sh
|
61
|
+
continue-on-error: ${{ matrix.gemfile == 'gemfiles/rails_edge/Gemfile' }}
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
## master / 4.0.0
|
2
|
+
* Fixed default_columns_for_object when object has non-standard foreign keys (#1241)
|
3
|
+
* Fixed missing constants in production (#911)
|
4
|
+
* Removed support for Rails 3 and 4.0 (#1108)
|
5
|
+
* Removed deprecated input/action finder methods (#1139)
|
6
|
+
* Changed boolean label padding to margin (#1202)
|
7
|
+
* Added mapping hstore column to text input (#1203)
|
8
|
+
* Added support for Rails 5 Attributes API (#1188)
|
9
|
+
* Changed required Ruby version to >= 2.0 (#1210)
|
10
|
+
* Default to input types text for json & jsonb, string for citext columns (#1229)
|
11
|
+
* Allow symbols for numericality options (#1258)
|
12
|
+
* Support for rubies under 2.4.0 has been dropped (#1292)
|
13
|
+
* Support for Rails under 5.2.0 has been dropped (#1293)
|
14
|
+
* Support for Rails 6.0 has been added (#1300)
|
15
|
+
* Support for Rails 6.1 has been added (#1324)
|
16
|
+
* Support for Ruby 3 has been added (#1323)
|
17
|
+
|
18
|
+
## 3.1.2
|
19
|
+
|
20
|
+
* Fixed that we specified 4.0.4 instead of 4.1 in the Rails version deprecation message
|
21
|
+
|
22
|
+
## 3.1.1
|
23
|
+
|
24
|
+
* Fixed class custom input & action class loading in test environments
|
25
|
+
* Added documentation of custom input & action class finders
|
26
|
+
* Added a link to documentation & wiki from custom class deprecation warnings
|
27
|
+
|
28
|
+
## 3.1.0
|
29
|
+
|
30
|
+
* Performance and documentation improvements
|
31
|
+
|
32
|
+
## 3.1.0.rc2
|
33
|
+
|
34
|
+
* Deprecated :member_value and :member_label options
|
35
|
+
|
36
|
+
## 3.1.0.rc1
|
37
|
+
|
38
|
+
* Deprecated support for Rails version < 4.1.0
|
39
|
+
* Fixed synchronization issues with custom_namespace configuration
|
40
|
+
* Fixed bug where boolean (checkbox) inputs were not being correctly checked (also in 2.3.1)
|
41
|
+
* Fixed (silenced) Rails 5 deprecation on column_for_attribute that we're handling fine
|
42
|
+
* Added new DatalistInput (:as => :datalist) for HTML5 datalists
|
43
|
+
* Added configurable namespaces for custom inputs
|
44
|
+
* Various performance and documentation improvements
|
45
|
+
|
46
|
+
---
|
47
|
+
|
48
|
+
See 3.0-stable branch for 3.0.x changes
|
49
|
+
https://github.com/formtastic/formtastic/blob/3.0-stable/CHANGELOG
|
50
|
+
|
51
|
+
See 2.3-stable branch for 2.3.x and earlier releases
|
52
|
+
https://github.com/formtastic/formtastic/blob/2.3-stable/CHANGELOG
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
formtastic (4.0.0.rc1)
|
5
|
+
actionpack (>= 5.2.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (6.1.1)
|
11
|
+
actionview (= 6.1.1)
|
12
|
+
activesupport (= 6.1.1)
|
13
|
+
rack (~> 2.0, >= 2.0.9)
|
14
|
+
rack-test (>= 0.6.3)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
+
actionview (6.1.1)
|
18
|
+
activesupport (= 6.1.1)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubi (~> 1.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
+
activesupport (6.1.1)
|
24
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
25
|
+
i18n (>= 1.6, < 2)
|
26
|
+
minitest (>= 5.1)
|
27
|
+
tzinfo (~> 2.0)
|
28
|
+
zeitwerk (~> 2.3)
|
29
|
+
ammeter (1.1.4)
|
30
|
+
activesupport (>= 3.0)
|
31
|
+
railties (>= 3.0)
|
32
|
+
rspec-rails (>= 2.2)
|
33
|
+
builder (3.2.4)
|
34
|
+
concurrent-ruby (1.1.8)
|
35
|
+
crass (1.0.6)
|
36
|
+
diff-lcs (1.3)
|
37
|
+
erubi (1.10.0)
|
38
|
+
i18n (1.8.7)
|
39
|
+
concurrent-ruby (~> 1.0)
|
40
|
+
loofah (2.9.0)
|
41
|
+
crass (~> 1.0.2)
|
42
|
+
nokogiri (>= 1.5.9)
|
43
|
+
method_source (1.0.0)
|
44
|
+
mini_portile2 (2.5.0)
|
45
|
+
minitest (5.14.3)
|
46
|
+
nokogiri (1.11.1)
|
47
|
+
mini_portile2 (~> 2.5.0)
|
48
|
+
racc (~> 1.4)
|
49
|
+
racc (1.5.2)
|
50
|
+
rack (2.2.3)
|
51
|
+
rack-test (1.1.0)
|
52
|
+
rack (>= 1.0, < 3)
|
53
|
+
rails-dom-testing (2.0.3)
|
54
|
+
activesupport (>= 4.2.0)
|
55
|
+
nokogiri (>= 1.6)
|
56
|
+
rails-html-sanitizer (1.3.0)
|
57
|
+
loofah (~> 2.3)
|
58
|
+
railties (6.1.1)
|
59
|
+
actionpack (= 6.1.1)
|
60
|
+
activesupport (= 6.1.1)
|
61
|
+
method_source
|
62
|
+
rake (>= 0.8.7)
|
63
|
+
thor (~> 1.0)
|
64
|
+
rake (13.0.3)
|
65
|
+
rspec-core (3.9.2)
|
66
|
+
rspec-support (~> 3.9.3)
|
67
|
+
rspec-dom-testing (0.1.0)
|
68
|
+
rails-dom-testing (>= 1.0, < 3)
|
69
|
+
rspec-expectations (~> 3.0)
|
70
|
+
rspec-expectations (3.9.2)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.9.0)
|
73
|
+
rspec-mocks (3.9.1)
|
74
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
+
rspec-support (~> 3.9.0)
|
76
|
+
rspec-rails (3.9.1)
|
77
|
+
actionpack (>= 3.0)
|
78
|
+
activesupport (>= 3.0)
|
79
|
+
railties (>= 3.0)
|
80
|
+
rspec-core (~> 3.9.0)
|
81
|
+
rspec-expectations (~> 3.9.0)
|
82
|
+
rspec-mocks (~> 3.9.0)
|
83
|
+
rspec-support (~> 3.9.0)
|
84
|
+
rspec-support (3.9.3)
|
85
|
+
sqlite3 (1.4.2)
|
86
|
+
thor (1.1.0)
|
87
|
+
tzinfo (2.0.4)
|
88
|
+
concurrent-ruby (~> 1.0)
|
89
|
+
yard (0.9.25)
|
90
|
+
zeitwerk (2.4.2)
|
91
|
+
|
92
|
+
PLATFORMS
|
93
|
+
ruby
|
94
|
+
|
95
|
+
DEPENDENCIES
|
96
|
+
ammeter (~> 1.1.3)
|
97
|
+
formtastic!
|
98
|
+
rake
|
99
|
+
rspec-dom-testing (>= 0.1.0)
|
100
|
+
rspec-rails (~> 3.4)
|
101
|
+
sqlite3 (~> 1.4)
|
102
|
+
yard (~> 0.9.20)
|
103
|
+
|
104
|
+
BUNDLED WITH
|
105
|
+
2.1.4
|
data/MIT-LICENSE
CHANGED