stylus-source 0.28.2 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/vendor/Readme.md +1 -1
- data/vendor/lib/functions/index.js +75 -1
- data/vendor/lib/functions/url.js +11 -12
- data/vendor/lib/lexer.js +2 -1
- data/vendor/lib/stylus.js +1 -1
- data/vendor/lib/visitor/compiler.js +1 -1
- data/vendor/lib/visitor/evaluator.js +2 -0
- data/vendor/node_modules/cssom/package.json +0 -3
- data/vendor/node_modules/mocha/History.md +21 -0
- data/vendor/node_modules/mocha/Makefile +2 -2
- data/vendor/node_modules/mocha/_mocha.js +141 -48
- data/vendor/node_modules/mocha/bin/_mocha +53 -61
- data/vendor/node_modules/mocha/bin/mocha +3 -0
- data/vendor/node_modules/mocha/lib/interfaces/bdd.js +23 -6
- data/vendor/node_modules/mocha/lib/mocha.js +55 -4
- data/vendor/node_modules/mocha/lib/reporters/base.js +5 -5
- data/vendor/node_modules/mocha/lib/reporters/dot.js +5 -4
- data/vendor/node_modules/mocha/lib/reporters/html.js +25 -12
- data/vendor/node_modules/mocha/lib/reporters/landing.js +2 -2
- data/vendor/node_modules/mocha/lib/reporters/min.js +2 -2
- data/vendor/node_modules/mocha/lib/reporters/nyan.js +6 -6
- data/vendor/node_modules/mocha/lib/reporters/progress.js +1 -1
- data/vendor/node_modules/mocha/lib/reporters/xunit.js +5 -1
- data/vendor/node_modules/mocha/lib/runnable.js +1 -1
- data/vendor/node_modules/mocha/lib/runner.js +3 -3
- data/vendor/node_modules/mocha/lib/suite.js +7 -1
- data/vendor/node_modules/mocha/lib/utils.js +1 -1
- data/vendor/node_modules/mocha/mocha.css +18 -1
- data/vendor/node_modules/mocha/mocha.js +141 -48
- data/vendor/node_modules/mocha/package.json +6 -3
- data/vendor/node_modules/mocha/test.js +3 -5
- data/vendor/node_modules/should/History.md +11 -0
- data/vendor/node_modules/should/Readme.md +22 -10
- data/vendor/node_modules/should/lib/should.js +70 -62
- data/vendor/node_modules/should/package.json +5 -2
- data/vendor/node_modules/should/test/should.test.js +64 -0
- data/vendor/package.json +1 -1
- data/vendor/testing/foo.css +3 -0
- data/vendor/testing/index.js +1 -0
- data/vendor/testing/small.styl +12 -10
- metadata +3 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet +0 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet +0 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet +0 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet +0 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet +0 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet +0 -16
- data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/info.plist +0 -19
- data/vendor/node_modules/mocha/support/compile.js +0 -154
- data/vendor/node_modules/mocha/support/foot.js +0 -1
- data/vendor/node_modules/mocha/support/head.js +0 -2
- data/vendor/node_modules/mocha/support/tail.js +0 -150
- data/vendor/node_modules/mocha/support/template.html +0 -16
@@ -1,154 +0,0 @@
|
|
1
|
-
|
2
|
-
/**
|
3
|
-
* Module dependencies.
|
4
|
-
*/
|
5
|
-
|
6
|
-
var fs = require('fs');
|
7
|
-
|
8
|
-
/**
|
9
|
-
* Arguments.
|
10
|
-
*/
|
11
|
-
|
12
|
-
var args = process.argv.slice(2)
|
13
|
-
, pending = args.length
|
14
|
-
, files = {};
|
15
|
-
|
16
|
-
console.log('');
|
17
|
-
|
18
|
-
// parse arguments
|
19
|
-
|
20
|
-
args.forEach(function(file){
|
21
|
-
var mod = file.replace('lib/', '');
|
22
|
-
fs.readFile(file, 'utf8', function(err, js){
|
23
|
-
if (err) throw err;
|
24
|
-
console.log(' \033[90mcompile : \033[0m\033[36m%s\033[0m', file);
|
25
|
-
files[file] = ~js.indexOf('require: off')
|
26
|
-
? js
|
27
|
-
: parse(js);
|
28
|
-
--pending || compile();
|
29
|
-
});
|
30
|
-
});
|
31
|
-
|
32
|
-
/**
|
33
|
-
* Parse the given `js`.
|
34
|
-
*/
|
35
|
-
|
36
|
-
function parse(js) {
|
37
|
-
return parseRequires(parseInheritance(js));
|
38
|
-
}
|
39
|
-
|
40
|
-
/**
|
41
|
-
* Parse requires.
|
42
|
-
*/
|
43
|
-
|
44
|
-
function parseRequires(js) {
|
45
|
-
return js
|
46
|
-
.replace(/require\('events'\)/g, "require('browser/events')")
|
47
|
-
.replace(/require\('debug'\)/g, "require('browser/debug')")
|
48
|
-
.replace(/require\('path'\)/g, "require('browser/path')")
|
49
|
-
.replace(/require\('diff'\)/g, "require('browser/diff')")
|
50
|
-
.replace(/require\('tty'\)/g, "require('browser/tty')")
|
51
|
-
.replace(/require\('fs'\)/g, "require('browser/fs')")
|
52
|
-
}
|
53
|
-
|
54
|
-
/**
|
55
|
-
* Parse __proto__.
|
56
|
-
*/
|
57
|
-
|
58
|
-
function parseInheritance(js) {
|
59
|
-
return js
|
60
|
-
.replace(/^ *(\w+)\.prototype\.__proto__ * = *(\w+)\.prototype *;?/gm, function(_, child, parent){
|
61
|
-
return child + '.prototype = new ' + parent + ';\n'
|
62
|
-
+ child + '.prototype.constructor = '+ child + ';\n';
|
63
|
-
});
|
64
|
-
}
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Compile the files.
|
68
|
-
*/
|
69
|
-
|
70
|
-
function compile() {
|
71
|
-
var buf = '';
|
72
|
-
buf += '\n// CommonJS require()\n\n';
|
73
|
-
buf += browser.require + '\n\n';
|
74
|
-
buf += 'require.modules = {};\n\n';
|
75
|
-
buf += 'require.resolve = ' + browser.resolve + ';\n\n';
|
76
|
-
buf += 'require.register = ' + browser.register + ';\n\n';
|
77
|
-
buf += 'require.relative = ' + browser.relative + ';\n\n';
|
78
|
-
args.forEach(function(file){
|
79
|
-
var js = files[file];
|
80
|
-
file = file.replace('lib/', '');
|
81
|
-
buf += '\nrequire.register("' + file + '", function(module, exports, require){\n';
|
82
|
-
buf += js;
|
83
|
-
buf += '\n}); // module: ' + file + '\n';
|
84
|
-
});
|
85
|
-
fs.writeFile('_mocha.js', buf, function(err){
|
86
|
-
if (err) throw err;
|
87
|
-
console.log(' \033[90m create : \033[0m\033[36m%s\033[0m', 'mocha.js');
|
88
|
-
console.log();
|
89
|
-
});
|
90
|
-
}
|
91
|
-
|
92
|
-
// refactored version of weepy's
|
93
|
-
// https://github.com/weepy/brequire/blob/master/browser/brequire.js
|
94
|
-
|
95
|
-
var browser = {
|
96
|
-
|
97
|
-
/**
|
98
|
-
* Require a module.
|
99
|
-
*/
|
100
|
-
|
101
|
-
require: function require(p){
|
102
|
-
var path = require.resolve(p)
|
103
|
-
, mod = require.modules[path];
|
104
|
-
if (!mod) throw new Error('failed to require "' + p + '"');
|
105
|
-
if (!mod.exports) {
|
106
|
-
mod.exports = {};
|
107
|
-
mod.call(mod.exports, mod, mod.exports, require.relative(path));
|
108
|
-
}
|
109
|
-
return mod.exports;
|
110
|
-
},
|
111
|
-
|
112
|
-
/**
|
113
|
-
* Resolve module path.
|
114
|
-
*/
|
115
|
-
|
116
|
-
resolve: function(path){
|
117
|
-
var orig = path
|
118
|
-
, reg = path + '.js'
|
119
|
-
, index = path + '/index.js';
|
120
|
-
return require.modules[reg] && reg
|
121
|
-
|| require.modules[index] && index
|
122
|
-
|| orig;
|
123
|
-
},
|
124
|
-
|
125
|
-
/**
|
126
|
-
* Return relative require().
|
127
|
-
*/
|
128
|
-
|
129
|
-
relative: function(parent) {
|
130
|
-
return function(p){
|
131
|
-
if ('.' != p.charAt(0)) return require(p);
|
132
|
-
|
133
|
-
var path = parent.split('/')
|
134
|
-
, segs = p.split('/');
|
135
|
-
path.pop();
|
136
|
-
|
137
|
-
for (var i = 0; i < segs.length; i++) {
|
138
|
-
var seg = segs[i];
|
139
|
-
if ('..' == seg) path.pop();
|
140
|
-
else if ('.' != seg) path.push(seg);
|
141
|
-
}
|
142
|
-
|
143
|
-
return require(path.join('/'));
|
144
|
-
};
|
145
|
-
},
|
146
|
-
|
147
|
-
/**
|
148
|
-
* Register a module.
|
149
|
-
*/
|
150
|
-
|
151
|
-
register: function(path, fn){
|
152
|
-
require.modules[path] = fn;
|
153
|
-
}
|
154
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
})();
|
@@ -1,150 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Node shims.
|
3
|
-
*
|
4
|
-
* These are meant only to allow
|
5
|
-
* mocha.js to run untouched, not
|
6
|
-
* to allow running node code in
|
7
|
-
* the browser.
|
8
|
-
*/
|
9
|
-
|
10
|
-
process = {};
|
11
|
-
process.exit = function(status){};
|
12
|
-
process.stdout = {};
|
13
|
-
global = window;
|
14
|
-
|
15
|
-
/**
|
16
|
-
* next tick implementation.
|
17
|
-
*/
|
18
|
-
|
19
|
-
process.nextTick = (function(){
|
20
|
-
// postMessage behaves badly on IE8
|
21
|
-
if (window.ActiveXObject || !window.postMessage) {
|
22
|
-
return function(fn){ fn() };
|
23
|
-
}
|
24
|
-
|
25
|
-
// based on setZeroTimeout by David Baron
|
26
|
-
// - http://dbaron.org/log/20100309-faster-timeouts
|
27
|
-
var timeouts = []
|
28
|
-
, name = 'mocha-zero-timeout'
|
29
|
-
|
30
|
-
window.addEventListener('message', function(e){
|
31
|
-
if (e.source == window && e.data == name) {
|
32
|
-
if (e.stopPropagation) e.stopPropagation();
|
33
|
-
if (timeouts.length) timeouts.shift()();
|
34
|
-
}
|
35
|
-
}, true);
|
36
|
-
|
37
|
-
return function(fn){
|
38
|
-
timeouts.push(fn);
|
39
|
-
window.postMessage(name, '*');
|
40
|
-
}
|
41
|
-
})();
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Remove uncaughtException listener.
|
45
|
-
*/
|
46
|
-
|
47
|
-
process.removeListener = function(e){
|
48
|
-
if ('uncaughtException' == e) {
|
49
|
-
window.onerror = null;
|
50
|
-
}
|
51
|
-
};
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Implements uncaughtException listener.
|
55
|
-
*/
|
56
|
-
|
57
|
-
process.on = function(e, fn){
|
58
|
-
if ('uncaughtException' == e) {
|
59
|
-
window.onerror = fn;
|
60
|
-
}
|
61
|
-
};
|
62
|
-
|
63
|
-
/**
|
64
|
-
* Expose mocha.
|
65
|
-
*/
|
66
|
-
|
67
|
-
window.mocha = require('mocha');
|
68
|
-
|
69
|
-
// boot
|
70
|
-
;(function(){
|
71
|
-
var utils = mocha.utils
|
72
|
-
, options = {}
|
73
|
-
|
74
|
-
mocha.suite = new mocha.Suite('', new mocha.Context());
|
75
|
-
|
76
|
-
/**
|
77
|
-
* Highlight the given string of `js`.
|
78
|
-
*/
|
79
|
-
|
80
|
-
function highlight(js) {
|
81
|
-
return js
|
82
|
-
.replace(/</g, '<')
|
83
|
-
.replace(/>/g, '>')
|
84
|
-
.replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
|
85
|
-
.replace(/('.*?')/gm, '<span class="string">$1</span>')
|
86
|
-
.replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
|
87
|
-
.replace(/(\d+)/gm, '<span class="number">$1</span>')
|
88
|
-
.replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
|
89
|
-
.replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* Highlight code contents.
|
94
|
-
*/
|
95
|
-
|
96
|
-
function highlightCode() {
|
97
|
-
var code = document.getElementsByTagName('code');
|
98
|
-
for (var i = 0, len = code.length; i < len; ++i) {
|
99
|
-
code[i].innerHTML = highlight(code[i].innerHTML);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
|
103
|
-
/**
|
104
|
-
* Parse the given `qs`.
|
105
|
-
*/
|
106
|
-
|
107
|
-
function parse(qs) {
|
108
|
-
return utils.reduce(qs.replace('?', '').split('&'), function(obj, pair){
|
109
|
-
var i = pair.indexOf('=')
|
110
|
-
, key = pair.slice(0, i)
|
111
|
-
, val = pair.slice(++i);
|
112
|
-
|
113
|
-
obj[key] = decodeURIComponent(val);
|
114
|
-
return obj;
|
115
|
-
}, {});
|
116
|
-
}
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Setup mocha with the given setting options.
|
120
|
-
*/
|
121
|
-
|
122
|
-
mocha.setup = function(opts){
|
123
|
-
if ('string' === typeof opts) options.ui = opts;
|
124
|
-
else options = opts;
|
125
|
-
|
126
|
-
ui = mocha.interfaces[options.ui];
|
127
|
-
if (!ui) throw new Error('invalid mocha interface "' + ui + '"');
|
128
|
-
if (options.timeout) mocha.suite.timeout(options.timeout);
|
129
|
-
ui(mocha.suite);
|
130
|
-
mocha.suite.emit('pre-require', window);
|
131
|
-
};
|
132
|
-
|
133
|
-
/**
|
134
|
-
* Run mocha, returning the Runner.
|
135
|
-
*/
|
136
|
-
|
137
|
-
mocha.run = function(fn){
|
138
|
-
mocha.suite.emit('run');
|
139
|
-
var runner = new mocha.Runner(mocha.suite);
|
140
|
-
var Reporter = options.reporter || mocha.reporters.HTML;
|
141
|
-
var reporter = new Reporter(runner);
|
142
|
-
var query = parse(window.location.search || "");
|
143
|
-
if (query.grep) runner.grep(new RegExp(query.grep));
|
144
|
-
if (options.ignoreLeaks) runner.ignoreLeaks = true;
|
145
|
-
if (options.globals) runner.globals(options.globals);
|
146
|
-
runner.globals(['location']);
|
147
|
-
runner.on('end', highlightCode);
|
148
|
-
return runner.run(fn);
|
149
|
-
};
|
150
|
-
})();
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Mocha</title>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
-
<link rel="stylesheet" href="mocha.css" />
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
<div id="mocha"></div>
|
9
|
-
<script src="mocha.js"></script>
|
10
|
-
<script>mocha.setup('bdd')</script>
|
11
|
-
<script src="my-tests.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.run();
|
14
|
-
</script>
|
15
|
-
</body>
|
16
|
-
</html>
|