formtastic 3.1.6 → 4.0.0.rc1

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.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.gitignore +3 -2
  4. data/.travis.yml +28 -40
  5. data/CHANGELOG.md +49 -0
  6. data/DEPRECATIONS +1 -1
  7. data/Gemfile.lock +104 -0
  8. data/README.md +628 -629
  9. data/Rakefile +20 -1
  10. data/app/assets/stylesheets/formtastic.css +1 -1
  11. data/bin/appraisal +8 -0
  12. data/formtastic.gemspec +9 -14
  13. data/gemfiles/rails_5.2/Gemfile +5 -0
  14. data/gemfiles/rails_6.0/Gemfile +5 -0
  15. data/gemfiles/rails_edge/Gemfile +13 -0
  16. data/lib/formtastic/actions.rb +6 -3
  17. data/lib/formtastic/deprecation.rb +1 -38
  18. data/lib/formtastic/engine.rb +3 -1
  19. data/lib/formtastic/form_builder.rb +8 -24
  20. data/lib/formtastic/helpers/action_helper.rb +1 -48
  21. data/lib/formtastic/helpers/errors_helper.rb +2 -2
  22. data/lib/formtastic/helpers/fieldset_wrapper.rb +7 -3
  23. data/lib/formtastic/helpers/input_helper.rb +18 -76
  24. data/lib/formtastic/helpers/inputs_helper.rb +12 -3
  25. data/lib/formtastic/i18n.rb +1 -1
  26. data/lib/formtastic/inputs/base/collections.rb +1 -5
  27. data/lib/formtastic/inputs/base/errors.rb +4 -4
  28. data/lib/formtastic/inputs/base/hints.rb +1 -1
  29. data/lib/formtastic/inputs/base/timeish.rb +5 -1
  30. data/lib/formtastic/inputs/base/validations.rb +19 -9
  31. data/lib/formtastic/inputs/check_boxes_input.rb +3 -3
  32. data/lib/formtastic/inputs/color_input.rb +0 -1
  33. data/lib/formtastic/inputs/select_input.rb +1 -1
  34. data/lib/formtastic/inputs.rb +32 -29
  35. data/lib/formtastic/localizer.rb +4 -3
  36. data/lib/formtastic/version.rb +1 -1
  37. data/lib/formtastic.rb +5 -11
  38. data/lib/generators/templates/formtastic.rb +4 -6
  39. data/script/integration-template.rb +71 -0
  40. data/script/integration.sh +19 -0
  41. data/spec/action_class_finder_spec.rb +1 -1
  42. data/spec/actions/button_action_spec.rb +8 -8
  43. data/spec/actions/generic_action_spec.rb +60 -60
  44. data/spec/actions/input_action_spec.rb +7 -7
  45. data/spec/actions/link_action_spec.rb +10 -10
  46. data/spec/builder/custom_builder_spec.rb +36 -20
  47. data/spec/builder/error_proc_spec.rb +4 -4
  48. data/spec/builder/semantic_fields_for_spec.rb +27 -27
  49. data/spec/generators/formtastic/form/form_generator_spec.rb +25 -25
  50. data/spec/generators/formtastic/input/input_generator_spec.rb +31 -31
  51. data/spec/generators/formtastic/install/install_generator_spec.rb +9 -9
  52. data/spec/helpers/action_helper_spec.rb +328 -10
  53. data/spec/helpers/actions_helper_spec.rb +17 -17
  54. data/spec/helpers/form_helper_spec.rb +33 -33
  55. data/spec/helpers/input_helper_spec.rb +975 -2
  56. data/spec/helpers/inputs_helper_spec.rb +120 -105
  57. data/spec/helpers/reflection_helper_spec.rb +3 -3
  58. data/spec/helpers/semantic_errors_helper_spec.rb +22 -22
  59. data/spec/i18n_spec.rb +26 -26
  60. data/spec/input_class_finder_spec.rb +1 -1
  61. data/spec/inputs/base/collections_spec.rb +6 -6
  62. data/spec/inputs/base/validations_spec.rb +157 -19
  63. data/spec/inputs/boolean_input_spec.rb +55 -55
  64. data/spec/inputs/check_boxes_input_spec.rb +96 -95
  65. data/spec/inputs/color_input_spec.rb +51 -63
  66. data/spec/inputs/country_input_spec.rb +20 -20
  67. data/spec/inputs/custom_input_spec.rb +2 -6
  68. data/spec/inputs/datalist_input_spec.rb +1 -1
  69. data/spec/inputs/date_picker_input_spec.rb +42 -42
  70. data/spec/inputs/date_select_input_spec.rb +51 -37
  71. data/spec/inputs/datetime_picker_input_spec.rb +46 -46
  72. data/spec/inputs/datetime_select_input_spec.rb +53 -37
  73. data/spec/inputs/email_input_spec.rb +5 -5
  74. data/spec/inputs/file_input_spec.rb +6 -6
  75. data/spec/inputs/hidden_input_spec.rb +18 -18
  76. data/spec/inputs/include_blank_spec.rb +8 -8
  77. data/spec/inputs/label_spec.rb +20 -20
  78. data/spec/inputs/number_input_spec.rb +112 -112
  79. data/spec/inputs/password_input_spec.rb +5 -5
  80. data/spec/inputs/phone_input_spec.rb +5 -5
  81. data/spec/inputs/placeholder_spec.rb +5 -5
  82. data/spec/inputs/radio_input_spec.rb +63 -65
  83. data/spec/inputs/range_input_spec.rb +66 -66
  84. data/spec/inputs/readonly_spec.rb +4 -4
  85. data/spec/inputs/search_input_spec.rb +5 -5
  86. data/spec/inputs/select_input_spec.rb +92 -96
  87. data/spec/inputs/string_input_spec.rb +23 -23
  88. data/spec/inputs/text_input_spec.rb +16 -16
  89. data/spec/inputs/time_picker_input_spec.rb +43 -43
  90. data/spec/inputs/time_select_input_spec.rb +67 -54
  91. data/spec/inputs/time_zone_input_spec.rb +19 -19
  92. data/spec/inputs/url_input_spec.rb +5 -5
  93. data/spec/inputs/with_options_spec.rb +7 -7
  94. data/spec/localizer_spec.rb +17 -17
  95. data/spec/namespaced_class_finder_spec.rb +2 -2
  96. data/spec/schema.rb +21 -0
  97. data/spec/spec_helper.rb +163 -223
  98. data/spec/support/custom_macros.rb +72 -75
  99. data/spec/support/shared_examples.rb +0 -1301
  100. data/spec/support/test_environment.rb +23 -9
  101. metadata +36 -122
  102. data/Appraisals +0 -43
  103. data/CHANGELOG +0 -54
  104. data/gemfiles/rails_3.2.gemfile +0 -9
  105. data/gemfiles/rails_4.0.4.gemfile +0 -8
  106. data/gemfiles/rails_4.1.gemfile +0 -8
  107. data/gemfiles/rails_4.2.gemfile +0 -8
  108. data/gemfiles/rails_4.gemfile +0 -8
  109. data/gemfiles/rails_5.0.gemfile +0 -8
  110. data/gemfiles/rails_edge.gemfile +0 -15
  111. data/lib/formtastic/util.rb +0 -57
  112. data/spec/helpers/namespaced_action_helper_spec.rb +0 -43
  113. data/spec/helpers/namespaced_input_helper_spec.rb +0 -36
  114. data/spec/util_spec.rb +0 -66
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fefdec8b2958a3bf5c17aabe98e7096d041023858b2a04798a1eae11c264e42
4
- data.tar.gz: e5a5fdd71803d0f51b267324b6fdb50919ce5dfb564cf6c545b3bd655dd44d08
3
+ metadata.gz: 8d4e6d380c2d708ed43fd63f5558416c1ef53aa6a208ba9b74ce613419683501
4
+ data.tar.gz: caf570aee5672261b10094658ab5dcfd56f944f456b288eedebeb1a58d53caf1
5
5
  SHA512:
6
- metadata.gz: 183dcccafba6dad57c447a5a32f282cff80152d654e604208186ca20f8dddc201ebd7af8eeff8dbeee6a33aa99095b5c06261b3b404d1ec40ab9a037f4a0c08c
7
- data.tar.gz: f5144105d6fd1b92b06421085e578f1bf87c2b002997a5ff8e7fc8e0b310d32a68274b0550b449fb6c37b840a28453b4c1eccd7305ac670edb152ddcdf86db17
6
+ metadata.gz: e575fe3d770692adfcac597cf9719ab459c157dd09738090eeb9ca5c23abc49ecce78df9a51a3781b55fb5b0f4e50f3f3273af70a8674346a7e059f1485523b8
7
+ data.tar.gz: 2363a8a9a9ce3b1a981df647d511db68e4fd71073e2a3b4aaa6f0023ae59ae4d402e05a2fc9454d228ca6fd659c3d6e3eceb0e9fbc3df9fb25026006956bef87
data/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ CHANGELOG merge=union
data/.gitignore CHANGED
@@ -9,9 +9,10 @@ pkg
9
9
  log/*
10
10
  .rvmrc
11
11
  .ruby-version
12
+ \.ruby-gemset
12
13
  .bundle
13
- Gemfile.lock
14
14
  .yardoc
15
15
  doc/
16
16
  tmp
17
- gemfiles/*.lock
17
+ gemfiles/*/Gemfile.lock
18
+ /dummy/
data/.travis.yml CHANGED
@@ -1,46 +1,34 @@
1
- sudo: false
2
- cache: bundler
1
+ cache:
2
+ - bundler
3
+ - directories:
4
+ - gemfiles/rails_52/vendor/bundle
5
+ - gemfiles/rails_60/vendor/bundle
6
+ - gemfiles/rails_edge/vendor/bundle
7
+ dist: bionic
3
8
  language: ruby
9
+ node_js: 11
4
10
  rvm:
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.1.8
8
- - 2.2.4
9
- - 2.3.0
10
- - 2.4.0
11
+ - 2.4.9
12
+ - 2.5.7
13
+ - 2.6.5
14
+ - 2.7.0
11
15
  gemfile:
12
- - gemfiles/rails_3.2.gemfile
13
- - gemfiles/rails_4.gemfile
14
- - gemfiles/rails_4.0.4.gemfile
15
- - gemfiles/rails_4.1.gemfile
16
- - gemfiles/rails_4.2.gemfile
17
- - gemfiles/rails_5.0.gemfile
18
- - gemfiles/rails_edge.gemfile
19
- env:
20
- before_install: "gem install bundler --version 1.14.4"
21
- script: "bundle exec rake spec"
16
+ - gemfiles/rails_5.2/Gemfile
17
+ - gemfiles/rails_6.0/Gemfile
18
+ - gemfiles/rails_edge/Gemfile
19
+ before_install:
20
+ - gem install bundler
21
+ - export BUNDLE_PATH=$(dirname $(readlink -f $BUNDLE_GEMFILE))/vendor/bundle
22
+ before_cache:
23
+ - rm -f ${BUNDLE_PATH}/**/extensions/**/{gem_make.out,mkmf.log}
24
+ script:
25
+ - bundle exec rake spec
26
+ - script/integration.sh
22
27
  matrix:
23
28
  exclude:
24
- - rvm: 1.9.3
25
- gemfile: gemfiles/rails_edge.gemfile
26
- - rvm: 2.0.0
27
- gemfile: gemfiles/rails_edge.gemfile
28
- - rvm: 2.1.8
29
- gemfile: gemfiles/rails_edge.gemfile
30
- - rvm: 2.0.0
31
- gemfile: gemfiles/rails_5.0.gemfile
32
- - rvm: 2.1.8
33
- gemfile: gemfiles/rails_5.0.gemfile
34
- - rvm: 2.4.0
35
- gemfile: gemfiles/rails_4.1.gemfile
36
- - rvm: 2.4.0
37
- gemfile: gemfiles/rails_4.2.gemfile
38
- - rvm: 2.4.0
39
- gemfile: gemfiles/rails_3.2.gemfile
40
- - rvm: 2.4.0
41
- gemfile: gemfiles/rails_4.0.4.gemfile
42
- - rvm: 2.4.0
43
- gemfile: gemfiles/rails_4.gemfile
29
+ - rvm: 2.4.9
30
+ gemfile: gemfiles/rails_6.0/Gemfile
31
+ - rvm: 2.4.9
32
+ gemfile: gemfiles/rails_edge/Gemfile
44
33
  allow_failures:
45
- - gemfile: gemfiles/rails_edge.gemfile
46
- - rvm: 1.9.3
34
+ - gemfile: gemfiles/rails_edge/Gemfile
data/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ ## master
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
+
15
+ ## 3.1.2
16
+
17
+ * Fixed that we specified 4.0.4 instead of 4.1 in the Rails version deprecation message
18
+
19
+ ## 3.1.1
20
+
21
+ * Fixed class custom input & action class loading in test environments
22
+ * Added documentation of custom input & action class finders
23
+ * Added a link to documentation & wiki from custom class deprecation warnings
24
+
25
+ ## 3.1.0
26
+
27
+ * Performance and documentation improvements
28
+
29
+ ## 3.1.0.rc2
30
+
31
+ * Deprecated :member_value and :member_label options
32
+
33
+ ## 3.1.0.rc1
34
+
35
+ * Deprecated support for Rails version < 4.1.0
36
+ * Fixed synchronization issues with custom_namespace configuration
37
+ * Fixed bug where boolean (checkbox) inputs were not being correctly checked (also in 2.3.1)
38
+ * Fixed (silenced) Rails 5 deprecation on column_for_attribute that we're handling fine
39
+ * Added new DatalistInput (:as => :datalist) for HTML5 datalists
40
+ * Added configurable namespaces for custom inputs
41
+ * Various performance and documentation improvements
42
+
43
+ ---
44
+
45
+ See 3.0-stable branch for 3.0.x changes
46
+ https://github.com/justinfrench/formtastic/blob/3.0-stable/CHANGELOG
47
+
48
+ See 2.3-stable branch for 2.3.x and earlier releases
49
+ https://github.com/justinfrench/formtastic/blob/2.3-stable/CHANGELOG
data/DEPRECATIONS CHANGED
@@ -3,7 +3,7 @@ Formtastic features and compatibilities.
3
3
 
4
4
  v4.0 (planned)
5
5
 
6
- * Remove support for Rails < 4.1
6
+ * Remove support for Rails < 5.2
7
7
  * Remove support for country_select 1.x syntax (they want to remove it in 3.0)
8
8
  * Remove support for input_class, custom_input_class_name, standard_input_class_name, action_class, custom_action_class_name, standard_action_class_name
9
9
 
data/Gemfile.lock ADDED
@@ -0,0 +1,104 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ formtastic (3.2.0.pre)
5
+ actionpack (>= 5.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (6.0.3.2)
11
+ actionview (= 6.0.3.2)
12
+ activesupport (= 6.0.3.2)
13
+ rack (~> 2.0, >= 2.0.8)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
+ actionview (6.0.3.2)
18
+ activesupport (= 6.0.3.2)
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.0.3.2)
24
+ concurrent-ruby (~> 1.0, >= 1.0.2)
25
+ i18n (>= 0.7, < 2)
26
+ minitest (~> 5.1)
27
+ tzinfo (~> 1.1)
28
+ zeitwerk (~> 2.2, >= 2.2.2)
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.6)
35
+ crass (1.0.6)
36
+ diff-lcs (1.3)
37
+ erubi (1.9.0)
38
+ i18n (1.8.3)
39
+ concurrent-ruby (~> 1.0)
40
+ loofah (2.6.0)
41
+ crass (~> 1.0.2)
42
+ nokogiri (>= 1.5.9)
43
+ method_source (1.0.0)
44
+ mini_portile2 (2.4.0)
45
+ minitest (5.14.1)
46
+ nokogiri (1.10.9)
47
+ mini_portile2 (~> 2.4.0)
48
+ rack (2.2.3)
49
+ rack-test (1.1.0)
50
+ rack (>= 1.0, < 3)
51
+ rails-dom-testing (2.0.3)
52
+ activesupport (>= 4.2.0)
53
+ nokogiri (>= 1.6)
54
+ rails-html-sanitizer (1.3.0)
55
+ loofah (~> 2.3)
56
+ railties (6.0.3.2)
57
+ actionpack (= 6.0.3.2)
58
+ activesupport (= 6.0.3.2)
59
+ method_source
60
+ rake (>= 0.8.7)
61
+ thor (>= 0.20.3, < 2.0)
62
+ rake (13.0.1)
63
+ rspec-core (3.9.2)
64
+ rspec-support (~> 3.9.3)
65
+ rspec-dom-testing (0.1.0)
66
+ rails-dom-testing (>= 1.0, < 3)
67
+ rspec-expectations (~> 3.0)
68
+ rspec-expectations (3.9.2)
69
+ diff-lcs (>= 1.2.0, < 2.0)
70
+ rspec-support (~> 3.9.0)
71
+ rspec-mocks (3.9.1)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.9.0)
74
+ rspec-rails (3.9.1)
75
+ actionpack (>= 3.0)
76
+ activesupport (>= 3.0)
77
+ railties (>= 3.0)
78
+ rspec-core (~> 3.9.0)
79
+ rspec-expectations (~> 3.9.0)
80
+ rspec-mocks (~> 3.9.0)
81
+ rspec-support (~> 3.9.0)
82
+ rspec-support (3.9.3)
83
+ sqlite3 (1.4.2)
84
+ thor (1.0.1)
85
+ thread_safe (0.3.6)
86
+ tzinfo (1.2.7)
87
+ thread_safe (~> 0.1)
88
+ yard (0.9.25)
89
+ zeitwerk (2.3.0)
90
+
91
+ PLATFORMS
92
+ ruby
93
+
94
+ DEPENDENCIES
95
+ ammeter (~> 1.1.3)
96
+ formtastic!
97
+ rake
98
+ rspec-dom-testing (>= 0.1.0)
99
+ rspec-rails (~> 3.4)
100
+ sqlite3 (~> 1.4)
101
+ yard (~> 0.9.20)
102
+
103
+ BUNDLED WITH
104
+ 2.1.4