Sha256: 108a9aaddac439efc85da01d14ca459559c1afe04971abeed2b5bc0d3388ca98

Contents?: true

Size: 1.82 KB

Versions: 62

Compression:

Stored size: 1.82 KB

Contents

// Generated by CoffeeScript 1.8.0
(function() {
  var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, loadFile, path, _i, _len, _ref;

  CoffeeScript = require('./coffee-script');

  child_process = require('child_process');

  helpers = require('./helpers');

  path = require('path');

  loadFile = function(module, filename) {
    var answer;
    answer = CoffeeScript._compileFile(filename, false);
    return module._compile(answer, filename);
  };

  if (require.extensions) {
    _ref = CoffeeScript.FILE_EXTENSIONS;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      ext = _ref[_i];
      require.extensions[ext] = loadFile;
    }
    Module = require('module');
    findExtension = function(filename) {
      var curExtension, extensions;
      extensions = path.basename(filename).split('.');
      if (extensions[0] === '') {
        extensions.shift();
      }
      while (extensions.shift()) {
        curExtension = '.' + extensions.join('.');
        if (Module._extensions[curExtension]) {
          return curExtension;
        }
      }
      return '.js';
    };
    Module.prototype.load = function(filename) {
      var extension;
      this.filename = filename;
      this.paths = Module._nodeModulePaths(path.dirname(filename));
      extension = findExtension(filename);
      Module._extensions[extension](this, filename);
      return this.loaded = true;
    };
  }

  if (child_process) {
    fork = child_process.fork;
    binary = require.resolve('../../bin/coffee');
    child_process.fork = function(path, args, options) {
      if (helpers.isCoffee(path)) {
        if (!Array.isArray(args)) {
          options = args || {};
          args = [];
        }
        args = [path].concat(args);
        path = binary;
      }
      return fork(path, args, options);
    };
  }

}).call(this);

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
smock-0.1.268 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.267 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.266 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.265 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.264 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.263 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.262 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.261 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.260 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.259 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.258 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.256 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.255 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.254 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.253 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.252 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.251 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.250 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.249 node_modules/coffee-script/lib/coffee-script/register.js
smock-0.1.247 node_modules/coffee-script/lib/coffee-script/register.js