formeze 5.0.0 → 5.1.0

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: bd2160c23942cd4a127e7f84993aceb1a416a687060fb4f907181d295d5b26d5
4
- data.tar.gz: 7406001697348315beeeb47c7400756e4bf8fb8acb60b8d872004f8de2966382
3
+ metadata.gz: d48156472abef4843eb20d0f3a5fce2c17ae7551aeaf34d1fe0da1c8d6547cd2
4
+ data.tar.gz: 922345d41f4edd5b694156841e23c52c8b1a35cbbe476925430fef299470122a
5
5
  SHA512:
6
- metadata.gz: 83a0278250e4a4d9a1e7adae850e34cc4d44bdfa0e71638cf15ec7042abce347889495a4c6466d189ca30a9eb7b35e23472db91237f85f11841ef83fee2e01f8
7
- data.tar.gz: b4218dd2e97436668378a40863a652ef1e7f7e329c0fa903e44197846b935ba8af21c7d2e34f804e483c9fda385deb39529b8a2049f69e4130b2238ef1ef9c2b
6
+ metadata.gz: 19c9850c142de6097c31a52e8badb70e475e4342359dcd45787858775bbfec1c6e21a759e9628c8a08529513c2493ad92aee0331999fe303ef6162e08ed1b541
7
+ data.tar.gz: 6c2c2cfbab1abe61e814a8531ace2ed05edf3d00e8c4afbba048b862d02b8f3b351eee94c549ef80e22caa2cb51c351149728a5f6a82eef84d41c237b603e1fd
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 5.1.0
2
+
3
+ * Added `Formeze.exclude` attribute to configure which parameters are excluded
4
+
1
5
  # 5.0.0
2
6
 
3
7
  * Added a `fill` field option to specify how to fill a field. For example:
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2024 TIMCRAFT
1
+ Copyright (c) 2012-2025 TIMCRAFT
2
2
 
3
3
  This is an Open Source project licensed under the terms of the LGPLv3 license.
4
4
  Please see <http://www.gnu.org/licenses/lgpl-3.0.html> for license text.
data/README.md CHANGED
@@ -53,8 +53,9 @@ else
53
53
  end
54
54
  ```
55
55
 
56
- Formeze will automatically ignore the Rails "authenticity_token", "commit",
57
- and "utf8" parameters.
56
+ Formeze will exclude any parameters defined in `Formeze.exclude`, which by
57
+ default includes framework defined parameters like `_method`, `authenticity_token`,
58
+ `commit`, and `utf8`.
58
59
 
59
60
  If you prefer not to inherit from the `Formeze::Form` class then you can
60
61
  instead call the `Formeze.setup` method on your classes like this:
data/formeze.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'formeze'
3
- s.version = '5.0.0'
3
+ s.version = '5.1.0'
4
4
  s.license = 'LGPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
7
- s.email = ['mail@timcraft.com']
7
+ s.email = ['email@timcraft.com']
8
8
  s.homepage = 'https://github.com/readysteady/formeze'
9
9
  s.description = 'Ruby gem for parsing and validating form data'
10
10
  s.summary = 'See description'
data/lib/formeze.rb CHANGED
@@ -88,10 +88,8 @@ module Formeze
88
88
  end
89
89
  end
90
90
 
91
- if defined?(Rails)
92
- form_data.delete('authenticity_token')
93
- form_data.delete('commit')
94
- form_data.delete('utf8')
91
+ Formeze.exclude.each do |key|
92
+ form_data.delete(key)
95
93
  end
96
94
 
97
95
  unless form_data.empty?
@@ -140,6 +138,16 @@ module Formeze
140
138
  alias_method :to_hash, :to_h
141
139
  end
142
140
 
141
+ class << self
142
+ attr_accessor :exclude
143
+ end
144
+
145
+ if defined?(Rails)
146
+ self.exclude = %w[_method authenticity_token commit utf8]
147
+ else
148
+ self.exclude = %w[_method _csrf]
149
+ end
150
+
143
151
  def self.label(field_name)
144
152
  field_name.to_s.tr('_', ' ').capitalize
145
153
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formeze
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-07-24 00:00:00.000000000 Z
10
+ date: 2025-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rack
@@ -26,7 +25,7 @@ dependencies:
26
25
  version: '3'
27
26
  description: Ruby gem for parsing and validating form data
28
27
  email:
29
- - mail@timcraft.com
28
+ - email@timcraft.com
30
29
  executables: []
31
30
  extensions: []
32
31
  extra_rdoc_files: []
@@ -52,7 +51,6 @@ metadata:
52
51
  source_code_uri: https://github.com/readysteady/formeze
53
52
  bug_tracker_uri: https://github.com/readysteady/formeze/issues
54
53
  changelog_uri: https://github.com/readysteady/formeze/blob/main/CHANGES.md
55
- post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
@@ -67,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
- rubygems_version: 3.5.11
71
- signing_key:
68
+ rubygems_version: 3.6.2
72
69
  specification_version: 4
73
70
  summary: See description
74
71
  test_files: []