<commit_before># grunt-commoncoffee
# https://github.com/elentok/grunt-commoncoffee
# Copyright (c) 2013 <NAME>
# Licensed under the MIT license.

'use strict'

path = require 'path'
compile = require '../lib/compile'
helpers = require '../lib/helpers'

module.exports = (grunt) ->


  grunt.registerMultiTask 'commoncoffee', 'Compiles and combines coffeescript files', ->
    # Merge task-specific and/or target-specific options with these defaults.
    options = @options({
      separator: grunt.util.linefeed + grunt.util.linefeed,
      root: '.',
      runtime: true
      wrap: true
    })

    options.root = path.resolve(options.root)

    # Iterate over all specified file groups.
    this.files.forEach (fileObj) ->
      # The source files to be concatenated. The "nonull" option is used
      # to retain invalid files/patterns so they can be warned about.
      files = grunt.file.expand({nonull: true}, fileObj.src)

      # Concat specified files.
      src = files.map (filepath) ->
        # Warn if a source file/pattern was invalid.
        unless grunt.file.exists(filepath)
          grunt.log.error('Source file "' + filepath + '" not found.')
          return ''

        # Read file source.
        fullpath = path.resolve(filepath)
        moduleName = helpers.getModuleName(fullpath, options.root)
        source = compile(filepath)
        source = helpers.wrap(moduleName, source) if options.wrap
        source
      .join(options.separator)

      if options.runtime
        runtime = compile('lib/require_runtime.coffee', bare: false)
        src = runtime + grunt.util.linefeed + src
      src += grunt.util.linefeed

      # Write the destination file.
      grunt.file.write(fileObj.dest, src)

      # Print a success message.<commit_msg>bugfix: wrong require_runtime path<commit_after># grunt-commoncoffee
# https://github.com/elentok/grunt-commoncoffee
# Copyright (c) 2013 <NAME>
# Licensed under the MIT license.

'use strict'

path = require 'path'
compile = require '../lib/compile'
helpers = require '../lib/helpers'

module.exports = (grunt) ->


  grunt.registerMultiTask 'commoncoffee', 'Compiles and combines coffeescript files', ->
    # Merge task-specific and/or target-specific options with these defaults.
    options = @options({
      separator: grunt.util.linefeed + grunt.util.linefeed,
      root: '.',
      runtime: true
      wrap: true
    })

    options.root = path.resolve(options.root)

    # Iterate over all specified file groups.
    this.files.forEach (fileObj) ->
      # The source files to be concatenated. The "nonull" option is used
      # to retain invalid files/patterns so they can be warned about.
      files = grunt.file.expand({nonull: true}, fileObj.src)

      # Concat specified files.
      src = files.map (filepath) ->
        # Warn if a source file/pattern was invalid.
        unless grunt.file.exists(filepath)
          grunt.log.error('Source file "' + filepath + '" not found.')
          return ''

        # Read file source.
        fullpath = path.resolve(filepath)
        moduleName = helpers.getModuleName(fullpath, options.root)
        source = compile(filepath)
        source = helpers.wrap(moduleName, source) if options.wrap
        source
      .join(options.separator)

      if options.runtime
        require_runtime_path = path.resolve(__dirname, '../lib/require_runtime.coffee')
        runtime = compile(require_runtime_path, bare: false)
        src = runtime + grunt.util.linefeed + src
      src += grunt.util.linefeed

      # Write the destination file.
      grunt.file.write(fileObj.dest, src)

      # Print a success message.
{'fraction_non_alphanumeric': 0.10879693066593588, 'fraction_numerical': 0.0021923814743765417, 'mean_word_length': 2.686868686868687, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2819321', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1051, 'n_words': 295}