How to use sys - 10 common examples

To help you get started, we’ve selected a few sys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsdom / jsdom / test / runner.js View on Github external
global.debug = function(val) {
  var str;
  try {
    str = JSON.stringify(val, null, "  ");
  } catch (e) {
    str = sys.inspect(val, null, true);
  }
  sys.debug(str);
  process.exit();

}
// End Compat Layer
github sconover / knit-js / test / jasmine-node.js View on Github external
reportSpecResults: function(spec) {
      var result = spec.results();
      var msg = '';
      if (result.passed())
      {
        msg = (colors) ? (ansi.green + '.' + ansi.none) : '.';
//      } else if (result.skipped) {  TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
//        msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
      } else {
        msg = (colors) ? (ansi.red + 'F' + ansi.none) : 'F';
      }
      sys.print(msg);
      if (columnCounter++ < 50) return;
      columnCounter = 0;
      sys.print('\n');
    },
github angular / angular.js / lib / jasmine-1.0.1 / index.js View on Github external
reportSpecResults: function(spec) {
      var result = spec.results();
      var msg = '';
      if (result.passed())
      {
        msg = (colors) ? (ansi.green + '.' + ansi.none) : '.';
//      } else if (result.skipped) {  TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
//        msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
      } else {
        msg = (colors) ? (ansi.red + 'F' + ansi.none) : 'F';
      }
      sys.print(msg);
      if (columnCounter++ < 50) return;
      columnCounter = 0;
      sys.print('\n');
    },
github karl / loris / lib / jasmine-node / lib / jasmine / index.js View on Github external
reportSpecResults: function(spec) {
      var result = spec.results();
      var msg = '';
      if (result.passed())
      {
        msg = (colors) ? (ansi.green + '.' + ansi.none) : '.';
//      } else if (result.skipped) {  TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
//        msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
      } else {
        msg = (colors) ? (ansi.red + 'F' + ansi.none) : 'F';
      }
      sys.print(msg);
      if (columnCounter++ < 50) return;
      columnCounter = 0;
      sys.print('\n');
    },
github faradayio / careplane / node_modules / jasmine-node / lib / jasmine-node / index.js View on Github external
reportSpecResults: function(spec) {
      var result = spec.results();
      var msg = '';
      if (result.passed())
      {
        msg = (colors) ? (ansi.green + '.' + ansi.none) : '.';
//      } else if (result.skipped) {  TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
//        msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
      } else {
        msg = (colors) ? (ansi.red + 'F' + ansi.none) : 'F';
      }
      sys.print(msg);
      if (columnCounter++ < 50) return;
      columnCounter = 0;
      sys.print('\n');
    },
github milfont / jsonform / runspec.js View on Github external
reportSpecResults: function(spec) {
      var result = spec.results();
      var msg = '';
      if (result.passed())
      {
        msg = (colors) ? (ansi.green + '.' + ansi.none) : '.';
//      } else if (result.skipped) {  TODO: Research why "result.skipped" returns false when "xit" is called on a spec?
//        msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*';
      } else {
        msg = (colors) ? (ansi.red + 'F' + ansi.none) : 'F';
      }
      sys.print(msg);
      if (columnCounter++ < 50) return;
      columnCounter = 0;
      sys.print('\n');
    },
github cdapio / cdap / passport / tools / expiration-mailer / node_modules / cli-table / node_modules / colors / example.js View on Github external
var sys = require('sys');
var colors = require('./colors');

sys.puts('Rainbows are fun!'.rainbow);
sys.puts('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
sys.puts('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
github Rendez / node-dropbox / lib / util.js View on Github external
*  by Vincent Hellot .
 *
 * @author Luis Merino 
 */

var Multipart = exports.Multipart = function(boundary, useBuffers) {
    EventEmitter.call(this);
    
    this.boundaryLength = 0;
    this.randomBoundaryPartLength = 32;
    this.boundary = boundary || this.getBoundary();
    this.crlf = '\r\n';
    this.useBuffers = useBuffers;
};

Sys.inherits(Multipart, EventEmitter);

(function() {
    
    // algorithm borrowed from curl Curl_FormBoundary
    this.getBoundary = function() {
        var allowedChars = '0123456789abcdef';
        var boundary = '';
        var i = 0;
        var len = this.boundaryLength - this.randomBoundaryPartLength;
        
        for (i = 0; i < len; i++)
            boundary += '-';
        
        for (i = 0; i < this.randomBoundaryPartLength; i++)
            boundary += allowedChars[Math.floor(Math.random() * 15 + 1)];
github BilingualAphasia / AndroidBilingualAphasiaTest / androidsource / assets / oprime-server / src / lib / formidable / incoming_form.js View on Github external
this.maxFieldsSize = 2 * 1024 * 1024;
  this.keepExtensions = false;
  this.uploadDir = '/tmp';
  this.encoding = 'utf-8';
  this.headers = null;
  this.type = null;

  this.bytesReceived = null;
  this.bytesExpected = null;

  this._parser = null;
  this._flushing = 0;
  this._fieldsSize = 0;
};
sys.inherits(IncomingForm, EventEmitter);
exports.IncomingForm = IncomingForm;

IncomingForm.prototype.parse = function(req, cb) {
  this.pause = function() {
    try {
      req.pause();
    } catch (err) {
      // the stream was destroyed
      if (!this.ended) {
        // before it was completed, crash & burn
        this._error(err);
      }
      return false;
    }
    return true;
  };
github jifeon / autodafe / tests / test_app / models / test_super_model.js View on Github external
var Model = require('model');

var TestSuperModel = module.exports = function( params ) {
  this._init( params );
};


require('sys').inherits( TestSuperModel, Model );

var models = {};
TestSuperModel.model = function( clazz, app ) {
  var existed_inst = models[ clazz.get_some_importentd_value() ];
  return existed_inst || ( models[ clazz.get_some_importentd_value() ] = new clazz({
    app : app
  }) );
}

sys

Fixes using sys in your libraries without require all of Node to not depreciate stuff. Jeez.

BSD
Latest version published 12 years ago

Package Health Score

40 / 100
Full package analysis