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
@@ -1,11 +1,32 @@
1
1
  # encoding: utf-8
2
2
  require 'rspec/core'
3
- require 'rspec_tag_matchers'
3
+
4
+ require 'rspec-dom-testing'
4
5
 
5
6
  RSpec.configure do |config|
6
- config.include RspecTagMatchers
7
7
  config.include CustomMacros
8
+ config.include RSpec::Dom::Testing::Matchers
8
9
  config.mock_with :rspec
10
+
11
+ # rspec-rails 3 will no longer automatically infer an example group's spec type
12
+ # from the file location. You can explicitly opt-in to the feature using this
13
+ # config option.
14
+ # To explicitly tag specs without using automatic inference, set the `:type`
15
+ # metadata manually:
16
+ #
17
+ # describe ThingsController, :type => :controller do
18
+ # # Equivalent to being in spec/controllers
19
+ # end
20
+ config.infer_spec_type_from_file_location!
21
+
22
+ # Setting this config option `false` removes rspec-core's monkey patching of the
23
+ # top level methods like `describe`, `shared_examples_for` and `shared_context`
24
+ # on `main` and `Module`. The methods are always available through the `RSpec`
25
+ # module like `RSpec.describe` regardless of this setting.
26
+ # For backwards compatibility this defaults to `true`.
27
+ #
28
+ # https://relishapp.com/rspec/rspec-core/v/3-0/docs/configuration/global-namespace-dsl
29
+ config.expose_dsl_globally = false
9
30
  end
10
31
 
11
32
  require "action_controller/railtie"
@@ -14,8 +35,6 @@ require 'active_model'
14
35
  # Create a simple rails application for use in testing the viewhelper
15
36
  module FormtasticTest
16
37
  class Application < Rails::Application
17
- # Configure the default encoding used in templates for Ruby 1.9.
18
- config.encoding = "utf-8"
19
38
  config.active_support.deprecation = :stderr
20
39
  config.secret_key_base = "secret"
21
40
  config.eager_load = false
@@ -24,8 +43,3 @@ end
24
43
  FormtasticTest::Application.initialize!
25
44
 
26
45
  require 'rspec/rails'
27
-
28
- # Quick hack to avoid the 'Spec' deprecation warnings from rspec_tag_matchers
29
- module Spec
30
- include RSpec
31
- end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formtastic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.6
4
+ version: 4.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin French
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2020-06-21 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: actionpack
@@ -15,114 +16,72 @@ dependencies:
15
16
  requirements:
16
17
  - - ">="
17
18
  - !ruby/object:Gem::Version
18
- version: 3.2.13
19
+ version: 5.2.0
19
20
  type: :runtime
20
21
  prerelease: false
21
22
  version_requirements: !ruby/object:Gem::Requirement
22
23
  requirements:
23
24
  - - ">="
24
25
  - !ruby/object:Gem::Version
25
- version: 3.2.13
26
- - !ruby/object:Gem::Dependency
27
- name: nokogiri
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- type: :development
34
- prerelease: false
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0'
26
+ version: 5.2.0
40
27
  - !ruby/object:Gem::Dependency
41
28
  name: rspec-rails
42
29
  requirement: !ruby/object:Gem::Requirement
43
30
  requirements:
44
31
  - - "~>"
45
32
  - !ruby/object:Gem::Version
46
- version: 3.3.2
33
+ version: '3.4'
47
34
  type: :development
48
35
  prerelease: false
49
36
  version_requirements: !ruby/object:Gem::Requirement
50
37
  requirements:
51
38
  - - "~>"
52
39
  - !ruby/object:Gem::Version
53
- version: 3.3.2
40
+ version: '3.4'
54
41
  - !ruby/object:Gem::Dependency
55
- name: rspec_tag_matchers
42
+ name: rspec-dom-testing
56
43
  requirement: !ruby/object:Gem::Requirement
57
44
  requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '1.0'
61
- type: :development
62
- prerelease: false
63
- version_requirements: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '1.0'
68
- - !ruby/object:Gem::Dependency
69
- name: hpricot
70
- requirement: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: 0.8.3
75
- type: :development
76
- prerelease: false
77
- version_requirements: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: 0.8.3
82
- - !ruby/object:Gem::Dependency
83
- name: RedCloth
84
- requirement: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
45
+ - - ">="
87
46
  - !ruby/object:Gem::Version
88
- version: '4.2'
47
+ version: 0.1.0
89
48
  type: :development
90
49
  prerelease: false
91
50
  version_requirements: !ruby/object:Gem::Requirement
92
51
  requirements:
93
- - - "~>"
52
+ - - ">="
94
53
  - !ruby/object:Gem::Version
95
- version: '4.2'
54
+ version: 0.1.0
96
55
  - !ruby/object:Gem::Dependency
97
56
  name: yard
98
57
  requirement: !ruby/object:Gem::Requirement
99
58
  requirements:
100
59
  - - "~>"
101
60
  - !ruby/object:Gem::Version
102
- version: '0.8'
61
+ version: 0.9.20
103
62
  type: :development
104
63
  prerelease: false
105
64
  version_requirements: !ruby/object:Gem::Requirement
106
65
  requirements:
107
66
  - - "~>"
108
67
  - !ruby/object:Gem::Version
109
- version: '0.8'
68
+ version: 0.9.20
110
69
  - !ruby/object:Gem::Dependency
111
- name: colored
70
+ name: ammeter
112
71
  requirement: !ruby/object:Gem::Requirement
113
72
  requirements:
114
73
  - - "~>"
115
74
  - !ruby/object:Gem::Version
116
- version: '1.2'
75
+ version: 1.1.3
117
76
  type: :development
118
77
  prerelease: false
119
78
  version_requirements: !ruby/object:Gem::Requirement
120
79
  requirements:
121
80
  - - "~>"
122
81
  - !ruby/object:Gem::Version
123
- version: '1.2'
82
+ version: 1.1.3
124
83
  - !ruby/object:Gem::Dependency
125
- name: tzinfo
84
+ name: rake
126
85
  requirement: !ruby/object:Gem::Requirement
127
86
  requirements:
128
87
  - - ">="
@@ -136,61 +95,19 @@ dependencies:
136
95
  - !ruby/object:Gem::Version
137
96
  version: '0'
138
97
  - !ruby/object:Gem::Dependency
139
- name: ammeter
140
- requirement: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: 1.1.3
145
- type: :development
146
- prerelease: false
147
- version_requirements: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: 1.1.3
152
- - !ruby/object:Gem::Dependency
153
- name: appraisal
98
+ name: sqlite3
154
99
  requirement: !ruby/object:Gem::Requirement
155
100
  requirements:
156
101
  - - "~>"
157
102
  - !ruby/object:Gem::Version
158
- version: '2.1'
103
+ version: '1.4'
159
104
  type: :development
160
105
  prerelease: false
161
106
  version_requirements: !ruby/object:Gem::Requirement
162
107
  requirements:
163
108
  - - "~>"
164
109
  - !ruby/object:Gem::Version
165
- version: '2.1'
166
- - !ruby/object:Gem::Dependency
167
- name: rake
168
- requirement: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - "<"
171
- - !ruby/object:Gem::Version
172
- version: '12'
173
- type: :development
174
- prerelease: false
175
- version_requirements: !ruby/object:Gem::Requirement
176
- requirements:
177
- - - "<"
178
- - !ruby/object:Gem::Version
179
- version: '12'
180
- - !ruby/object:Gem::Dependency
181
- name: activemodel
182
- requirement: !ruby/object:Gem::Requirement
183
- requirements:
184
- - - ">="
185
- - !ruby/object:Gem::Version
186
- version: 3.2.13
187
- type: :development
188
- prerelease: false
189
- version_requirements: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: 3.2.13
110
+ version: '1.4'
194
111
  description: A Rails form builder plugin/gem with semantically rich and accessible
195
112
  markup
196
113
  email:
@@ -200,14 +117,15 @@ extensions: []
200
117
  extra_rdoc_files:
201
118
  - README.md
202
119
  files:
120
+ - ".gitattributes"
203
121
  - ".gitignore"
204
122
  - ".rspec"
205
123
  - ".travis.yml"
206
124
  - ".yardopts"
207
- - Appraisals
208
- - CHANGELOG
125
+ - CHANGELOG.md
209
126
  - DEPRECATIONS
210
127
  - Gemfile
128
+ - Gemfile.lock
211
129
  - MIT-LICENSE
212
130
  - README.md
213
131
  - RELEASE_PROCESS
@@ -215,14 +133,11 @@ files:
215
133
  - app/assets/stylesheets/formtastic.css
216
134
  - app/assets/stylesheets/formtastic_ie6.css
217
135
  - app/assets/stylesheets/formtastic_ie7.css
136
+ - bin/appraisal
218
137
  - formtastic.gemspec
219
- - gemfiles/rails_3.2.gemfile
220
- - gemfiles/rails_4.0.4.gemfile
221
- - gemfiles/rails_4.1.gemfile
222
- - gemfiles/rails_4.2.gemfile
223
- - gemfiles/rails_4.gemfile
224
- - gemfiles/rails_5.0.gemfile
225
- - gemfiles/rails_edge.gemfile
138
+ - gemfiles/rails_5.2/Gemfile
139
+ - gemfiles/rails_6.0/Gemfile
140
+ - gemfiles/rails_edge/Gemfile
226
141
  - lib/formtastic.rb
227
142
  - lib/formtastic/action_class_finder.rb
228
143
  - lib/formtastic/actions.rb
@@ -296,7 +211,6 @@ files:
296
211
  - lib/formtastic/localized_string.rb
297
212
  - lib/formtastic/localizer.rb
298
213
  - lib/formtastic/namespaced_class_finder.rb
299
- - lib/formtastic/util.rb
300
214
  - lib/formtastic/version.rb
301
215
  - lib/generators/formtastic/form/form_generator.rb
302
216
  - lib/generators/formtastic/input/input_generator.rb
@@ -310,6 +224,8 @@ files:
310
224
  - sample/basic_inputs.html
311
225
  - sample/config.ru
312
226
  - sample/index.html
227
+ - script/integration-template.rb
228
+ - script/integration.sh
313
229
  - spec/action_class_finder_spec.rb
314
230
  - spec/actions/button_action_spec.rb
315
231
  - spec/actions/generic_action_spec.rb
@@ -327,8 +243,6 @@ files:
327
243
  - spec/helpers/form_helper_spec.rb
328
244
  - spec/helpers/input_helper_spec.rb
329
245
  - spec/helpers/inputs_helper_spec.rb
330
- - spec/helpers/namespaced_action_helper_spec.rb
331
- - spec/helpers/namespaced_input_helper_spec.rb
332
246
  - spec/helpers/reflection_helper_spec.rb
333
247
  - spec/helpers/semantic_errors_helper_spec.rb
334
248
  - spec/i18n_spec.rb
@@ -368,6 +282,7 @@ files:
368
282
  - spec/inputs/with_options_spec.rb
369
283
  - spec/localizer_spec.rb
370
284
  - spec/namespaced_class_finder_spec.rb
285
+ - spec/schema.rb
371
286
  - spec/spec.opts
372
287
  - spec/spec_helper.rb
373
288
  - spec/support/custom_macros.rb
@@ -375,11 +290,11 @@ files:
375
290
  - spec/support/shared_examples.rb
376
291
  - spec/support/specialized_class_finder_shared_example.rb
377
292
  - spec/support/test_environment.rb
378
- - spec/util_spec.rb
379
293
  homepage: http://github.com/justinfrench/formtastic
380
294
  licenses:
381
295
  - MIT
382
296
  metadata: {}
297
+ post_install_message:
383
298
  rdoc_options:
384
299
  - "--charset=UTF-8"
385
300
  require_paths:
@@ -388,14 +303,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
388
303
  requirements:
389
304
  - - ">="
390
305
  - !ruby/object:Gem::Version
391
- version: 1.9.3
306
+ version: 2.4.0
392
307
  required_rubygems_version: !ruby/object:Gem::Requirement
393
308
  requirements:
394
309
  - - ">="
395
310
  - !ruby/object:Gem::Version
396
311
  version: '0'
397
312
  requirements: []
398
- rubygems_version: 3.6.8
313
+ rubygems_version: 3.1.2
314
+ signing_key:
399
315
  specification_version: 4
400
316
  summary: A Rails form builder plugin/gem with semantically rich and accessible markup
401
317
  test_files:
@@ -416,8 +332,6 @@ test_files:
416
332
  - spec/helpers/form_helper_spec.rb
417
333
  - spec/helpers/input_helper_spec.rb
418
334
  - spec/helpers/inputs_helper_spec.rb
419
- - spec/helpers/namespaced_action_helper_spec.rb
420
- - spec/helpers/namespaced_input_helper_spec.rb
421
335
  - spec/helpers/reflection_helper_spec.rb
422
336
  - spec/helpers/semantic_errors_helper_spec.rb
423
337
  - spec/i18n_spec.rb
@@ -457,6 +371,7 @@ test_files:
457
371
  - spec/inputs/with_options_spec.rb
458
372
  - spec/localizer_spec.rb
459
373
  - spec/namespaced_class_finder_spec.rb
374
+ - spec/schema.rb
460
375
  - spec/spec.opts
461
376
  - spec/spec_helper.rb
462
377
  - spec/support/custom_macros.rb
@@ -464,4 +379,3 @@ test_files:
464
379
  - spec/support/shared_examples.rb
465
380
  - spec/support/specialized_class_finder_shared_example.rb
466
381
  - spec/support/test_environment.rb
467
- - spec/util_spec.rb
data/Appraisals DELETED
@@ -1,43 +0,0 @@
1
- appraise 'rails-3.2' do
2
- gem 'rails', '~> 3.2.0'
3
- gem 'test-unit-minitest', :platform => [:ruby_22, :ruby_23]
4
- gem 'nokogiri', '~>1.6.8', platform: :mri_20
5
- end
6
-
7
- appraise 'rails-4' do
8
- gem 'rails', '~> 4.0.0'
9
- gem 'nokogiri', '~>1.6.8', platform: :mri_20
10
- end
11
-
12
- # Special case for a change in I18n
13
- appraise 'rails-4.0.4' do
14
- gem 'rails', '4.0.4'
15
- gem 'nokogiri', '~>1.6.8', platform: :mri_20
16
- end
17
-
18
- appraise 'rails-4.1' do
19
- gem 'rails', '~>4.1.0'
20
- gem 'nokogiri', '~>1.6.8', platform: :mri_20
21
- end
22
-
23
- appraise 'rails-4.2' do
24
- gem 'rails', '~>4.2.0'
25
- gem 'nokogiri', '~>1.6.8', platform: :mri_20
26
- end
27
-
28
- appraise 'rails-5.0' do
29
- gem 'rails', '~> 5.0.1'
30
- gem 'rspec-rails', '~> 3.5'
31
- end
32
-
33
- appraise 'rails-edge' do
34
- gem 'rails', github: 'rails/rails'
35
- gem 'rack', github: 'rack/rack'
36
- gem 'i18n', github: 'svenfuchs/i18n'
37
- gem 'arel', github: 'rails/arel'
38
- gem 'rspec-rails', github: 'rspec/rspec-rails'
39
- gem 'rspec-mocks', github: 'rspec/rspec-mocks'
40
- gem 'rspec-support', github: 'rspec/rspec-support'
41
- gem 'rspec-core', github: 'rspec/rspec-core'
42
- gem 'rspec-expectations', github: 'rspec/rspec-expectations'
43
- end
data/CHANGELOG DELETED
@@ -1,54 +0,0 @@
1
- 3.1.5
2
- * Backport use Integer instead of Fixnum for Ruby 2.4 support (#1235, #1243)
3
-
4
- 3.1.4
5
- * Performance improvements (#1174)
6
- * Added priority time zones configuration (#1172)
7
- * Added input generators (#1150)
8
- * Added support for `enum` (#1098)
9
- * Added support for Reform gem by relying only on `defined_enums` Hash for enum collections (#1113)
10
- * Added support for customizeable skipped columns (#1133)
11
- * Added automatic input readonly attribute for attr_readonly attributes (#1158)
12
- * Added support for multiple validation contexts (#1179)
13
- * Rails 5 Beta support (#1183)
14
- * Fixed typos and improved documentation
15
-
16
- 3.1.3
17
-
18
- * Fixed (silenced) additional Rails 5 deprecation on column_for_attribute that we missed in 3.1.0
19
-
20
- 3.1.2
21
-
22
- * Fixed that we specified 4.0.4 instead of 4.1 in the Rails version deprecation message
23
-
24
- 3.1.1
25
-
26
- * Fixed class custom input & action class loading in test environments
27
- * Added documentation of custom input & action class finders
28
- * Added a link to documentation & wiki from custom class deprecation warnings
29
-
30
- 3.1.0
31
-
32
- * Performance and documentation improvements
33
-
34
- 3.1.0.rc2
35
-
36
- * Deprecated :member_value and :member_label options
37
-
38
- 3.1.0.rc1
39
-
40
- * Deprecated support for Rails version < 4.1.0
41
- * Fixed synchronization issues with custom_namespace configuration
42
- * Fixed bug where boolean (checkbox) inputs were not being correctly checked (also in 2.3.1)
43
- * Fixed (silenced) Rails 5 deprecation on column_for_attribute that we're handling fine
44
- * Added new DatalistInput (:as => :datalist) for HTML5 datalists
45
- * Added configurable namespaces for custom inputs
46
- * Various performance and documentation improvements
47
-
48
- ---
49
-
50
- See 3.0-stable branch for 3.0.x changes
51
- https://github.com/justinfrench/formtastic/blob/3.0-stable/CHANGELOG
52
-
53
- See 2.3-stable branch for 2.3.x and earlier releases
54
- https://github.com/justinfrench/formtastic/blob/2.3-stable/CHANGELOG
@@ -1,9 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
- gem "test-unit-minitest", :platform => [:ruby_22, :ruby_23]
7
- gem "nokogiri", "~>1.6.8", :platform => :mri_20
8
-
9
- gemspec :path => "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "4.0.4"
6
- gem "nokogiri", "~>1.6.8", :platform => :mri_20
7
-
8
- gemspec :path => "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~>4.1.0"
6
- gem "nokogiri", "~>1.6.8", :platform => :mri_20
7
-
8
- gemspec :path => "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~>4.2.0"
6
- gem "nokogiri", "~>1.6.8", :platform => :mri_20
7
-
8
- gemspec :path => "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
- gem "nokogiri", "~>1.6.8", :platform => :mri_20
7
-
8
- gemspec :path => "../"
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 5.0.1"
6
- gem "rspec-rails", "~> 3.5"
7
-
8
- gemspec :path => "../"
@@ -1,15 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", :github => "rails/rails"
6
- gem "rack", :github => "rack/rack"
7
- gem "i18n", :github => "svenfuchs/i18n"
8
- gem "arel", :github => "rails/arel"
9
- gem "rspec-rails", :github => "rspec/rspec-rails"
10
- gem "rspec-mocks", :github => "rspec/rspec-mocks"
11
- gem "rspec-support", :github => "rspec/rspec-support"
12
- gem "rspec-core", :github => "rspec/rspec-core"
13
- gem "rspec-expectations", :github => "rspec/rspec-expectations"
14
-
15
- gemspec :path => "../"
@@ -1,57 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # Adapted from the rails3 compatibility shim in Haml 2.2
4
- module Formtastic
5
- # @private
6
- module Util
7
- extend self
8
- ## Rails XSS Safety
9
-
10
- # Returns the given text, marked as being HTML-safe.
11
- # With older versions of the Rails XSS-safety mechanism,
12
- # this destructively modifies the HTML-safety of `text`.
13
- #
14
- # @param text [String]
15
- # @return [String] `text`, marked as HTML-safe
16
- def html_safe(text)
17
- if text.respond_to?(:html_safe)
18
- text.html_safe
19
- else
20
- text
21
- end
22
- end
23
-
24
- def rails3?
25
- match?(rails_version, "~> 3.0")
26
- end
27
-
28
- def rails4?
29
- match?(rails_version, "~> 4.0")
30
- end
31
-
32
- def rails4_0?
33
- match?(rails_version, "~> 4.0.0")
34
- end
35
-
36
- def rails4_1?
37
- match?(rails_version, "~> 4.1.0")
38
- end
39
-
40
- def deprecated_version_of_rails?
41
- match?(rails_version, "< #{minimum_version_of_rails}")
42
- end
43
-
44
- def minimum_version_of_rails
45
- "4.1.0"
46
- end
47
-
48
- def rails_version
49
- ::Rails::VERSION::STRING
50
- end
51
-
52
- def match?(version, dependency)
53
- Gem::Dependency.new("formtastic", dependency).match?("formtastic", version)
54
- end
55
-
56
- end
57
- end
@@ -1,43 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'with action class finder' do
4
- include_context 'form builder'
5
-
6
- before {
7
- allow(Formtastic::FormBuilder)
8
- .to receive(:action_class_finder).and_return(Formtastic::ActionClassFinder)
9
- }
10
-
11
- it_behaves_like 'Action Helper'
12
-
13
- describe 'instantiating an action class' do
14
- it "should delegate to ActionClassFinder" do
15
- concat(semantic_form_for(@new_post) do |builder|
16
- Formtastic::ActionClassFinder.any_instance.should_receive(:find).
17
- with(:button).and_call_original
18
-
19
- builder.action(:submit, :as => :button)
20
- end)
21
- end
22
-
23
- describe 'when instantiated multiple times with the same action type' do
24
- it "should be cached" do
25
- concat(semantic_form_for(@new_post) do |builder|
26
- Formtastic::ActionClassFinder.should_receive(:new).once.and_call_original
27
- builder.action(:submit, :as => :button)
28
- builder.action(:submit, :as => :button)
29
- end)
30
- end
31
- end
32
-
33
- context 'of unknown action' do
34
- it "should try to load class named as the action" do
35
- expect {
36
- semantic_form_for(@new_post) do |builder|
37
- builder.action(:destroy)
38
- end
39
- }.to raise_error(Formtastic::UnknownActionError, 'Unable to find action class DestroyAction')
40
- end
41
- end
42
- end
43
- end