hiccdown 1.2.1 → 1.3.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/lib/hiccdown/railtie.rb +4 -0
- data/lib/hiccdown.rb +10 -12
- 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: 2e16c613ff62cbd88fb53d8c57c4f9e4a89a06f498e8344fe67f6da3f82ada33
|
4
|
+
data.tar.gz: 0f32c9b93fde68cf68544fb10a0b1285c0799779245af8b2d91efc066342a248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 686df3dded370832f8d74169dd9fe54fce9ee45b8c9c30c89dd7dc8ab3d8876c9fbf205b37815ea08a133229c01fb091b26c6884126f3e52d7b0047d5b1f48d9
|
7
|
+
data.tar.gz: 0eb3af3931eb0b91484ea462399702c85fbb29649e3a38a52ac3c7266e5bd2ca43e4f5328fd398fc5775dd9a4099853330f5d759321a822a5c52f9c4801d0ccf
|
data/lib/hiccdown/railtie.rb
CHANGED
@@ -52,6 +52,10 @@ module Hiccdown
|
|
52
52
|
elsif options.key?(:action) || args.first.is_a?(Symbol) || (args.first.is_a?(String) && !args.first.include?('/'))
|
53
53
|
action_name = options[:action] || args.first.to_s
|
54
54
|
render_helper_method(action_name, options)
|
55
|
+
# When a template is given but doesn’t exist. Useful for gems like High Voltage
|
56
|
+
elsif options.key?(:template) && !view_context.lookup_context.template_exists?(options[:template])
|
57
|
+
action_name = options[:template].split('/').last
|
58
|
+
render_helper_method(action_name, options)
|
55
59
|
# Partials, files and all other cases
|
56
60
|
else
|
57
61
|
original_render(*args, options)
|
data/lib/hiccdown.rb
CHANGED
@@ -14,19 +14,17 @@ module Hiccdown
|
|
14
14
|
|
15
15
|
module MethodOverrides
|
16
16
|
def self.prepended(base)
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
result.is_a?(Array) ? Hiccdown::to_html(result).html_safe : result
|
26
|
-
end
|
27
|
-
else
|
28
|
-
super(*args, **kwargs)
|
17
|
+
# `capture` is at the root of seemingly all Rails methods tasked with
|
18
|
+
# rendering content, including `content_tag` and `tag`, which in turn
|
19
|
+
# are used for `link_to`, `form_for`, etc.
|
20
|
+
define_method(:capture) do |*args, **kwargs, &block|
|
21
|
+
if block
|
22
|
+
super(*args, **kwargs) do |*brgs, **jwargs|
|
23
|
+
result = block.call(*brgs, *jwargs)
|
24
|
+
result.is_a?(Array) ? Hiccdown::to_html(result).html_safe : result
|
29
25
|
end
|
26
|
+
else
|
27
|
+
super(*args, **kwargs)
|
30
28
|
end
|
31
29
|
end
|
32
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiccdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Hackethal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Generates an HTML string from a Hiccup structure and improves Rails views.
|
14
14
|
email: engineering@dennishackethal.com
|