Method: Pact::Doc::Markdown::InteractionRenderer#template_string

Defined in:
lib/pact/doc/markdown/interaction_renderer.rb

#template_string(template_file) ⇒ Object

The template file is written with only ASCII range characters, so we can read as UTF-8. But rendered strings must have same encoding as script encoding because it will joined to strings which are produced by string literal.



32
33
34
# File 'lib/pact/doc/markdown/interaction_renderer.rb', line 32

def template_string(template_file)
  File.read(template_contents(template_file), external_encoding: Encoding::UTF_8).force_encoding(__ENCODING__)
end