jasmine-headless-webkit/jasmine/intense.js
2011-10-25 15:41:22 -04:00

38 lines
756 B
JavaScript

(function() {
var code, method, _ref;
window.Intense = {
colors: {
black: 0,
red: 1,
green: 2,
yellow: 3,
blue: 4,
magenta: 5,
cyan: 6,
white: 7
},
methods: {
foreground: function(color) {
if (Intense.useColors) {
return "\033[3" + Intense.colors[color] + "m" + this + "\033[0m";
} else {
return this;
}
},
bright: function() {
if (Intense.useColors) {
return "\033[1m" + this + "\033[0m";
} else {
return this;
}
}
},
useColors: true
};
_ref = Intense.methods;
for (method in _ref) {
code = _ref[method];
String.prototype[method] = code;
}
}).call(this);