Sha256: c0cb235507c94225ceacd83e937d3a45b394c1585d220003e503ee87f52027bc

Contents?: true

Size: 826 Bytes

Versions: 1

Compression:

Stored size: 826 Bytes

Contents

require 'slim'
require 'json'

module SourceRoute
  module Formats
    module Html

      def self.slim_render(proxy)

        template_path = File.expand_path "../html_semantic.slim", __FILE__
        slim_template = Slim::Template.new(template_path, pretty: true)

        filename = proxy.config.filename || "#{Time.now.strftime('%H')}-source-route.html"

        if proxy.config.import_return_to_call and proxy.config.has_call_and_return_event
          proxy.result_builder.import_return_value_to_call_chain
          proxy.result_builder.treeize_call_chain
        end
        # TODO: any exception triggered in render method will be absorb totally, how to fix it?
        html_output_str = slim_template.render(proxy.result_builder)
        File.write(filename, html_output_str)
      end

    end # END Html
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
source_route-0.6.0 lib/source_route/formats/html.rb