less 2.0.7 → 2.0.8beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -1
- data/less.gemspec +2 -1
- data/lib/less/js/Makefile +13 -0
- data/lib/less/js/benchmark/less-benchmark.js +1 -3
- data/lib/less/js/bin/lessc +30 -7
- data/lib/less/js/build/require-rhino.js +7 -0
- data/lib/less/js/dist/less-1.1.5.js +2805 -0
- data/lib/less/js/dist/less-1.1.5.min.js +16 -0
- data/lib/less/js/dist/less-rhino-1.1.3.js +2460 -0
- data/lib/less/js/dist/less-rhino-1.1.5.js +2481 -0
- data/lib/less/js/lib/less/browser.js +8 -2
- data/lib/less/js/lib/less/functions.js +12 -1
- data/lib/less/js/lib/less/index.js +19 -18
- data/lib/less/js/lib/less/parser.js +41 -22
- data/lib/less/js/lib/less/rhino.js +60 -0
- data/lib/less/js/lib/less/tree/alpha.js +1 -1
- data/lib/less/js/lib/less/tree/anonymous.js +1 -1
- data/lib/less/js/lib/less/tree/assignment.js +17 -0
- data/lib/less/js/lib/less/tree/call.js +1 -1
- data/lib/less/js/lib/less/tree/color.js +9 -6
- data/lib/less/js/lib/less/tree/comment.js +1 -1
- data/lib/less/js/lib/less/tree/dimension.js +1 -1
- data/lib/less/js/lib/less/tree/directive.js +1 -1
- data/lib/less/js/lib/less/tree/element.js +3 -2
- data/lib/less/js/lib/less/tree/expression.js +1 -1
- data/lib/less/js/lib/less/tree/import.js +3 -3
- data/lib/less/js/lib/less/tree/javascript.js +1 -1
- data/lib/less/js/lib/less/tree/keyword.js +1 -1
- data/lib/less/js/lib/less/tree/mixin.js +1 -1
- data/lib/less/js/lib/less/tree/operation.js +1 -1
- data/lib/less/js/lib/less/tree/quoted.js +1 -1
- data/lib/less/js/lib/less/tree/rule.js +1 -1
- data/lib/less/js/lib/less/tree/ruleset.js +3 -3
- data/lib/less/js/lib/less/tree/selector.js +13 -4
- data/lib/less/js/lib/less/tree/url.js +2 -2
- data/lib/less/js/lib/less/tree/value.js +1 -1
- data/lib/less/js/lib/less/tree/variable.js +1 -1
- data/lib/less/js/lib/less/tree.js +2 -2
- data/lib/less/js/package.json +1 -1
- data/lib/less/js/test/css/colors.css +6 -0
- data/lib/less/js/test/css/css-3.css +14 -0
- data/lib/less/js/test/css/css.css +3 -0
- data/lib/less/js/test/css/ie-filters.css +5 -0
- data/lib/less/js/test/css/import.css +2 -0
- data/lib/less/js/test/css/mixins.css +20 -0
- data/lib/less/js/test/less/colors.less +6 -0
- data/lib/less/js/test/less/css-3.less +10 -0
- data/lib/less/js/test/less/css.less +4 -0
- data/lib/less/js/test/less/ie-filters.less +8 -0
- data/lib/less/js/test/less/import.less +1 -0
- data/lib/less/js/test/less/mixins.less +20 -0
- data/lib/less/js/test/less-test.js +2 -4
- data/lib/less/loader.rb +18 -30
- data/lib/less/version.rb +1 -1
- metadata +64 -55
data/.travis.yml
CHANGED
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.
|
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
|
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]) }
|
data/lib/less/js/bin/lessc
CHANGED
@@ -4,20 +4,24 @@ var path = require('path'),
|
|
4
4
|
fs = require('fs'),
|
5
5
|
sys = require('sys');
|
6
6
|
|
7
|
-
require
|
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
|
-
|
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
|
+
}
|