def with_extension(template, extension)
      if has_extension?(template, extension)
        template
      else
        [template, extension].join(".")
      end
    end
def with_extension(template, extension)
      if has_extension?(template, extension)
        template
      else
        [template, extension].join(".")
      end
    end
Internal: appends a given extension to the template file name, unless it is
 already present.

 template  - the template name.
 extension - the extension to be appended.

 Examples

   with_extension('template', 'erb')     # => 'template.erb'
   with_extension('template.erb', 'erb') # => 'template.erb'