Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebyx07 committed Aug 10, 2024
1 parent a1781a6 commit 270628e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/gem/ruby2html/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def call(template, source)
#{source}
end
Thread.current[:__ruby2html_renderer__] = renderer
renderer.render_from_rails(#{template.identifier.inspect})
renderer.__render_from_rails(#{template.identifier.inspect})
ensure
Thread.current[:__ruby2html_renderer__] = previous_renderer
end
Expand Down
7 changes: 3 additions & 4 deletions lib/gem/ruby2html/render.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initialize(context, &root)
@current_output = @output
end

def render_from_rails(template_path)
def __render_from_rails(template_path)
result = render
return result unless annotate_rendered_view_with_filenames?

Expand All @@ -45,9 +45,8 @@ def render(*args, **options, &block)
end
instance_exec(&@root)
result = @output.string
if defined?(ActiveSupport)
result = ActiveSupport::SafeBuffer.new(result)
end

result = ActiveSupport::SafeBuffer.new(result) if defined?(ActiveSupport)

result
end
Expand Down

0 comments on commit 270628e

Please sign in to comment.