<commit_before>Adapter = require '../adapter_base'
path = require 'path'
fs = require 'fs'
W = require 'when'
UglifyJS = require 'uglify-js'

# TODO: add doctype and filter opts
# https://github.com/visionmedia/haml.js#extending-haml

class HAML extends Adapter

  constructor: (@compiler) ->
    @name = 'haml'
    @extensions = ['haml']
    @output = 'html'

  _render: (str, options) ->
    W.resolve @compiler.compile(str)(options)

  _compile: (str, options) ->
    W.resolve @compiler.compile(str, options)

  # client compile not yet supported, but when it is, this will be
  # the path to the right info
  clientHelpers: ->
    runtime_path = path.join(@compiler.__accord_path, 'haml.js')
    runtime = fs.readFileSync(runtime_path, 'utf8')
    return UglifyJS.minify(runtime, { fromString: true }).code

module.exports = HAML<commit_msg>comment out unused client helpers in haml adapter<commit_after>Adapter = require '../adapter_base'
path = require 'path'
fs = require 'fs'
W = require 'when'
UglifyJS = require 'uglify-js'

# TODO: add doctype and filter opts
# https://github.com/visionmedia/haml.js#extending-haml

class HAML extends Adapter

  constructor: (@compiler) ->
    @name = 'haml'
    @extensions = ['haml']
    @output = 'html'

  _render: (str, options) ->
    W.resolve @compiler.compile(str)(options)

  _compile: (str, options) ->
    W.resolve @compiler.compile(str, options)

  # clientHelpers: ->
  #   runtime_path = path.join(@compiler.__accord_path, 'haml.js')
  #   runtime = fs.readFileSync(runtime_path, 'utf8')
  #   return UglifyJS.minify(runtime, { fromString: true }).code

module.exports = HAML
{'fraction_non_alphanumeric': 0.13797313797313798, 'fraction_numerical': 0.001221001221001221, 'mean_word_length': 3.907185628742515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5290855', 'n_tokens_mistral': 557, 'n_tokens_neox': 542, 'n_words': 142}