module Roda::RodaPlugins::RenderCoverage::ClassMethods

  1. lib/roda/plugins/render_coverage.rb

Methods

Public Instance

  1. create_template

Public Instance methods

create_template(opts, template_opts)

Set a compiled path on the created template, if the path for the template is in one of the allowed_views.

[show source]
   # File lib/roda/plugins/render_coverage.rb
52 def create_template(opts, template_opts)
53   template = super
54   return template if opts[:template_block]
55 
56   path = File.expand_path(opts[:path])
57   (self.opts[:render_coverage_strip_paths] || render_opts[:allowed_paths]).each do |dir|
58     if path.start_with?(dir + '/')
59       template.compiled_path = File.join(self.opts[:render_coverage_dir], path[dir.length+1, 10000000].gsub('/', '-'))
60       break
61     end
62   end
63 
64   template
65 end