less 1.2.21 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -3
- data/.gitmodules +6 -0
- data/Gemfile +3 -0
- data/README.md +39 -46
- data/Rakefile +5 -50
- data/bin/lessc +1 -100
- data/less.gemspec +21 -125
- data/lib/less.rb +11 -30
- data/{LICENSE → lib/less/js/LICENSE} +1 -1
- data/lib/less/js/Makefile +56 -0
- data/lib/less/js/README.md +20 -0
- data/lib/less/js/benchmark/benchmark.less +3979 -0
- data/lib/less/js/benchmark/less-benchmark.js +49 -0
- data/lib/less/js/bin/lessc +105 -0
- data/lib/less/js/build/ecma-5.js +120 -0
- data/lib/less/js/build/header.js +7 -0
- data/lib/less/js/build/require.js +7 -0
- data/lib/less/js/dist/less-1.0.44.js +2655 -0
- data/lib/less/js/dist/less-1.1.0.js +2695 -0
- data/lib/less/js/dist/less-1.1.0.min.js +16 -0
- data/lib/less/js/dist/less-1.1.1.js +2710 -0
- data/lib/less/js/dist/less-1.1.1.min.js +16 -0
- data/lib/less/js/dist/less-1.1.2.js +2712 -0
- data/lib/less/js/dist/less-1.1.2.min.js +16 -0
- data/lib/less/js/dist/less-1.1.3.js +2721 -0
- data/lib/less/js/dist/less-1.1.3.min.js +16 -0
- data/lib/less/js/lib/less/browser.js +369 -0
- data/lib/less/js/lib/less/functions.js +174 -0
- data/lib/less/js/lib/less/index.js +137 -0
- data/lib/less/js/lib/less/parser.js +1098 -0
- data/lib/less/js/lib/less/tree.js +13 -0
- data/lib/less/js/lib/less/tree/alpha.js +17 -0
- data/lib/less/js/lib/less/tree/anonymous.js +13 -0
- data/lib/less/js/lib/less/tree/call.js +45 -0
- data/lib/less/js/lib/less/tree/color.js +98 -0
- data/lib/less/js/lib/less/tree/comment.js +14 -0
- data/lib/less/js/lib/less/tree/dimension.js +34 -0
- data/lib/less/js/lib/less/tree/directive.js +33 -0
- data/lib/less/js/lib/less/tree/element.js +32 -0
- data/lib/less/js/lib/less/tree/expression.js +23 -0
- data/lib/less/js/lib/less/tree/import.js +77 -0
- data/lib/less/js/lib/less/tree/javascript.js +51 -0
- data/lib/less/js/lib/less/tree/keyword.js +9 -0
- data/lib/less/js/lib/less/tree/mixin.js +106 -0
- data/lib/less/js/lib/less/tree/operation.js +32 -0
- data/lib/less/js/lib/less/tree/quoted.js +29 -0
- data/lib/less/js/lib/less/tree/rule.js +38 -0
- data/lib/less/js/lib/less/tree/ruleset.js +179 -0
- data/lib/less/js/lib/less/tree/selector.js +28 -0
- data/lib/less/js/lib/less/tree/url.js +25 -0
- data/lib/less/js/lib/less/tree/value.js +24 -0
- data/lib/less/js/lib/less/tree/variable.js +24 -0
- data/lib/less/js/package.json +13 -0
- data/lib/less/js/test/css/colors.css +42 -0
- data/lib/less/js/test/css/comments.css +52 -0
- data/lib/less/js/test/css/css-3.css +42 -0
- data/lib/less/js/test/css/css-escapes.css +20 -0
- data/lib/less/js/test/css/css.css +82 -0
- data/lib/less/js/test/css/functions.css +30 -0
- data/{spec → lib/less/js/test}/css/import.css +4 -2
- data/lib/less/js/test/css/javascript.css +22 -0
- data/lib/less/js/test/css/lazy-eval.css +3 -0
- data/lib/less/js/test/css/media.css +21 -0
- data/lib/less/js/test/css/mixins-args.css +61 -0
- data/lib/less/js/test/css/mixins-closure.css +9 -0
- data/lib/less/js/test/css/mixins-nested.css +14 -0
- data/lib/less/js/test/css/mixins-pattern.css +49 -0
- data/lib/less/js/test/css/mixins.css +50 -0
- data/{spec → lib/less/js/test}/css/operations.css +20 -2
- data/{spec → lib/less/js/test}/css/parens.css +0 -0
- data/lib/less/js/test/css/rulesets.css +29 -0
- data/{spec → lib/less/js/test}/css/scope.css +6 -2
- data/lib/less/js/test/css/selectors.css +32 -0
- data/lib/less/js/test/css/strings.css +38 -0
- data/lib/less/js/test/css/variables.css +24 -0
- data/lib/less/js/test/css/whitespace.css +36 -0
- data/lib/less/js/test/less-test.js +75 -0
- data/{spec → lib/less/js/test}/less/colors.less +13 -2
- data/{spec → lib/less/js/test}/less/comments.less +19 -2
- data/{spec → lib/less/js/test}/less/css-3.less +4 -1
- data/lib/less/js/test/less/css-escapes.less +28 -0
- data/{spec → lib/less/js/test}/less/css.less +10 -18
- data/lib/less/js/test/less/functions.less +35 -0
- data/{spec → lib/less/js/test}/less/import.less +1 -1
- data/{spec → lib/less/js/test}/less/import/import-test-a.less +0 -0
- data/{spec → lib/less/js/test}/less/import/import-test-b.less +0 -0
- data/{spec → lib/less/js/test}/less/import/import-test-c.less +0 -0
- data/{spec → lib/less/js/test}/less/import/import-test-d.css +0 -0
- data/lib/less/js/test/less/javascript.less +27 -0
- data/{spec → lib/less/js/test}/less/lazy-eval.less +0 -0
- data/lib/less/js/test/less/media.less +25 -0
- data/lib/less/js/test/less/mixins-args.less +118 -0
- data/lib/less/js/test/less/mixins-closure.less +26 -0
- data/lib/less/js/test/less/mixins-nested.less +22 -0
- data/lib/less/js/test/less/mixins-pattern.less +96 -0
- data/{spec → lib/less/js/test}/less/mixins.less +8 -4
- data/{spec → lib/less/js/test}/less/operations.less +19 -0
- data/{spec → lib/less/js/test}/less/parens.less +0 -0
- data/{spec → lib/less/js/test}/less/rulesets.less +2 -2
- data/{spec → lib/less/js/test}/less/scope.less +1 -1
- data/{spec → lib/less/js/test}/less/selectors.less +1 -1
- data/lib/less/js/test/less/strings.less +49 -0
- data/lib/less/js/test/less/variables.less +50 -0
- data/{spec → lib/less/js/test}/less/whitespace.less +3 -0
- data/lib/less/loader.rb +67 -0
- data/lib/less/parser.rb +46 -0
- data/lib/less/version.rb +3 -0
- data/spec/less/one/one.less +1 -0
- data/spec/less/parser_spec.rb +30 -0
- data/spec/less/two/two.less +1 -0
- data/spec/spec_helper.rb +2 -7
- metadata +156 -106
- data/CHANGELOG +0 -62
- data/VERSION +0 -1
- data/lib/less/command.rb +0 -110
- data/lib/less/engine.rb +0 -52
- data/lib/less/engine/grammar/common.tt +0 -29
- data/lib/less/engine/grammar/entity.tt +0 -144
- data/lib/less/engine/grammar/less.tt +0 -341
- data/lib/less/engine/nodes.rb +0 -9
- data/lib/less/engine/nodes/element.rb +0 -281
- data/lib/less/engine/nodes/entity.rb +0 -79
- data/lib/less/engine/nodes/function.rb +0 -93
- data/lib/less/engine/nodes/literal.rb +0 -171
- data/lib/less/engine/nodes/property.rb +0 -232
- data/lib/less/engine/nodes/ruleset.rb +0 -12
- data/lib/less/engine/nodes/selector.rb +0 -44
- data/lib/less/ext.rb +0 -60
- data/spec/command_spec.rb +0 -102
- data/spec/css/accessors.css +0 -18
- data/spec/css/big.css +0 -3768
- data/spec/css/colors.css +0 -14
- data/spec/css/comments.css +0 -9
- data/spec/css/css-3.css +0 -21
- data/spec/css/css.css +0 -50
- data/spec/css/dash-prefix.css +0 -12
- data/spec/css/functions.css +0 -6
- data/spec/css/import-with-extra-paths.css +0 -8
- data/spec/css/import-with-partial-in-extra-path.css +0 -6
- data/spec/css/lazy-eval.css +0 -1
- data/spec/css/mixins-args.css +0 -32
- data/spec/css/mixins.css +0 -28
- data/spec/css/rulesets.css +0 -17
- data/spec/css/selectors.css +0 -13
- data/spec/css/strings.css +0 -12
- data/spec/css/variables.css +0 -8
- data/spec/css/whitespace.css +0 -7
- data/spec/engine_spec.rb +0 -127
- data/spec/less/accessors.less +0 -20
- data/spec/less/big.less +0 -1264
- data/spec/less/dash-prefix.less +0 -21
- data/spec/less/exceptions/mixed-units-error.less +0 -3
- data/spec/less/exceptions/name-error-1.0.less +0 -3
- data/spec/less/exceptions/syntax-error-1.0.less +0 -3
- data/spec/less/extra_import_path/extra.less +0 -1
- data/spec/less/extra_import_path/import/import-test-a.css +0 -1
- data/spec/less/extra_import_path/import/import-test-a.less +0 -4
- data/spec/less/functions.less +0 -6
- data/spec/less/hidden.less +0 -25
- data/spec/less/import-with-extra-paths.less +0 -4
- data/spec/less/literal-css.less +0 -11
- data/spec/less/mixins-args.less +0 -59
- data/spec/less/strings.less +0 -14
- data/spec/less/variables.less +0 -29
- data/spec/spec.css +0 -50
data/.gitignore
CHANGED
data/.gitmodules
ADDED
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -1,48 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
It's time CSS was done right – LESS is _leaner_ css.
|
1
|
+
less.rb
|
2
|
+
=======
|
4
3
|
|
5
|
-
|
4
|
+
The **dynamic** stylesheet language.
|
5
|
+
|
6
|
+
<http://lesscss.org>
|
7
|
+
|
8
|
+
about
|
9
|
+
-----
|
10
|
+
|
11
|
+
These are Ruby bindings for the next generation LESS, which is implemented in JavaScript
|
12
|
+
|
13
|
+
For more information, visit <http://lesscss.org>.
|
14
|
+
|
15
|
+
usage
|
6
16
|
------
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
.article a { text-decoration: none }
|
33
|
-
.article p { color: #110011 }
|
34
|
-
.article { border: 30px solid black }
|
35
|
-
|
36
|
-
If you have CSS nightmares, just
|
37
|
-
$ lessc style.less
|
38
|
-
|
39
|
-
For more information, see you at <http://lesscss.org>
|
40
|
-
|
41
|
-
People without whom this wouldn't have happened a.k.a *Credits*
|
42
|
-
---------------------------------------------------------------
|
43
|
-
|
44
|
-
- **Dmitry Fadeyev**, for pushing me to do this, and designing our awesome website
|
45
|
-
- **August Lilleaas**, for initiating the work on the treetop grammar, as well as writing the rails plugin
|
46
|
-
- **Nathan Sobo**, for creating treetop
|
47
|
-
- **Jason Garber**, for his magical performance optimizations on treetop
|
48
|
-
- And finally, the people of #ruby-lang for answering all my ruby questions. **apeiros**, **manveru** and **rue** come to mind
|
17
|
+
|
18
|
+
less.rb exposes the `less.Parser` constructor to ruby code via `Less::Parser`. You can instate it
|
19
|
+
context free:
|
20
|
+
|
21
|
+
parser = Less::Parser.new
|
22
|
+
|
23
|
+
or with configuration options:
|
24
|
+
|
25
|
+
parser = Less::Parser.new :paths => ['./lib', 'other/lib'], :filename => 'mystyles.less'
|
26
|
+
|
27
|
+
Once you have a parser instantiated, you can parse code to get your AST !
|
28
|
+
|
29
|
+
tree = parser.parse(".class {width: 1+1}") # => Less::Tree
|
30
|
+
tree.to_css #=> .class {\n width: 2;\n}\n
|
31
|
+
tree.to_css(:compress => true) #=> .class{width:2;}
|
32
|
+
|
33
|
+
license
|
34
|
+
-------
|
35
|
+
|
36
|
+
less.rb is licensed under the same terms as less.js
|
37
|
+
|
38
|
+
See `lib/js/LICENSE` file.
|
39
|
+
|
40
|
+
|
41
|
+
> copyright 2011 Charles Lowell
|
data/Rakefile
CHANGED
@@ -1,52 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
s.name = "less"
|
5
|
-
s.authors = ["cloudhead"]
|
6
|
-
s.email = "self@cloudhead.net"
|
7
|
-
s.summary = "LESS compiler"
|
8
|
-
s.homepage = "http://www.lesscss.org"
|
9
|
-
s.description = "LESS is leaner CSS"
|
10
|
-
s.rubyforge_project = 'less'
|
11
|
-
s.add_dependency('treetop', '>= 1.4.2')
|
12
|
-
s.add_dependency('mutter', '>= 0.4.2')
|
13
|
-
end
|
14
|
-
Jeweler::GemcutterTasks.new
|
15
|
-
rescue LoadError
|
16
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
17
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require "rspec/core/rake_task"
|
18
4
|
|
19
|
-
|
5
|
+
Bundler::GemHelper.install_tasks
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
20
7
|
|
21
|
-
Spec::Rake::SpecTask.new("spec") do |t|
|
22
|
-
t.libs << 'lib' << 'spec'
|
23
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
24
|
-
t.spec_opts = ['--color', '--format=specdoc']
|
25
|
-
end
|
26
|
-
|
27
|
-
task :test do
|
28
|
-
Rake::Task['spec'].invoke
|
29
|
-
end
|
30
|
-
|
31
|
-
begin
|
32
|
-
require 'lib/less'
|
33
|
-
require 'benchmark'
|
34
|
-
|
35
|
-
task :compile do
|
36
|
-
abort "compiling isn't necessary anymore."
|
37
|
-
puts "compiling #{LESS_GRAMMAR.split('/').last}..."
|
38
|
-
File.open(LESS_PARSER, 'w') {|f| f.write Treetop::Compiler::GrammarCompiler.new.ruby_source(LESS_GRAMMAR) }
|
39
|
-
end
|
40
|
-
|
41
|
-
task :benchmark do
|
42
|
-
less = File.read("spec/less/big.less")
|
43
|
-
result = nil
|
44
|
-
Benchmark.bmbm do |b|
|
45
|
-
b.report("parse: ") { result = Less::Engine.new(less).parse(false) }
|
46
|
-
b.report("build: ") { result = result.build(Less::Node::Element.new) }
|
47
|
-
b.report("compile:") { result.to_css }
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
task :default => :spec
|
data/bin/lessc
CHANGED
@@ -1,102 +1,3 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require 'optparse'
|
6
|
-
require 'rubygems'
|
7
|
-
require 'less'
|
8
|
-
|
9
|
-
begin
|
10
|
-
require 'growl'
|
11
|
-
rescue LoadError
|
12
|
-
Less::GROWL = false
|
13
|
-
else
|
14
|
-
Less::GROWL = true
|
15
|
-
end
|
16
|
-
|
17
|
-
# Argument defaults
|
18
|
-
options = {
|
19
|
-
:watch => false,
|
20
|
-
:compress => false,
|
21
|
-
:debug => false,
|
22
|
-
:growl => false,
|
23
|
-
:timestamps => false,
|
24
|
-
:color => $stdout.tty?
|
25
|
-
}
|
26
|
-
|
27
|
-
# Get arguments
|
28
|
-
opts = OptionParser.new do |o|
|
29
|
-
o.banner = "usage: lessc source [destination] [--watch]"
|
30
|
-
o.separator ""
|
31
|
-
|
32
|
-
# Watch mode
|
33
|
-
o.on("-w", "--watch", "watch for changes") do
|
34
|
-
options[:watch] = true
|
35
|
-
end
|
36
|
-
|
37
|
-
# Growl
|
38
|
-
o.on("-g", "--growl", "growl notifications") do
|
39
|
-
if Less::GROWL && (Growl.installed? rescue false)
|
40
|
-
options[:growl] = true
|
41
|
-
elsif Less::GROWL
|
42
|
-
abort "Growl or 'growlnotify' wasn't found on your system."
|
43
|
-
else
|
44
|
-
abort "Growl gem not found, please install with: " +
|
45
|
-
"`sudo gem install visionmedia-growl -s http://gems.github.com`"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Timestamps
|
50
|
-
o.on("-t", "--timestamps", "show timestamps in watch mode") do
|
51
|
-
options[:timestamps] = true
|
52
|
-
end
|
53
|
-
|
54
|
-
# No color in output
|
55
|
-
o.on("--no-color", "suppress color in output") do
|
56
|
-
options[:color] = false
|
57
|
-
end
|
58
|
-
|
59
|
-
o.on('--verbose', 'show success messages when using growl') do
|
60
|
-
options[:verbose] = true
|
61
|
-
end
|
62
|
-
|
63
|
-
# Compression needs a proper algorithm
|
64
|
-
#
|
65
|
-
# o.on("-x", "--compress", "compress css file") do
|
66
|
-
# options[:compress] = true
|
67
|
-
# end
|
68
|
-
|
69
|
-
o.separator ""
|
70
|
-
|
71
|
-
# Help
|
72
|
-
o.on_tail("-h", "--help", "show this message") do
|
73
|
-
puts opts
|
74
|
-
exit
|
75
|
-
end
|
76
|
-
|
77
|
-
o.on_tail("-d", "--debug", "show full error messages") do
|
78
|
-
options[:debug] = true
|
79
|
-
end
|
80
|
-
|
81
|
-
# Version
|
82
|
-
o.on_tail("-v", "--version", "show version") do
|
83
|
-
puts "lessc " + Less.version
|
84
|
-
exit
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
opts.parse! # Parse arguments into `options` hash
|
89
|
-
|
90
|
-
# Get source and destintation from command line
|
91
|
-
case ARGV.size
|
92
|
-
when 1
|
93
|
-
options[:source] = ARGV[ 0 ]
|
94
|
-
when 2
|
95
|
-
options[:source] = ARGV[ 0 ]
|
96
|
-
options[:destination] = ARGV[ 1 ]
|
97
|
-
else
|
98
|
-
puts opts
|
99
|
-
exit
|
100
|
-
end
|
101
|
-
|
102
|
-
Less::Command.new( options ).run! ? exit(0) : exit(1)
|
3
|
+
puts "yeah."
|
data/less.gemspec
CHANGED
@@ -1,133 +1,29 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "less/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
6
|
+
s.name = "less"
|
7
|
+
s.version = Less::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Charles Lowell"]
|
10
|
+
s.email = ["cowboyd@thefrontside.net"]
|
11
|
+
s.homepage = "http://github.com/cowboyd/less.rb"
|
12
|
+
s.summary = %q{Leaner CSS, in your browser or Ruby (via less.js)}
|
13
|
+
s.description = %q{Invoke the Less CSS compiler from Ruby (http://lesscss.org)}
|
9
14
|
|
10
|
-
s.
|
11
|
-
s.authors = ["cloudhead"]
|
12
|
-
s.date = %q{2010-01-13}
|
13
|
-
s.default_executable = %q{lessc}
|
14
|
-
s.description = %q{LESS is leaner CSS}
|
15
|
-
s.email = %q{self@cloudhead.net}
|
16
|
-
s.executables = ["lessc"]
|
17
|
-
s.extra_rdoc_files = [
|
18
|
-
"LICENSE",
|
19
|
-
"README.md"
|
20
|
-
]
|
21
|
-
s.files = [
|
22
|
-
".gitignore",
|
23
|
-
"CHANGELOG",
|
24
|
-
"LICENSE",
|
25
|
-
"README.md",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"bin/lessc",
|
29
|
-
"less.gemspec",
|
30
|
-
"lib/less.rb",
|
31
|
-
"lib/less/command.rb",
|
32
|
-
"lib/less/engine.rb",
|
33
|
-
"lib/less/engine/grammar/common.tt",
|
34
|
-
"lib/less/engine/grammar/entity.tt",
|
35
|
-
"lib/less/engine/grammar/less.tt",
|
36
|
-
"lib/less/engine/nodes.rb",
|
37
|
-
"lib/less/engine/nodes/element.rb",
|
38
|
-
"lib/less/engine/nodes/entity.rb",
|
39
|
-
"lib/less/engine/nodes/function.rb",
|
40
|
-
"lib/less/engine/nodes/literal.rb",
|
41
|
-
"lib/less/engine/nodes/property.rb",
|
42
|
-
"lib/less/engine/nodes/ruleset.rb",
|
43
|
-
"lib/less/engine/nodes/selector.rb",
|
44
|
-
"lib/less/ext.rb",
|
45
|
-
"spec/command_spec.rb",
|
46
|
-
"spec/css/accessors.css",
|
47
|
-
"spec/css/big.css",
|
48
|
-
"spec/css/colors.css",
|
49
|
-
"spec/css/comments.css",
|
50
|
-
"spec/css/css-3.css",
|
51
|
-
"spec/css/css.css",
|
52
|
-
"spec/css/dash-prefix.css",
|
53
|
-
"spec/css/functions.css",
|
54
|
-
"spec/css/import-with-extra-paths.css",
|
55
|
-
"spec/css/import-with-partial-in-extra-path.css",
|
56
|
-
"spec/css/import.css",
|
57
|
-
"spec/css/lazy-eval.css",
|
58
|
-
"spec/css/mixins-args.css",
|
59
|
-
"spec/css/mixins.css",
|
60
|
-
"spec/css/operations.css",
|
61
|
-
"spec/css/parens.css",
|
62
|
-
"spec/css/rulesets.css",
|
63
|
-
"spec/css/scope.css",
|
64
|
-
"spec/css/selectors.css",
|
65
|
-
"spec/css/strings.css",
|
66
|
-
"spec/css/variables.css",
|
67
|
-
"spec/css/whitespace.css",
|
68
|
-
"spec/engine_spec.rb",
|
69
|
-
"spec/less/accessors.less",
|
70
|
-
"spec/less/big.less",
|
71
|
-
"spec/less/colors.less",
|
72
|
-
"spec/less/comments.less",
|
73
|
-
"spec/less/css-3.less",
|
74
|
-
"spec/less/css.less",
|
75
|
-
"spec/less/dash-prefix.less",
|
76
|
-
"spec/less/exceptions/mixed-units-error.less",
|
77
|
-
"spec/less/exceptions/name-error-1.0.less",
|
78
|
-
"spec/less/exceptions/syntax-error-1.0.less",
|
79
|
-
"spec/less/extra_import_path/extra.less",
|
80
|
-
"spec/less/extra_import_path/import/import-test-a.css",
|
81
|
-
"spec/less/extra_import_path/import/import-test-a.less",
|
82
|
-
"spec/less/functions.less",
|
83
|
-
"spec/less/hidden.less",
|
84
|
-
"spec/less/import-with-extra-paths.less",
|
85
|
-
"spec/less/import.less",
|
86
|
-
"spec/less/import/import-test-a.less",
|
87
|
-
"spec/less/import/import-test-b.less",
|
88
|
-
"spec/less/import/import-test-c.less",
|
89
|
-
"spec/less/import/import-test-d.css",
|
90
|
-
"spec/less/lazy-eval.less",
|
91
|
-
"spec/less/literal-css.less",
|
92
|
-
"spec/less/mixins-args.less",
|
93
|
-
"spec/less/mixins.less",
|
94
|
-
"spec/less/operations.less",
|
95
|
-
"spec/less/parens.less",
|
96
|
-
"spec/less/rulesets.less",
|
97
|
-
"spec/less/scope.less",
|
98
|
-
"spec/less/selectors.less",
|
99
|
-
"spec/less/strings.less",
|
100
|
-
"spec/less/variables.less",
|
101
|
-
"spec/less/whitespace.less",
|
102
|
-
"spec/spec.css",
|
103
|
-
"spec/spec_helper.rb"
|
104
|
-
]
|
105
|
-
s.homepage = %q{http://www.lesscss.org}
|
106
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
107
|
-
s.require_paths = ["lib"]
|
108
|
-
s.rubyforge_project = %q{less}
|
109
|
-
s.rubygems_version = %q{1.3.5}
|
110
|
-
s.summary = %q{LESS compiler}
|
111
|
-
s.test_files = [
|
112
|
-
"spec/command_spec.rb",
|
113
|
-
"spec/engine_spec.rb",
|
114
|
-
"spec/spec_helper.rb"
|
115
|
-
]
|
116
|
-
|
117
|
-
if s.respond_to? :specification_version then
|
118
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
119
|
-
s.specification_version = 3
|
15
|
+
s.rubyforge_project = "less"
|
120
16
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
else
|
125
|
-
s.add_dependency(%q<treetop>, [">= 1.4.2"])
|
126
|
-
s.add_dependency(%q<mutter>, [">= 0.4.2"])
|
127
|
-
end
|
128
|
-
else
|
129
|
-
s.add_dependency(%q<treetop>, [">= 1.4.2"])
|
130
|
-
s.add_dependency(%q<mutter>, [">= 0.4.2"])
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
Dir.chdir('lib/less/js') do
|
19
|
+
s.files += `git ls-files`.split("\n").map {|f| File.join('lib/less/js',f)}
|
131
20
|
end
|
21
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
22
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
|
25
|
+
s.add_dependency "therubyracer", "~> 0.9.0beta6"
|
26
|
+
s.add_development_dependency "rake", "~> 0.9.1"
|
27
|
+
s.add_development_dependency "rspec", "~> 2.0"
|
132
28
|
end
|
133
29
|
|
data/lib/less.rb
CHANGED
@@ -1,36 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'mutter'
|
4
|
-
require 'delegate'
|
5
|
-
|
6
|
-
LESS_ROOT = File.expand_path(File.dirname(__FILE__))
|
7
|
-
LESS_PARSER = File.join(LESS_ROOT, 'less', 'engine', 'parser.rb')
|
8
|
-
LESS_GRAMMAR = File.join(LESS_ROOT, 'less', 'engine', 'grammar')
|
9
|
-
|
10
|
-
$LESS_LOAD_PATH = []
|
11
|
-
|
12
|
-
$:.unshift File.dirname(__FILE__)
|
13
|
-
|
14
|
-
require 'less/ext'
|
15
|
-
require 'less/command'
|
16
|
-
require 'less/engine'
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
17
3
|
|
18
4
|
module Less
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
SyntaxError = Class.new(RuntimeError)
|
24
|
-
ImportError = Class.new(RuntimeError)
|
25
|
-
CompileError = Class.new(RuntimeError)
|
5
|
+
require 'v8'
|
6
|
+
require 'less/parser'
|
7
|
+
require 'less/loader'
|
8
|
+
require 'less/version'
|
26
9
|
|
27
|
-
|
10
|
+
@loader = Less::Loader.new
|
11
|
+
@less = @loader.require('less/index')
|
28
12
|
|
29
|
-
def self.
|
30
|
-
|
13
|
+
def self.Parser
|
14
|
+
@less['Parser']
|
31
15
|
end
|
32
16
|
|
33
|
-
|
34
|
-
Engine.new(less).to_css
|
35
|
-
end
|
36
|
-
end
|
17
|
+
end
|