class Liquid::LocalFileSystem

def full_path(template_path)

def full_path(template_path)
  raise FileSystemError, "Illegal template name '#{template_path}'" unless %r{\A[^./][a-zA-Z0-9_/]+\z}.match?(template_path)
  full_path = if template_path.include?('/')
    File.join(root, File.dirname(template_path), @pattern % File.basename(template_path))
  else
    File.join(root, @pattern % template_path)
  end
  raise FileSystemError, "Illegal template path '#{File.expand_path(full_path)}'" unless File.expand_path(full_path).start_with?(File.expand_path(root))
  full_path
end