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.
Files changed (54) hide show
  1. data/VERSION +1 -1
  2. data/vendor/Readme.md +1 -1
  3. data/vendor/lib/functions/index.js +75 -1
  4. data/vendor/lib/functions/url.js +11 -12
  5. data/vendor/lib/lexer.js +2 -1
  6. data/vendor/lib/stylus.js +1 -1
  7. data/vendor/lib/visitor/compiler.js +1 -1
  8. data/vendor/lib/visitor/evaluator.js +2 -0
  9. data/vendor/node_modules/cssom/package.json +0 -3
  10. data/vendor/node_modules/mocha/History.md +21 -0
  11. data/vendor/node_modules/mocha/Makefile +2 -2
  12. data/vendor/node_modules/mocha/_mocha.js +141 -48
  13. data/vendor/node_modules/mocha/bin/_mocha +53 -61
  14. data/vendor/node_modules/mocha/bin/mocha +3 -0
  15. data/vendor/node_modules/mocha/lib/interfaces/bdd.js +23 -6
  16. data/vendor/node_modules/mocha/lib/mocha.js +55 -4
  17. data/vendor/node_modules/mocha/lib/reporters/base.js +5 -5
  18. data/vendor/node_modules/mocha/lib/reporters/dot.js +5 -4
  19. data/vendor/node_modules/mocha/lib/reporters/html.js +25 -12
  20. data/vendor/node_modules/mocha/lib/reporters/landing.js +2 -2
  21. data/vendor/node_modules/mocha/lib/reporters/min.js +2 -2
  22. data/vendor/node_modules/mocha/lib/reporters/nyan.js +6 -6
  23. data/vendor/node_modules/mocha/lib/reporters/progress.js +1 -1
  24. data/vendor/node_modules/mocha/lib/reporters/xunit.js +5 -1
  25. data/vendor/node_modules/mocha/lib/runnable.js +1 -1
  26. data/vendor/node_modules/mocha/lib/runner.js +3 -3
  27. data/vendor/node_modules/mocha/lib/suite.js +7 -1
  28. data/vendor/node_modules/mocha/lib/utils.js +1 -1
  29. data/vendor/node_modules/mocha/mocha.css +18 -1
  30. data/vendor/node_modules/mocha/mocha.js +141 -48
  31. data/vendor/node_modules/mocha/package.json +6 -3
  32. data/vendor/node_modules/mocha/test.js +3 -5
  33. data/vendor/node_modules/should/History.md +11 -0
  34. data/vendor/node_modules/should/Readme.md +22 -10
  35. data/vendor/node_modules/should/lib/should.js +70 -62
  36. data/vendor/node_modules/should/package.json +5 -2
  37. data/vendor/node_modules/should/test/should.test.js +64 -0
  38. data/vendor/package.json +1 -1
  39. data/vendor/testing/foo.css +3 -0
  40. data/vendor/testing/index.js +1 -0
  41. data/vendor/testing/small.styl +12 -10
  42. metadata +3 -16
  43. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet +0 -16
  44. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet +0 -16
  45. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet +0 -16
  46. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet +0 -16
  47. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet +0 -16
  48. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet +0 -16
  49. data/vendor/node_modules/mocha/editors/JavaScript mocha.tmbundle/info.plist +0 -19
  50. data/vendor/node_modules/mocha/support/compile.js +0 -154
  51. data/vendor/node_modules/mocha/support/foot.js +0 -1
  52. data/vendor/node_modules/mocha/support/head.js +0 -2
  53. data/vendor/node_modules/mocha/support/tail.js +0 -150
  54. data/vendor/node_modules/mocha/support/template.html +0 -16
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.28.2
1
+ 0.29.0
data/vendor/Readme.md CHANGED
@@ -111,7 +111,7 @@ form input {
111
111
  ### Framework Support
112
112
 
113
113
  - [Connect](/LearnBoost/stylus/blob/master/docs/middleware.md)
114
- - [Play! 2.0](https://github.com/knuton/play-stylus)
114
+ - [Play! 2.0](https://github.com/patiencelabs/play-stylus)
115
115
  - [Ruby On Rails](https://github.com/lucasmazza/ruby-stylus)
116
116
 
117
117
  ### CMS Support
@@ -13,7 +13,9 @@ var Compiler = require('../visitor/compiler')
13
13
  , nodes = require('../nodes')
14
14
  , utils = require('../utils')
15
15
  , Image = require('./image')
16
- , path = require('path');
16
+ , units = require('../units')
17
+ , path = require('path')
18
+ , fs = require('fs');
17
19
 
18
20
  /**
19
21
  * Color component name map.
@@ -376,6 +378,62 @@ exports.rgb = function rgb(red, green, blue){
376
378
  }
377
379
  };
378
380
 
381
+ /**
382
+ * Convert a .json file into stylus variables
383
+ * Nested variable object keys are joined with a dash (-)
384
+ *
385
+ * Given this sample media-queries.json file:
386
+ * {
387
+ * "small": "screen and (max-width:400px)",
388
+ * "tablet": {
389
+ * "landscape": "screen and (min-width:600px) and (orientation:landscape)",
390
+ * "portrait": "screen and (min-width:600px) and (orientation:portrait)"
391
+ * }
392
+ * }
393
+ *
394
+ * Examples:
395
+ *
396
+ * json('media-queries.json')
397
+ *
398
+ * @media small
399
+ * // => @media screen and (max-width:400px)
400
+ *
401
+ * @media tablet-landscape
402
+ * // => @media screen and (min-width:600px) and (orientation:landscape)
403
+ *
404
+ * @param {String} path
405
+ * @api public
406
+ */
407
+
408
+ exports.json = function(path){
409
+ utils.assertString(path, 'path');
410
+
411
+ // lookup
412
+ path = path.string;
413
+ var found = utils.lookup(path, this.options.paths, this.options.filename);
414
+ if (!found) throw new Error('failed to locate .json file ' + path);
415
+
416
+ // read
417
+ var str = fs.readFileSync(found, 'utf8');
418
+ convert.call(this, JSON.parse(str));
419
+ return;
420
+
421
+ function convert(obj, prefix){
422
+ prefix = prefix ? prefix + '-' : '';
423
+ for (var key in obj){
424
+ var val = obj[key];
425
+ var name = prefix + key;
426
+ if ('object' == typeof val) {
427
+ convert.call(this, val, name);
428
+ } else {
429
+ val = utils.coerce(val);
430
+ if ('string' == val.nodeName) val = parseUnit(val.string) || new nodes.Literal(val.string);
431
+ this.global.scope.add({ name: name, val: val });
432
+ }
433
+ }
434
+ }
435
+ };
436
+
379
437
  /**
380
438
  * Unquote the given `str`.
381
439
  *
@@ -807,3 +865,19 @@ exports['-adjust'] = function adjust(color, prop, amount){
807
865
 
808
866
  return prop;
809
867
  }).raw = true;
868
+
869
+ /**
870
+ * Attempt to parse unit `str`.
871
+ *
872
+ * @param {String} str
873
+ * @return {Unit}
874
+ * @api public
875
+ */
876
+
877
+ function parseUnit(str){
878
+ var m = str.match(/^(\d+)(.*)/);
879
+ if (!m) return;
880
+ var n = parseInt(m[1], 10);
881
+ var type = m[2];
882
+ return new nodes.Unit(n, type);
883
+ }
@@ -51,24 +51,23 @@ var mimes = {
51
51
  module.exports = function(options) {
52
52
  options = options || {};
53
53
 
54
- var sizeLimit = options.limit || 30000
55
- , _paths = options.paths || [];
54
+ var _paths = options.paths || [];
55
+ var sizeLimit = null != options.sizeLimit ? options.sizeLimit : 30000;
56
56
 
57
- function url(url){
57
+ function fn(url){
58
58
  // Compile the url
59
59
  var compiler = new Compiler(url);
60
60
  compiler.isURL = true;
61
- var url = url.nodes.map(function(node){
61
+ url = url.nodes.map(function(node){
62
62
  return compiler.visit(node);
63
63
  }).join('');
64
64
 
65
- // Parse literal
66
- var url = parse(url)
67
- , ext = extname(url.pathname)
65
+ // Parse literal
66
+ url = parse(url);
67
+ var ext = extname(url.pathname)
68
68
  , mime = mimes[ext]
69
69
  , literal = new nodes.Literal('url("' + url.href + '")')
70
70
  , paths = _paths.concat(this.paths)
71
- , founds
72
71
  , buf;
73
72
 
74
73
  // Not supported
@@ -87,12 +86,12 @@ module.exports = function(options) {
87
86
  buf = fs.readFileSync(found);
88
87
 
89
88
  // To large
90
- if (buf.length > sizeLimit) return literal;
89
+ if (false !== sizeLimit && buf.length > sizeLimit) return literal;
91
90
 
92
91
  // Encode
93
92
  return new nodes.Literal('url("data:' + mime + ';base64,' + buf.toString('base64') + '")');
94
93
  };
95
94
 
96
- url.raw = true;
97
- return url;
98
- };
95
+ fn.raw = true;
96
+ return fn;
97
+ };
data/vendor/lib/lexer.js CHANGED
@@ -61,7 +61,8 @@ function Lexer(str, options) {
61
61
  this.lineno = 1;
62
62
 
63
63
  function comment(str, val, offset, s) {
64
- return s.lastIndexOf('/*', offset) > s.lastIndexOf('*/', offset)
64
+ var inComment = s.lastIndexOf('/*', offset) > s.lastIndexOf('*/', offset) || "//" == s.substr(0, 2);
65
+ return inComment
65
66
  ? str
66
67
  : val;
67
68
  };
data/vendor/lib/stylus.js CHANGED
@@ -24,7 +24,7 @@ exports = module.exports = render;
24
24
  * Library version.
25
25
  */
26
26
 
27
- exports.version = '0.28.2';
27
+ exports.version = '0.29.0';
28
28
 
29
29
  /**
30
30
  * Expose nodes.
@@ -479,7 +479,7 @@ Compiler.prototype.compileSelectors = function(arr){
479
479
 
480
480
  Compiler.prototype.debugInfo = function(node){
481
481
 
482
- var path = fs.realpathSync(node.filename)
482
+ var path = node.filename == 'stdin' ? 'stdin' : fs.realpathSync(node.filename)
483
483
  , line = node.nodes ? node.nodes[0].lineno : node.lineno;
484
484
 
485
485
  if (this.linenos){
@@ -188,6 +188,8 @@ Evaluator.prototype.visitReturn = function(ret){
188
188
 
189
189
  Evaluator.prototype.visitMedia = function(media){
190
190
  media.block = this.visit(media.block);
191
+ var query = this.lookup(media.val);
192
+ if (query) media.val = new nodes.Literal(query.first.string);
191
193
  return media;
192
194
  };
193
195
 
@@ -46,8 +46,5 @@
46
46
  "_npmVersion": "1.1.21",
47
47
  "_nodeVersion": "v0.8.1",
48
48
  "_defaultsLoaded": true,
49
- "dist": {
50
- "shasum": "185f2c4c56220f73da355f7b3088e5e801d0dcd7"
51
- },
52
49
  "_from": "cssom@0.2.x"
53
50
  }
@@ -1,4 +1,25 @@
1
1
 
2
+ 1.3.2 / 2012-08-01
3
+ ==================
4
+
5
+ * fix exports double-execution regression. Closes #531
6
+
7
+ 1.3.1 / 2012-08-01
8
+ ==================
9
+
10
+ * add passes/failures toggling to HTML reporter
11
+ * add pending state to `xit()` and `xdescribe()` [Brian Moore]
12
+ * add the @charset "UTF-8"; to fix #522 with FireFox. [Jonathan Creamer]
13
+ * add border-bottom to #stats links
14
+ * add check for runnable in `Runner#uncaught()`. Closes #494
15
+ * add 0.4 and 0.6 back to travis.yml
16
+ * add `-E, --growl-errors` to growl on failures only
17
+ * add prefixes to debug() names. Closes #497
18
+ * add `Mocha#invert()` to js api
19
+ * change dot reporter to use sexy unicode dots
20
+ * fix error when clicking pending test in HTML reporter
21
+ * fix `make tm`
22
+
2
23
  1.3.0 / 2012-07-05
3
24
  ==================
4
25
 
@@ -114,7 +114,7 @@ non-tty:
114
114
  @cat /tmp/spec.out
115
115
 
116
116
  tm:
117
- mkdir -p $(TM_DEST)/$(TM_BUNDLE)
118
- cp -fr editors/$(TM_BUNDLE) $(TM_DEST)/$(TM_BUNDLE)
117
+ mkdir -p $(TM_DEST)
118
+ cp -fr editors/$(TM_BUNDLE) $(TM_DEST)
119
119
 
120
120
  .PHONY: test-cov test-jsapi test-compilers watch test test-all test-bdd test-tdd test-qunit test-exports test-unit non-tty test-grep tm clean