forme 2.7.0 → 2.8.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/forme/form.rb +2 -2
- data/lib/forme/transformers/serializer.rb +5 -1
- data/lib/forme/version.rb +1 -1
- data/lib/forme.rb +2 -2
- data/lib/roda/plugins/forme_set.rb +15 -3
- 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: e839ceeb815ddfe2d04fa1818ce83950f84508f83dee4c7db558f3f5c759c48d
|
|
4
|
+
data.tar.gz: 7620234a8222129d8e134c694bddff58a3e5a4cf0b2144fd23b74305feae7f49
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c287628f803ad6f2dec96356c12cade931e31b9560efc379f3a61393248336300b5e4935a0aa74b98ea5202e1050f31b05b84b2743529ce952cc4bada91a6e3
|
|
7
|
+
data.tar.gz: c0b53cf916ed4b392fa721d32f81abaa2ea73f18f848a66f8b8eeaa5196f3f1eb3835e7a67862a4183f2baf8aa9cd33f40faa9023296a16f45067947a9cb6918
|
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
=== 2.8.0 (2026-12-06)
|
|
2
|
+
|
|
3
|
+
* Format BigDecimal with absolute exponent over 20 using scientific notation (jeremyevans)
|
|
4
|
+
|
|
5
|
+
* Use Roda::RodaPlugins.opt_attr_reader if available for slight performance improvement (jeremyevans)
|
|
6
|
+
|
|
1
7
|
=== 2.7.0 (2025-09-16)
|
|
2
8
|
|
|
3
9
|
* Omit closing / for void element tags (only used previously for xhtml compliance) (jeremyevans)
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
|
@@ -1236,7 +1236,7 @@ This supports the following options:
|
|
|
1236
1236
|
|
|
1237
1237
|
The :default and :explicit labelers respect the following options:
|
|
1238
1238
|
|
|
1239
|
-
:label_position :: Can be set to :before or :after to place the label before or after the
|
|
1239
|
+
:label_position :: Can be set to :before or :after to place the label before or after the input.
|
|
1240
1240
|
:label_attr :: A hash of attributes to use for the label tag
|
|
1241
1241
|
|
|
1242
1242
|
=== +wrapper+
|
data/lib/forme/form.rb
CHANGED
data/lib/forme/version.rb
CHANGED
data/lib/forme.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Forme
|
|
|
11
11
|
begin
|
|
12
12
|
require 'erb/escape'
|
|
13
13
|
define_singleton_method(:h, ERB::Escape.instance_method(:html_escape))
|
|
14
|
-
# :
|
|
14
|
+
# simplecov:disable
|
|
15
15
|
rescue LoadError
|
|
16
16
|
begin
|
|
17
17
|
require 'cgi/escape'
|
|
@@ -32,7 +32,7 @@ module Forme
|
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
-
# :
|
|
35
|
+
# simplecov:enable
|
|
36
36
|
|
|
37
37
|
@default_add_blank_prompt = nil
|
|
38
38
|
@default_config = :default
|
|
@@ -13,7 +13,7 @@ class Roda
|
|
|
13
13
|
|
|
14
14
|
# Set the HMAC secret.
|
|
15
15
|
def self.configure(app, opts = OPTS, &block)
|
|
16
|
-
unless app.opts[:forme_set_hmac_secret] = opts[:secret] || app.
|
|
16
|
+
unless app.opts[:forme_set_hmac_secret] = opts[:secret] || app.forme_set_hmac_secret
|
|
17
17
|
raise RodaError, "must provide :secret option to forme_set plugin"
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -36,6 +36,18 @@ class Roda
|
|
|
36
36
|
:missing_namespace=>"no content in expected namespace"
|
|
37
37
|
}.freeze
|
|
38
38
|
|
|
39
|
+
module ClassMethods
|
|
40
|
+
if Roda::RodaPlugins.respond_to?(:opt_attr_reader)
|
|
41
|
+
Roda::RodaPlugins.opt_attr_reader(self, :forme_set_hmac_secret)
|
|
42
|
+
# simplecov:disable
|
|
43
|
+
else
|
|
44
|
+
def forme_set_hmac_secret
|
|
45
|
+
opts[:forme_set_hmac_secret]
|
|
46
|
+
end
|
|
47
|
+
# simplecov:enable
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
39
51
|
module InstanceMethods
|
|
40
52
|
# If a Sequel::Model object that supports forme_set is passed,
|
|
41
53
|
# isolate the inputs so that each form only includes metadata
|
|
@@ -139,7 +151,7 @@ class Roda
|
|
|
139
151
|
|
|
140
152
|
data = data.to_json
|
|
141
153
|
form.tag(:input, :type=>:hidden, :name=>:_forme_set_data, :value=>data)
|
|
142
|
-
form.tag(:input, :type=>:hidden, :name=>:_forme_set_data_hmac, :value=>OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA512.new, self.class.
|
|
154
|
+
form.tag(:input, :type=>:hidden, :name=>:_forme_set_data_hmac, :value=>OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA512.new, self.class.forme_set_hmac_secret, data))
|
|
143
155
|
end
|
|
144
156
|
end
|
|
145
157
|
end
|
|
@@ -152,7 +164,7 @@ class Roda
|
|
|
152
164
|
|
|
153
165
|
data = data.to_s
|
|
154
166
|
hmac = hmac.to_s
|
|
155
|
-
actual = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA512.new, self.class.
|
|
167
|
+
actual = OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA512.new, self.class.forme_set_hmac_secret, data)
|
|
156
168
|
unless Rack::Utils.secure_compare(hmac.ljust(64), actual) && hmac.length == actual.length
|
|
157
169
|
return _forme_parse_error(:hmac_mismatch, obj)
|
|
158
170
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Evans
|
|
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
238
238
|
- !ruby/object:Gem::Version
|
|
239
239
|
version: '0'
|
|
240
240
|
requirements: []
|
|
241
|
-
rubygems_version:
|
|
241
|
+
rubygems_version: 4.0.20
|
|
242
242
|
specification_version: 4
|
|
243
243
|
summary: HTML forms library
|
|
244
244
|
test_files: []
|