示例#1
0
var requirejs = require("requirejs");

requirejs.config({
    // node のモジュールはそのまま
    nodeRequire: require,
    // spec 実行時に __dirname が spec のパスにかわるため
    // ちゃんとやるなら require('path') で絶対パス求めたほうがいいかも
    baseUrl: __dirname + './lib'
});

var path = require('path');
module.paths.push(path.resolve(path.join('lib')));
示例#2
0
module.exports = function(options) {
  var configPath = options.configPath;
  var config = options.config || {};
  var depPath = options.partial;
  var filename = options.filename;

  debug('config: ', config);
  debug('partial: ', depPath);
  debug('filename: ', filename);
  debug('directory: ', options.directory);

  if (typeof config === 'string') {
    configPath = path.dirname(config);
    config = module.exports._readConfig(config);
    debug('converting given config file ' + configPath + ' to an object:\n', config);
  }

  if (configPath && !fs.statSync(configPath).isDirectory()) {
    configPath = path.dirname(configPath);
  }

  debug('configPath: ', configPath);

  if (!config.baseUrl) {
    config.baseUrl = './';
    debug('set baseUrl to ' + config.baseUrl);
  }

  delete config.urlArgs;
  var resolutionDirectory;

  if (options.directory && depPath[0] !== '.') {
    resolutionDirectory = options.directory;
    debug('module resolution directory (based on directory): ' + resolutionDirectory);

  } else if (configPath) {
    resolutionDirectory = configPath;
    debug('module resolution directory (based on configPath): ' + resolutionDirectory);

  } else {
    resolutionDirectory = path.dirname(options.filename);
    debug('module resolution directory (based on filename): ' + resolutionDirectory);
  }

  if (config.baseUrl[0] === '/') {
    debug('baseUrl with a leading slash detected');
    resolutionDirectory = resolutionDirectory.replace(config.baseUrl, '');
    debug('new resolution directory: ' + resolutionDirectory);
  }

  requirejs.config(config);

  depPath = stripLoader(depPath);

  var normalizedModuleId = requirejs.toUrl(depPath + '.fake');
  normalizedModuleId = normalizedModuleId.substring(0, normalizedModuleId.length - 5);

  var resolved = path.join(resolutionDirectory, normalizedModuleId);

  debug('depPath: ' + depPath);
  debug('normalized module id: ' + normalizedModuleId);
  debug('resolved url: ' + resolved);

  // No need to search for a file that already has an extension
  // Need to guard against jquery.min being treated as a real file
  if (path.extname(resolved) && fileExists(resolved)) {
    debug(resolved + ' already has an extension and is a real file');
    return resolved;
  }

  var foundFile = findFileLike(normalizedModuleId, resolved) || '';

  if (foundFile) {
    debug('found file like ' + resolved + ': ' + foundFile);
  } else {
    debug('could not find any file like ' + resolved);
  }

  return foundFile;
};
示例#3
0
require("../../env");

var requirejs = require('requirejs'),
    config    = require('../../requirejs-config'),
    vows = require("vows"),
    assert = require("assert");

// Use Lab RequireJS configuration.
requirejs.config(config.labConfig);

requirejs([
  'cs!common/components/thermometer'
], function (Thermometer) {

  var suite = vows.describe("common/components");

  suite.addBatch({
    "Thermometer": {
      topic: function() {
        return new Thermometer("#thermometer", 3.0, 0, 25);
      },
      "creates thermometer": function(therm) {
        assert.equal(therm.max, 25);
        assert.equal(therm.min, 0);
        assert.equal(therm.value, 3);
      }
    }
  });

  suite.export(module);
});
示例#4
0
#!/usr/bin/env node
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */
var assert = require('assert');
var fs = require('fs');
var path = require('path');
var requirejs = require('requirejs');

requirejs.config({
  paths: {
    'source-map': '../lib/source-map'
  },
  nodeRequire: require
});

requirejs(['./source-map/util'], function (util) {

  function run(tests) {
    var failures = [];
    var total = 0;
    var passed = 0;

    for (var i = 0; i < tests.length; i++) {
      for (var k in tests[i].testCase) {
        if (/^test/.test(k)) {
          total++;
          try {
示例#5
0
var assert = require("assert");
var seedrandom = require("../seedrandom");
var requirejs = require("requirejs");
requirejs.config({
  baseUrl: __dirname
});

describe("Nodejs API Test", function() {

it('should pass basic tests.', function() {
  var original = Math.random,
      result, r, xprng, obj, as2, as3, autoseed1, myrng,
      firstprng, secondprng, thirdprng;

  result = Math.seedrandom('hello.');
  firstprng = Math.random;
  assert(original !== firstprng, "Should change Math.random.");
  assert.equal(result, "hello.", "Should return short seed.");
  r = Math.random();
  assert.equal(r, 0.9282578795792454, "Should be 'hello.'#1");
  r = Math.random();
  assert.equal(r, 0.3752569768646784, "Should be 'hello.'#2");

  // should be able to autoseed
  result = Math.seedrandom();
  secondprng = Math.random;
  assert(original !== secondprng, "Should change Math.random.");
  assert(firstprng !== secondprng, "Should change Math.random.");
  assert.equal(result.length, 256, "Should return short seed.");
  r = Math.random();
  assert(r > 0, "Should be posititive.");
示例#6
0
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

 "use strict";


var debug           = require('debug')('hftgame-client');
var path            = require('path');
var Promise         = require('promise');
var requirejs       = require('requirejs');
var WebSocketClient = require('../lib/websocketclient');

requirejs.config({
  nodeRequire: require,
  paths: {
    hft: path.join(__dirname, '../public/hft/0.x.x/scripts'),
  },
});

var HFTGameClient = function(options) {
  options = options || {};
  var GameClient = requirejs('hft/gameclient');
  var wsclient = options.socket || new WebSocketClient({url: "ws://localhost:18679"});
  var client = new GameClient({
    gameId: "__hft__",
    socket: wsclient,
    quiet: true,
  });

  var noop = function() { };
  client.addEventListener('hftInfo', noop);
        if(isArray(callback)){
          retVal = requirejsOrig(deps, callback, arguments[2]);
        } else {
          retVal = requirejsOrig(deps, [], callback);
        }
      } else {
        retVal = requirejsOrig(deps, callback);
      }

      return retVal;
    };

requirejsOrig.config({
 baseUrl: __dirname, //baseUrl,
 nodeRequire: require,
 paths: {
  cs: csPath
 }
});

for(var key in requirejsOrig) {
  requirejs[key] = requirejsOrig[key];
}

requirejs.config = function(config){
  var alteredConfig = {};

  for(var key in config) {
    alteredConfig[key] = config[key];
  }
示例#8
0
文件: main.js 项目: sanwu/blog

var requirejs = require('requirejs');

requirejs.config({
    //把node自身的require方法传递给requirejs
    nodeRequire: require
});

requirejs(["./build/server.js"], function () { 
    requirejs(['src/server/server'],function(){
        
    })
});


示例#9
0
文件: app.js 项目: goofyahead/gorrass
var requirejs = require('requirejs');

requirejs.config({
    //Pass the top-level main.js/index.js require
    //function to requirejs so that node modules
    //are loaded relative to the top-level JS file.
    baseUrl: __dirname,
    nodeRequire: require
});

requirejs(['server','jquery'],function(server, $) {
	$(function(){
		var port = process.env.PORT || 5000;
	  	server.listen(port);
	  	console.log('Listening on port ' + port);
  	});
});

示例#10
0
		JSincludes.push('nwlibs.js')
	}

	JSincludes.push('all-classes.js')

	CSSincludes.push('resources/spellEd-all.css');
}


if( isNWRuntime ) {
	// use require.js in node.js mode
	var requirejs   = require( 'requirejs' ),
		define  = requirejs.define

	requirejs.config( {
		baseUrl: '../public/lib',
		nodeRequire: require
	} )

	window.requirejs = requirejs

	//Maximize window
	var gui = require('nw.gui'),
	    win = gui.Window.get();

    win.maximize();
    win.show();

	loadSpellEd()

} else {
	// use require.js in browser mode
var restify = require('restify')
  , Logger = require('bunyan')
  , util = require('util')
  , requirejs = require('requirejs')
  , uuid = require('uuid')
  , fs = require('fs')
  , Engine = null
  , TaskDb = null
;

requirejs.config({
  baseUrl: __dirname + '/../',
  name: 'bpmn',
  nodeRequire: require
});

// Creating GLOBALS to replace the window and DOMParser objects 
// you would get in a browser

CAM = null; // require of engine creates global CAM

DOMParser = require('xmldom').DOMParser;
window = {
  DOMParser : DOMParser
};

requirejs(["bpmn/Engine"], function (engineModule) {
  Engine = engineModule;
});

fs.readFile('data/tasks.json', 'utf8', function (err,data) {
示例#12
0
var requirejs=require("requirejs");requirejs.config({nodeRequire:require}),requirejs({paths:{tpl:"../../tpl"}},["tpl!hello.tpl"],function(e){console.log(e({world:"Worrrrrld"}))});
示例#13
0
var requirejs = require('requirejs');

requirejs.config({
    baseUrl: ".",
    paths: {
        'jsunzip': 'lib/jsunzip',
        'underscore': 'lib/underscore-min',
        'test': 'tests/test'
    }
});

requirejs(['video', 'soundchip', '6502', 'utils', 'models'],
    function (Video, SoundChip, Cpu6502, utils, models) {
        "use strict";

        var paint = function () {
        };
        var video = new Video(new Uint32Array(1280 * 1024), paint);
        var soundChip = new SoundChip(10000);
        var dbgr = { setCpu: function () {
        } };

        function runTest(processor, test, name) {
            var data = utils.loadData("tests/6502_65C02_functional_tests/bin_files/" + test + ".bin");
            for (var i = 0; i < data.length; ++i)
                processor.writemem(i, data[i]);
            processor.pc = 0x400;
            var log = false;
            processor.debugInstruction = function (addr, opcode) {
                if (log) {
                    console.log(utils.hexword(addr) + " : " + utils.hexbyte(processor.a) + " : " + processor.disassembler.disassemble(processor.pc)[0]);
示例#14
0
var requirejs = require("requirejs"),
	assert = require("assert");

requirejs.config({
	baseUrl: __dirname,
	nodeRequire: require,
	paths: {
		"genius": "./"
	}
});

suite("Garbago", function (done) {
	setup(function (done) {
		console.log("setting up");
		requirejs([
			"utils/spec/array",
			"utils/spec/fs",
			"utils/spec/deferred",
			"mvc/view/adapters/client/nodes/spec/Node",
			"mvc/view/adapters/client/nodes/spec/Document",
			"mvc/view/adapters/client/factories/spec/Node",
			"mvc/view/adapters/client/factories/spec/Document",
			"mvc/view/adapters/client/factories/spec/Attribute",
			"mvc/view/adapters/client/factories/spec/Html"
			], function () {
			done();
		});
	});

	suite("blah", function () {
		test("blargh", function () {
示例#15
0
var requirejs = require('requirejs');
requirejs.config({
	baseUrl: 'public/javascripts', 
	nodeRequire: require
}); 
 
requirejs(['app/card', 'app/rank'], function(Card, Rank){ 
	exports['Card equals'] = function(test){
		test.ok(Card.heart(Rank.QUEEN).equals(Card.heart(Rank.QUEEN)));
		test.ok(Card.smallJoker().equals(Card.smallJoker()));
		test.ok(Card.club(Rank.TWO).equals(Card.club(Rank.TWO)));

		test.ok(!Card.smallJoker().equals(Card.bigJoker()));
		test.ok(!Card.club(Rank.TWO).equals(Card.club(Rank.THREE)));

		test.done();
	};

	exports["Card isSmallJoker or isBigJoker or isRedSuit or isBlackSuit"] = function(test){
		test.ok(Card.heart(Rank.JACK).isRedSuit());
		test.ok(!Card.heart(Rank.JACK).isBlackSuit());
		test.ok(!Card.heart(Rank.JACK).isSmallJoker());

		test.ok(Card.smallJoker().isSmallJoker());
		test.ok(!Card.heart(Rank.JACK).isSmallJoker());
		test.ok(!Card.bigJoker().isSmallJoker());

		test.ok(!Card.smallJoker().isBigJoker());
		test.ok(!Card.heart(Rank.JACK).isBigJoker());
		test.ok(Card.bigJoker(Rank.JACK).isBigJoker());
示例#16
0
(function () {
    'use strict';

    var define = require('amdefine')(module);

    var requirejs = require('requirejs');
    requirejs.config(require('./require.js'));

    var deps = [
        './apps/default',
        './modules/cli',
        './modules/core',
        './modules/config',
        './modules/etl',
        './modules/logger',
        './modules/mongo',
        './modules/utils',
        './modules/webapp',
        'deferred',
        'dependable',
        'util',
        'path'
    ];

    define(deps, function (DefaultApp, Cli, Core, Config, Etl, Logger, Mongo, Utils, Webapp, deferred, dependable, util, path) {
        ///*
        var resolver = dependable.container();

        // Load Command Line Interface Module
        var cli = new Cli(resolver);

        resolver.register('cli', cli);

        // Setup CLI options
        cli.args()
            .usage('Simple Microscratch Application.\nUsage: $0')
            .describe('a, app', 'Application run')
            .default('a, app', "apps/default")
            .describe('h, help', 'Show Help')
            .describe('c, config', 'Config file')
            .default('c, config', path.join(__dirname, './config'))
            .describe('e, env', 'Specify environment')
            .default('e, env', 'local')
            .describe('o, option', 'Override option (name=value, server.port=1234)')
            .describe('v, verbose', 'Verbose output');

        var args = cli.args();
        var argv = args.argv;

        if (argv.v || argv.verbose) {
            console.log("Parsed options: " + JSON.stringify(argv, null, 4));
        }

        if (argv.h || argv.help) {
            console.log(args.help());
            return;
        }

        var config = new Config();
        config.load(path.join(__dirname, 'config.js'), argv.e || argv.evn || "local");

        resolver.register('config', config);

        var logger = new Logger(resolver);
        resolver.register('logger', logger);

        if (argv.v || argv.verbose) {
            config.verbose = true;
        }

        var mongo = new Mongo(resolver);
        resolver.register('mongo', mongo);

        if(config.verbose) {
            logger.log("Config loaded: " + JSON.stringify(config, null, 4));
        }

        var App = DefaultApp;
        var appPath = argv.a || argv.app || "apps/default";
        if(appPath) {
            App = require(path.join(__dirname, appPath));

            // TODO: Load and merge application specific config too
        }

        // Create app instance
        var app = new App(resolver);
        app.run().done(function() {
            logger.log("Application '" + config.app.name + "' is running!");
        }, function(err) {
            throw err;
        });

        //*/
    });
}());
示例#17
0
var requirejs = require('requirejs');

//Config for libraries accessible and require js
var app_config = requirejs('./config');
app_config.baseUrl = 'app/';
app_config.nodeRequire = require;
requirejs.config(app_config);

//Command line args
var argv = require('optimist').argv;
var environment = process.env.NODE_ENV || argv.env || 'development';

//GLOBALS:

//- setting server $ stuff
var backbone = require('backbone'),
    XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;

var $ = global.$ = backbone.$ = global.jQuery = require('jquery');
$.support.cors = true;

$.ajaxSettings.xhr = function () {
  return new XMLHttpRequest();
};

//- the rest
global.isServer = true;
global.isClient = false;

global._ = require('underscore');
global.config = requirejs('environment_config').configure(environment, argv);
示例#18
0
var should = require("should"),
    requirejs = require('requirejs');

requirejs.config({
    baseUrl: 'pulsr',
    nodeRequire: require
});

describe('Pulsr', function (){
    describe('fileHandler', function (){
        describe('js.js', function (){
            it('should return 200 statusCode for all JS file requests within 20s', function (done){
                // set timeout to 20s
                this.timeout(20000);

                requirejs(['async', 'fs', 'path', 'module', 'http', 'conf'], function (async, fs, path, module, http, conf) {
                    // a list of directories to search for JS files
                    var jsDirs = ['js', 'js/libs', 'js/libs/bootstrap', 'js/libs/foundation'];

                    function traverseDir(dirName, done) {
                        var dirPath = path.join(path.dirname(path.resolve(module.uri)), '../', dirName);

                        function requestFile(fileName, done) {
                            if (/.+\.js/.test(fileName)) {
                                var filePath = path.join(dirPath, fileName);

                                fs.stat(filePath, function (err, stat) {
                                    if (err) {
                                        throw err;
                                    }
                                    else if (stat.isFile()){
示例#19
0
'use strict';

var requirejs = require('requirejs');

requirejs.config({
  nodeRequire: require,
  baseUrl: __dirname + '/app'
});

requirejs([
  'conf',
  'express',
  'twitter',
  'socket.io'
], function (
  conf,
  express,
  Twitter,
  socketio
) {

  var app     = module.exports = express(),
      server  = app.listen(process.env.PORT || conf.port),
      io      = socketio.listen(server);

  // Twitter Credentials
  var twit = new Twitter(conf.twitter);

  // Static files
  app.use(express.static(__dirname + '/public'));
示例#20
0
var requirejs = require("requirejs"),
    expect = require("chai").expect;

requirejs.config(require("./requireConfig.js"));

describe("ConfigStateMachine", function () {
  var StateMachine, ConfigStateMachine;

  it("should load AMD module", function (done) {
    requirejs(["stateMachine", "configStateMachine"], function (_StateMachine, _ConfigStateMachine) {
      StateMachine = _StateMachine;
      ConfigStateMachine = _ConfigStateMachine;
      done();
    });
  });

  it("should emit a valid transition", function(done) {
    var stateMachine = ConfigStateMachine(function (transition) {
      expect(transition.v).to.equal(1);
      done();
    });
    stateMachine.execute({
      u: 0,
      v: 1
    });
  });
  
  it("should execute a transition that creates a component", function() {
    var machine = ConfigStateMachine();

    machine.execute({
示例#21
0
/*jslint nomen: true*/
/*global module: true, __dirname: true*/

var requirejs = require('requirejs');

requirejs.config({
    //Use node's special variable __dirname to
    //get the directory containing this file.
    //Useful if building a library that will
    //be used in node but does not require the
    //use of node outside
    baseUrl: __dirname,

    //Pass the top-level main.js/index.js require
    //function to requirejs so that node modules
    //are loaded relative to the top-level JS file.
    nodeRequire: require
});

// export JSXGraph, the ../build/core.deps.js module returns a reference to JXG
module.exports = requirejs(__dirname + '/../build/core.deps.js');
示例#22
0
文件: main.js 项目: rucka/cqrjs
"use strict";

var requireJs = require('requirejs');

requireJs.config({
    baseUrl: require('path').join(__dirname, 'lib'),
    nodeRequire: require
});

module.exports = requireJs('loader');
示例#23
0
#!/usr/bin/env node

var requirejs = require('requirejs');

requirejs.config({
    baseUrl: 'js'
});

requirejs(["eu/save", "eu/save_reader", "../tests/test"], function main(Save, reader, Test) {
    reader.from_local_file("tests/samples/cardinals.eu4", function assert_res(err, save) {
        if(err) {
            console.error(err);
            return;
        }

        var root = save.root;

        Test.assertEquals(root.name, undefined, "Root section has not an undefined name.");
        Test.assertEquals(root.elements_order.length, 4);
        Test.assertEquals(root.elements['papacy'].elements['papal_state'], "PAP");
        Test.assertEquals(root.elements['papacy'].elements['controller'], 'POR');
        Test.assertEquals(root.elements['papacy'].elements['crusade_target'], 'TUR');
        Test.assertEquals(root.elements['papacy'].elements['crusade_start'], '1577.1.7');
        Test.assertEquals(root.elements['papacy'].elements['last_excom'], '1463.11.7');
        Test.assertEquals(root.elements['papacy'].elements['papacy_active'], 'yes');
        Test.assertEquals(root.elements['papacy'].elements['weighted_cardinal'], '2');
        Test.assertEquals(root.elements['papacy'].elements['reform_desire'], '1.325');

        var cardinals = root.elements['papacy'].elements['active_cardinals'].elements['cardinal'];
        Test.assertEquals(cardinals.length, 3);
        Test.assertEquals(cardinals[0].elements['name'], "de Champmartin");
示例#24
0
var requirejs = require('requirejs');
requirejs.config({
  nodeRequire: require
//  baseUrl: 'js'
});

//make define available globally like it is in the browser
global.define = require('requirejs');

//make jasmine available globally like it is in the browser
// global.describe = require('./lib/jasmine-1.1.0.rc1/jasmine').describe;
// global.it = require('./lib/jasmine-1.1.0.rc1/jasmine').it;
// global.expect = require('./lib/jasmine-1.1.0.rc1/jasmine').expect;
global.describe = require('./vendor/jasmine-1.2.0/jasmine').describe;
global.it = require('./vendor/jasmine-1.2.0/jasmine').it;
global.expect = require('./vendor/jasmine-1.2.0/jasmine').expect;
global.beforeEach = require('./vendor/jasmine-1.2.0/jasmine').beforeEach;


//bring in and list all the tests to be run
requirejs(
    [
      './spec/lib/building_board.spec',
      './spec/lib/playing_board.spec',
      './spec/lib/infochess.spec',
      './spec/lib/helper.spec'
    ],
    function() {
  for (var i = 0; i < arguments.length; i++) {
    console.log('Running spec: '+ arguments[i].name);
  }
示例#25
0
文件: hi.js 项目: cocheok/bower_grunt
var requirejs = require('requirejs'); //librería para usar el requirejs del cliente en nodejs
var should = require('should'); //librería de asserts

requirejs.config({
    baseUrl    : 'src',
    nodeRequire: require,
    paths      : {
        test: '../dist/test.min'
    }
});
describe('hi', function() {
    var Test;
    before(function(done) {

        requirejs(['test'], function(_Test) {
                Test = _Test;
                done();
            }
        );
    });
    it('#hi', function() {
        var test   = new Test();
        var result = test.hi();
        result.should.equal("Demo Bower+Grunt por grupo 3");
    });

});

示例#26
0
var requirejs = require('requirejs');

requirejs.config({
  baseUrl: __dirname,
  nodeRequire: require,
  paths: {
    lib: "./lib",
    server: "./server",
    underscore: "./vendor/underscore"
  }
});

Raven = require('raven');

requirejs(['./lib/raven/bridge'], function(Ravenbridge) {

  ic = Raven.init(Ravenbridge);

  ic.configure({
    send_index: function(request, response) {
      response.sendfile('/index.html', { root: __dirname });
    },
    send_asset: function(request, response, path) {
      response.sendfile(path, { root: __dirname });
    }
  });

  ic.run();

});
示例#27
0
var requirejs = require("requirejs");

requirejs.config({
    baseUrl: "src",
    nodeRequire: require
});

requirejs(["GameServer", "express", "config", "Error", "underscore", "fs"], function(GameServer, express, config, Error, _, fs) {
    var server = new GameServer(),
        app = express(),
        returnErrorAndModel = function (res, error, model) {
             if (Error.isModelNotFound(error)) {
                res.send(404);
             } else {
                 res.json(500, {
                     model: model,
                     error: error
                 });
            }
            res.end();
        },
        returnModel = function (res, model) {
            res.json(200, model);
            res.end();
        };

    app.use(express.bodyParser());
    app.configure(function() {
        app.use("/content", express.static(__dirname + "/content"));
        app.use("/scripts", express.static(__dirname + "/scripts"));
        app.use("/src", express.static(__dirname + "/src"));
示例#28
0
var requirejs = require('requirejs');


requirejs.config({
    baseUrl: "/Users/Emil/Documents/Webb/continuous/",
    paths: {
        // List of all Continuous packages
        'quack':                 './lib/quack',
        'jquery':                './lib/jquery-2.0.3.min',
        'kalkyl':                './kalkyl/package',
        'kalkyl/format':         './kalkyl/format/package',
        'kalkyl/format/simple':  './kalkyl/format/simple/package',
        'kalkyl/format/sage':    './kalkyl/format/sage/package',
        'communication':         './communication/package',
        'communication/client':  './communication/client/package',
        'mathgl':                './mathgl/package'
    }
});


requirejs.config({
    nodeRequire: require
});


var modules = [
    './test/kalkyl/basic.spec.js',
    './test/kalkyl/topologicalSorter.spec.js',
    './test/mathgl/node.spec.js'

];
示例#29
0
var requirejs = require('requirejs');

requirejs.config({
  nodeRequire: require
});

var linkify = requirejs('../public/javascripts/linkify');
var tests = {};
var valid, invalid, inline;

valid = {
  values: [
    'http://www.example.org/',
    'https://www.example.org',
    'http://www.example.co.uk/',
    'https://example.org',
    'chat.meatspac.es',
    '(chat.meatspac.es)',
    'chat.meatspac.es.',
    'chat.meatspac.es/channel',
    'https://example.org./path/to/stuff',
    'http://www.example.org:8080/',
    'http://example.org:8080/',
    'This is a link... example.org.',
    'This is a link... example.org, take a look!',
    '(This is a link... example.org)',
    'Link: chat.meatspac.es/channel?',
    'Link: chat.meatspac.es/channel:',
    'Link: chat.meatspac.es/channel;',
    'Link: chat.meatspac.es/channel!',
    '(This is a link... chat.meatspac.es/channel)',
示例#30
0
var requirejs = require('requirejs');

requirejs.config({
    baseUrl: '../../js/multiplayer',
    paths: {
        multiplayer: 'server'
    }
});
requirejs(['grape-engine'], function (Grape) {
    requirejs(['multiplayer'], function () {
        requirejs.config({
            baseUrl: './js'
        });
        requirejs.define('grape', [], function () {
            return Grape;
        });
        requirejs(['pongserver'], function () {
        });
    });
});