ruby2html 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/first_component.rb +4 -0
- data/app/components/third_component/third_component.html.rb +3 -0
- data/app/views/home/rb_files.html.rb +3 -0
- data/app/views/shared/_footer.html.rb +3 -0
- data/lib/gem/ruby2html/railtie.rb +2 -2
- data/lib/gem/ruby2html/render.rb +14 -0
- data/lib/gem/ruby2html/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb194a11e2015f7caf7e2994f5db0c67fa9b8967c2e44906b3a036aba9eb1be6
|
4
|
+
data.tar.gz: e60ff3a75bc735e3b084d0f3b91503f151564f3c9d82c9721e8dbc281d6c2283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bea7e7d8965f80fdf3aed3f92ecbc49f14630da3e832dae868836cfdcf1f60f8a439e3a82c850586462fa68adb3a39dcc58d35821a7b9554e3df8e8115083a33
|
7
|
+
data.tar.gz: ba619ce95c33e4d96579bc4f423b2554a75160d11102d9f55dee7632ad7eb63d3e20bd21c3aaee4402a861e9f2e5b8a20aa08c03e3086654dec71072d42ff0f7
|
@@ -9,7 +9,7 @@ module Ruby2html
|
|
9
9
|
new.call(template, source)
|
10
10
|
end
|
11
11
|
|
12
|
-
def call(
|
12
|
+
def call(template, source)
|
13
13
|
<<-RUBY
|
14
14
|
begin
|
15
15
|
previous_renderer = Thread.current[:__ruby2html_renderer__]
|
@@ -17,7 +17,7 @@ module Ruby2html
|
|
17
17
|
#{source}
|
18
18
|
end
|
19
19
|
Thread.current[:__ruby2html_renderer__] = renderer
|
20
|
-
renderer.
|
20
|
+
renderer.render_from_rails(#{template.identifier.inspect})
|
21
21
|
ensure
|
22
22
|
Thread.current[:__ruby2html_renderer__] = previous_renderer
|
23
23
|
end
|
data/lib/gem/ruby2html/render.rb
CHANGED
@@ -28,6 +28,15 @@ module Ruby2html
|
|
28
28
|
@current_output = @output
|
29
29
|
end
|
30
30
|
|
31
|
+
def render_from_rails(template_path)
|
32
|
+
result = render
|
33
|
+
return result unless annotate_rendered_view_with_filenames?
|
34
|
+
|
35
|
+
template_path = template_path.sub("#{Rails.root}/", '')
|
36
|
+
|
37
|
+
"<!-- BEGIN #{template_path} -->#{result}<!-- END #{template_path} -->".html_safe
|
38
|
+
end
|
39
|
+
|
31
40
|
def render(*args, **options, &block)
|
32
41
|
set_instance_variables
|
33
42
|
|
@@ -135,6 +144,11 @@ module Ruby2html
|
|
135
144
|
CGI.escapeHTML(text.to_s)
|
136
145
|
end
|
137
146
|
|
147
|
+
def annotate_rendered_view_with_filenames?
|
148
|
+
return @annotate_rendered_view_with_filenames if defined?(@annotate_rendered_view_with_filenames)
|
149
|
+
@annotate_rendered_view_with_filenames = Rails.application.config.action_view.annotate_rendered_view_with_filenames
|
150
|
+
end
|
151
|
+
|
138
152
|
def set_instance_variables
|
139
153
|
@context.instance_variables.each do |name|
|
140
154
|
instance_variable_set(name, @context.instance_variable_get(name))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sebi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby2HTML empowers developers to write view logic in pure Ruby, seamlessly
|
14
14
|
converting it into clean, well-formatted HTML. Enhance your templating workflow,
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- app/views/layouts/mailer.text.erb
|
57
57
|
- app/views/pwa/manifest.json.erb
|
58
58
|
- app/views/pwa/service-worker.js
|
59
|
+
- app/views/shared/_footer.html.rb
|
59
60
|
- app/views/shared/_navbar.html.erb
|
60
61
|
- config.ru
|
61
62
|
- config/application.rb
|