hiccdown 1.0.0 → 1.0.2
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/lib/hiccdown.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64551490e829c994604d8263e8943e51602c13c47e135ee6eea2fbc7561fa775
|
4
|
+
data.tar.gz: 2d5000b0185dcc0d68b088a1d410d535218073a3b01eda0c4d2bc8f9bc5b7977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283b2b5535a75bb2f89d6f7de91f320e6ac2d4bae2eaca2ba5c6b86d7632e9289cc23963f18e3cefccc0a423e68ff3af7ced713dad1a57c151c34754a0517f27
|
7
|
+
data.tar.gz: 0220a63cc1274beb081158b322f29aee1a23f7dc04292557364d97b6eaa1fbd42f59b72da5dab5f39df2affe829c9e86733044385f49e6afcac9c9af742b2ff5
|
data/lib/hiccdown.rb
CHANGED
@@ -11,15 +11,17 @@ module Hiccdown
|
|
11
11
|
module MethodOverrides
|
12
12
|
def self.prepended(base)
|
13
13
|
# button_to and link_to use content_tag internally so need no explicit mention.
|
14
|
-
|
15
|
-
|
14
|
+
# TODO: form_for and form_with use `tag` (https://apidock.com/rails/ActionView/Helpers/TagHelper/tag)
|
15
|
+
# Any way to override that instead?
|
16
|
+
[:content_tag, :form_for, :form_with].each do |method_name|
|
17
|
+
define_method(method_name) do |*args, **kwargs, &block|
|
16
18
|
if block
|
17
|
-
super(*args) do |*brgs|
|
18
|
-
result = block.call(*brgs)
|
19
|
+
super(*args, **kwargs) do |*brgs, **jwargs|
|
20
|
+
result = block.call(*brgs, *jwargs)
|
19
21
|
result.is_a?(Array) ? Hiccdown::to_html(result).html_safe : result
|
20
22
|
end
|
21
23
|
else
|
22
|
-
super(*args)
|
24
|
+
super(*args, **kwargs)
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|