less 2.0.7 → 2.0.8beta1

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 (55) hide show
  1. data/.travis.yml +4 -1
  2. data/less.gemspec +2 -1
  3. data/lib/less/js/Makefile +13 -0
  4. data/lib/less/js/benchmark/less-benchmark.js +1 -3
  5. data/lib/less/js/bin/lessc +30 -7
  6. data/lib/less/js/build/require-rhino.js +7 -0
  7. data/lib/less/js/dist/less-1.1.5.js +2805 -0
  8. data/lib/less/js/dist/less-1.1.5.min.js +16 -0
  9. data/lib/less/js/dist/less-rhino-1.1.3.js +2460 -0
  10. data/lib/less/js/dist/less-rhino-1.1.5.js +2481 -0
  11. data/lib/less/js/lib/less/browser.js +8 -2
  12. data/lib/less/js/lib/less/functions.js +12 -1
  13. data/lib/less/js/lib/less/index.js +19 -18
  14. data/lib/less/js/lib/less/parser.js +41 -22
  15. data/lib/less/js/lib/less/rhino.js +60 -0
  16. data/lib/less/js/lib/less/tree/alpha.js +1 -1
  17. data/lib/less/js/lib/less/tree/anonymous.js +1 -1
  18. data/lib/less/js/lib/less/tree/assignment.js +17 -0
  19. data/lib/less/js/lib/less/tree/call.js +1 -1
  20. data/lib/less/js/lib/less/tree/color.js +9 -6
  21. data/lib/less/js/lib/less/tree/comment.js +1 -1
  22. data/lib/less/js/lib/less/tree/dimension.js +1 -1
  23. data/lib/less/js/lib/less/tree/directive.js +1 -1
  24. data/lib/less/js/lib/less/tree/element.js +3 -2
  25. data/lib/less/js/lib/less/tree/expression.js +1 -1
  26. data/lib/less/js/lib/less/tree/import.js +3 -3
  27. data/lib/less/js/lib/less/tree/javascript.js +1 -1
  28. data/lib/less/js/lib/less/tree/keyword.js +1 -1
  29. data/lib/less/js/lib/less/tree/mixin.js +1 -1
  30. data/lib/less/js/lib/less/tree/operation.js +1 -1
  31. data/lib/less/js/lib/less/tree/quoted.js +1 -1
  32. data/lib/less/js/lib/less/tree/rule.js +1 -1
  33. data/lib/less/js/lib/less/tree/ruleset.js +3 -3
  34. data/lib/less/js/lib/less/tree/selector.js +13 -4
  35. data/lib/less/js/lib/less/tree/url.js +2 -2
  36. data/lib/less/js/lib/less/tree/value.js +1 -1
  37. data/lib/less/js/lib/less/tree/variable.js +1 -1
  38. data/lib/less/js/lib/less/tree.js +2 -2
  39. data/lib/less/js/package.json +1 -1
  40. data/lib/less/js/test/css/colors.css +6 -0
  41. data/lib/less/js/test/css/css-3.css +14 -0
  42. data/lib/less/js/test/css/css.css +3 -0
  43. data/lib/less/js/test/css/ie-filters.css +5 -0
  44. data/lib/less/js/test/css/import.css +2 -0
  45. data/lib/less/js/test/css/mixins.css +20 -0
  46. data/lib/less/js/test/less/colors.less +6 -0
  47. data/lib/less/js/test/less/css-3.less +10 -0
  48. data/lib/less/js/test/less/css.less +4 -0
  49. data/lib/less/js/test/less/ie-filters.less +8 -0
  50. data/lib/less/js/test/less/import.less +1 -0
  51. data/lib/less/js/test/less/mixins.less +20 -0
  52. data/lib/less/js/test/less-test.js +2 -4
  53. data/lib/less/loader.rb +18 -30
  54. data/lib/less/version.rb +1 -1
  55. metadata +64 -55
data/.travis.yml CHANGED
@@ -1,7 +1,10 @@
1
1
  rvm:
2
2
  - 1.8.7
3
3
  - 1.9.2
4
+ - 1.9.3
4
5
  - ree
5
6
  notifications:
6
7
  recipients:
7
- - cowboyd@thefrontside.net
8
+ - cowboyd@thefrontside.net
9
+
10
+ before_script: git submodule update --init
data/less.gemspec CHANGED
@@ -22,7 +22,8 @@ Gem::Specification.new do |s|
22
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
23
  s.require_paths = ["lib"]
24
24
 
25
- s.add_dependency "therubyracer", "~> 0.9.2"
25
+ s.add_dependency "therubyracer", "~> 0.9.9"
26
+ s.add_dependency "commonjs", "~> 0.2.0"
26
27
 
27
28
  s.add_development_dependency "rake"
28
29
  s.add_development_dependency "rspec", "~> 2.0"
data/lib/less/js/Makefile CHANGED
@@ -18,6 +18,7 @@ HEADER = build/header.js
18
18
  VERSION = `cat package.json | grep version \
19
19
  | grep -o '[0-9]\.[0-9]\.[0-9]\+'`
20
20
  DIST = dist/less-${VERSION}.js
21
+ RHINO = dist/less-rhino-${VERSION}.js
21
22
  DIST_MIN = dist/less-${VERSION}.min.js
22
23
 
23
24
  less:
@@ -35,6 +36,18 @@ less:
35
36
  @@echo "})(window);" >> ${DIST}
36
37
  @@echo ${DIST} built.
37
38
 
39
+ rhino:
40
+ @@mkdir -p dist
41
+ @@touch ${RHINO}
42
+ @@cat build/require-rhino.js\
43
+ build/ecma-5.js\
44
+ ${SRC}/parser.js\
45
+ ${SRC}/functions.js\
46
+ ${SRC}/tree/*.js\
47
+ ${SRC}/tree.js\
48
+ ${SRC}/rhino.js > ${RHINO}
49
+ @@echo ${RHINO} built.
50
+
38
51
  min: less
39
52
  @@echo minifying...
40
53
  @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST_MIN}
@@ -2,9 +2,7 @@ var path = require('path'),
2
2
  fs = require('fs'),
3
3
  sys = require('sys');
4
4
 
5
- require.paths.unshift(__dirname, path.join(__dirname, '..'));
6
-
7
- var less = require('lib/less');
5
+ var less = require('../lib/less');
8
6
  var file = path.join(__dirname, 'benchmark.less');
9
7
 
10
8
  if (process.argv[2]) { file = path.join(process.cwd(), process.argv[2]) }
@@ -4,20 +4,24 @@ var path = require('path'),
4
4
  fs = require('fs'),
5
5
  sys = require('sys');
6
6
 
7
- require.paths.unshift(path.join(__dirname, '..', 'lib'));
8
-
9
- var less = require('less');
7
+ var less = require('../lib/less');
10
8
  var args = process.argv.slice(1);
11
9
  var options = {
12
10
  compress: false,
13
11
  optimization: 1,
14
12
  silent: false,
15
- paths: []
13
+ paths: [],
14
+ color: true
16
15
  };
17
16
 
18
17
  args = args.filter(function (arg) {
19
18
  var match;
20
19
 
20
+ if (match = arg.match(/^-I(.+)$/)) {
21
+ options.paths.push(match[1]);
22
+ return false;
23
+ }
24
+
21
25
  if (match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]+))?$/i)) { arg = match[1] }
22
26
  else { return arg }
23
27
 
@@ -41,6 +45,9 @@ args = args.filter(function (arg) {
41
45
  case 'compress':
42
46
  options.compress = true;
43
47
  break;
48
+ case 'no-color':
49
+ options.color = false;
50
+ break;
44
51
  case 'include-path':
45
52
  options.paths = match[2].split(':')
46
53
  .map(function(p) {
@@ -58,7 +65,7 @@ args = args.filter(function (arg) {
58
65
  });
59
66
 
60
67
  var input = args[1];
61
- if (input && input[0] != '/') {
68
+ if (input && input[0] != '/' && input != '-') {
62
69
  input = path.join(process.cwd(), input);
63
70
  }
64
71
  var output = args[2];
@@ -73,7 +80,7 @@ if (! input) {
73
80
  process.exit(1);
74
81
  }
75
82
 
76
- fs.readFile(input, 'utf-8', function (e, data) {
83
+ var parseLessFile = function (e, data) {
77
84
  if (e) {
78
85
  sys.puts("lessc: " + e.message);
79
86
  process.exit(1);
@@ -102,4 +109,20 @@ fs.readFile(input, 'utf-8', function (e, data) {
102
109
  }
103
110
  }
104
111
  });
105
- });
112
+ };
113
+
114
+ if (input != '-') {
115
+ fs.readFile(input, 'utf-8', parseLessFile);
116
+ } else {
117
+ process.stdin.resume();
118
+ process.stdin.setEncoding('utf8');
119
+
120
+ var buffer = '';
121
+ process.stdin.on('data', function(data) {
122
+ buffer += data;
123
+ });
124
+
125
+ process.stdin.on('end', function() {
126
+ parseLessFile(false, buffer);
127
+ });
128
+ }
@@ -0,0 +1,7 @@
1
+ //
2
+ // Stub out `require` in rhino
3
+ //
4
+ function require(arg) {
5
+ return less[arg.split('/')[1]];
6
+ };
7
+