less-rb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -0
- data/.gitmodules +3 -0
- data/Gemfile +3 -0
- data/LICENSE +177 -0
- data/README.md +51 -0
- data/Rakefile +9 -0
- data/bin/lessc +22 -0
- data/less-rb.gemspec +30 -0
- data/lib/less-rb.rb +1 -0
- data/lib/less.rb +20 -0
- data/lib/less/compiler.js +12 -0
- data/lib/less/defaults.rb +11 -0
- data/lib/less/parser.rb +53 -0
- data/lib/less/runner.js +18 -0
- data/lib/less/version.rb +3 -0
- data/spec/less/one/one.less +1 -0
- data/spec/less/parser_spec.rb +49 -0
- data/spec/less/two/two.less +1 -0
- data/spec/spec_helper.rb +3 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3b90ce78bbd3fe9754ea7cad6badc4153e75d135
|
4
|
+
data.tar.gz: be0af8620c61660f3353dae2e92354626e617e35
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: db7a502c183be83bd9c352ed17dd2657d9c2e185c48269f14992b774f8fd32c6a55fe3222b7f2ac938cc324f8bd179f26aa9a3d44fc7bddba06ec517a23341c7
|
7
|
+
data.tar.gz: 37e6cf3c7824202c9de0d71f4ca3ca2c4df9253c7ddbfad2fb3e241c7da6f769971ad4757f247b938236c39a6fe4e9f4d9b467227a79ad6d4a10c56e02cf7752
|
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
## less-rb
|
2
|
+
|
3
|
+
less-rb allows you to compile [Less CSS files](http://lesscss.org/) from Ruby.
|
4
|
+
|
5
|
+
To install:
|
6
|
+
|
7
|
+
gem install less-rb
|
8
|
+
|
9
|
+
To use:
|
10
|
+
|
11
|
+
require 'less-rb'
|
12
|
+
Less::Parser.compile("body { background: darken(#CCC, 10%) }")
|
13
|
+
|
14
|
+
These bindings also integrate with [Tilt](https://github.com/rtomayko/tilt) and [Sprockets](https://github.com/sstephenson/sprockets), so work seamlessly with Rails.
|
15
|
+
|
16
|
+
## Requirements
|
17
|
+
|
18
|
+
[Node.js](http://nodejs.org) needs to be installed, and in the path.
|
19
|
+
|
20
|
+
## About
|
21
|
+
|
22
|
+
These are Ruby bindings for the next generation LESS, which is implemented in JavaScript.
|
23
|
+
|
24
|
+
These are separate from the [official bindings](https://github.com/cowboyd/less.rb), as they've been ported to [ExecJS](https://github.com/sstephenson/execjs). This means you don't have to re-compile v8 every deploy.
|
25
|
+
|
26
|
+
For more information, visit <http://lesscss.org>.
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
less-rb exposes the `less.Parser` constructor to ruby code via `Less::Parser`. You can instate it
|
31
|
+
context free:
|
32
|
+
|
33
|
+
parser = Less::Parser.new
|
34
|
+
|
35
|
+
or with configuration options:
|
36
|
+
|
37
|
+
parser = Less::Parser.new :paths => ['./lib', 'other/lib'], :filename => 'mystyles.less'
|
38
|
+
|
39
|
+
Once you have a parser instantiated, you can parse code to get your AST !
|
40
|
+
|
41
|
+
tree = parser.parse(".class {width: 1+1}") # => Less::Tree
|
42
|
+
tree.to_css #=> .class {\n width: 2;\n}\n
|
43
|
+
tree.to_css(:compress => true) #=> .class{width:2;}
|
44
|
+
|
45
|
+
There's a shortcut for this whole routine:
|
46
|
+
|
47
|
+
Less::Parser.compile(css, options)
|
48
|
+
|
49
|
+
## Credits
|
50
|
+
|
51
|
+
This library was ported from [less.rb](https://github.com/cowboyd/less.rb) also using the Apache License. It was created by [Alex MacCaw](http://alexmaccaw.com) ([@maccman](http://twitter.com/maccman)).
|
data/Rakefile
ADDED
data/bin/lessc
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'less'
|
4
|
+
|
5
|
+
# This file is inspired by / based off of http://ozmm.org/posts/argf.html
|
6
|
+
|
7
|
+
def help
|
8
|
+
puts <<-help
|
9
|
+
Usage:
|
10
|
+
$ lessc < style.less
|
11
|
+
$ lessc file1.less file2.less
|
12
|
+
help
|
13
|
+
end
|
14
|
+
|
15
|
+
if ($stdin.tty? && ARGV.empty?) || ARGV.delete('-h') || ARGV.delete('--help')
|
16
|
+
help
|
17
|
+
else
|
18
|
+
doc = ARGF.read
|
19
|
+
parser = Less::Parser.new
|
20
|
+
tree = parser.parse(doc)
|
21
|
+
puts tree.to_css(:compress => true)
|
22
|
+
end
|
data/less-rb.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "less/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "less-rb"
|
7
|
+
s.version = Less::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Alex MacCaw"]
|
10
|
+
s.email = ["alexmaccaw@twitter.com"]
|
11
|
+
s.homepage = "http://lesscss.org"
|
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}
|
14
|
+
|
15
|
+
s.rubyforge_project = "less-rb"
|
16
|
+
|
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)}
|
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 "execjs", "~> 1.2.13"
|
26
|
+
|
27
|
+
s.add_development_dependency "rake"
|
28
|
+
s.add_development_dependency "rspec", "~> 2.0"
|
29
|
+
end
|
30
|
+
|
data/lib/less-rb.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.expand_path('../less', __FILE__)
|
data/lib/less.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'execjs'
|
2
|
+
require 'less/parser'
|
3
|
+
require 'less/version'
|
4
|
+
require 'less/defaults'
|
5
|
+
|
6
|
+
module Less
|
7
|
+
extend Less::Defaults
|
8
|
+
|
9
|
+
def self.compile(css, options = {})
|
10
|
+
Parser.new(options).parse(css).to_css
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.bundled_path
|
14
|
+
File.expand_path('../less/js/lib', __FILE__)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Exports the `.node_modules` folder on the working directory so npm can
|
18
|
+
# require modules installed locally.
|
19
|
+
ENV['NODE_PATH'] = "#{File.expand_path('node_modules')}:#{bundled_path}:#{ENV['NODE_PATH']}"
|
20
|
+
end
|
data/lib/less/parser.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
module Less
|
2
|
+
class ParseError < StandardError; end
|
3
|
+
|
4
|
+
# Convert lesscss source into an abstract syntax Tree
|
5
|
+
class Parser
|
6
|
+
class << self
|
7
|
+
def backend
|
8
|
+
@backend ||= ExecJS::ExternalRuntime.new(
|
9
|
+
:name => 'Node.js (V8)',
|
10
|
+
:command => ["nodejs", "node"],
|
11
|
+
:runner_path => File.expand_path("../runner.js", __FILE__)
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# Construct and configure new Less::Parser
|
17
|
+
#
|
18
|
+
# @param [Hash] opts configuration options
|
19
|
+
# @option opts [Array] :paths a list of directories to search when handling \@import statements
|
20
|
+
# @option opts [String] :filename to associate with resulting parse trees (useful for generating errors)
|
21
|
+
def initialize(options = {})
|
22
|
+
@options = Less.defaults.merge(options)
|
23
|
+
@context = self.class.backend.compile(compiler_source)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Convert `less` source into a abstract syntaxt tree
|
27
|
+
# @param [String] less the source to parse
|
28
|
+
# @return [Less::Tree] the parsed tree
|
29
|
+
def parse(less)
|
30
|
+
Tree.new(less, @context, @options)
|
31
|
+
end
|
32
|
+
|
33
|
+
protected
|
34
|
+
def compiler_source
|
35
|
+
File.read(File.expand_path("../compiler.js", __FILE__))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Abstract LessCSS syntax tree Less. Mainly used to emit CSS
|
40
|
+
class Tree
|
41
|
+
def initialize(less, context, options)
|
42
|
+
@less = less
|
43
|
+
@context = context
|
44
|
+
@options = options
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_css(options = {})
|
48
|
+
@result ||= @context.call("render", @less, @options.merge(options))
|
49
|
+
rescue ExecJS::ProgramError => e
|
50
|
+
raise ParseError.new(e.message)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/less/runner.js
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
(function(program, execJS) { execJS(program) })(function(callback) { #{source}
|
2
|
+
}, function(program) {
|
3
|
+
var output, print = function(string) {
|
4
|
+
process.stdout.write('' + string);
|
5
|
+
};
|
6
|
+
|
7
|
+
program(function(err, result){
|
8
|
+
if (err) {
|
9
|
+
print(JSON.stringify(['err', err.message]));
|
10
|
+
} else {
|
11
|
+
if (typeof result == 'undefined' && result !== null) {
|
12
|
+
print('["ok"]');
|
13
|
+
} else {
|
14
|
+
print(JSON.stringify(['ok', result]));
|
15
|
+
}
|
16
|
+
}
|
17
|
+
});
|
18
|
+
});
|
data/lib/less/version.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.one {width: 1;}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Less::Parser do
|
4
|
+
|
5
|
+
cwd = Pathname(__FILE__).dirname
|
6
|
+
|
7
|
+
describe "simple usage" do
|
8
|
+
it "parse less into a tree" do
|
9
|
+
root = subject.parse(".class {width: 1+1}")
|
10
|
+
root.to_css.gsub(/\n/,'').should eql ".class { width: 2;}"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "accepts options when assembling the parse tree" do
|
14
|
+
subject.parse(".class {width: 1+1}").to_css(:compress => true).strip.should eql ".class{width:2;}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
it "throws a ParseError if the lesscss is bogus" do
|
19
|
+
expect {subject.parse('{^)').to_css}.should raise_error(Less::ParseError)
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "when configured with multiple load paths" do
|
23
|
+
before {
|
24
|
+
@parser = Less::Parser.new(:paths => [cwd.join('one').to_s, cwd.join('two').to_s])
|
25
|
+
}
|
26
|
+
|
27
|
+
it "will load files from both paths" do
|
28
|
+
@parser.parse('@import "one.less";').to_css.gsub(/\n/,'').strip.should eql ".one { width: 1;}"
|
29
|
+
@parser.parse('@import "two.less";').to_css.gsub(/\n/,'').strip.should eql ".two { width: 1;}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "when load paths are specified in as default options" do
|
34
|
+
before do
|
35
|
+
Less.paths << cwd.join('one').to_s
|
36
|
+
Less.paths << cwd.join('two').to_s
|
37
|
+
@parser = Less::Parser.new
|
38
|
+
end
|
39
|
+
after do
|
40
|
+
Less.paths.clear
|
41
|
+
end
|
42
|
+
|
43
|
+
it "will load files from default load paths" do
|
44
|
+
@parser.parse('@import "one.less";').to_css.gsub(/\n/,'').strip.should eql ".one { width: 1;}"
|
45
|
+
@parser.parse('@import "two.less";').to_css.gsub(/\n/,'').strip.should eql ".two { width: 1;}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
.two {width: 1;}
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: less-rb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alex MacCaw
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: execjs
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.2.13
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.2.13
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
55
|
+
description: Invoke the Less CSS compiler from Ruby
|
56
|
+
email:
|
57
|
+
- alexmaccaw@twitter.com
|
58
|
+
executables:
|
59
|
+
- lessc
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".gitmodules"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/lessc
|
70
|
+
- less-rb.gemspec
|
71
|
+
- lib/less-rb.rb
|
72
|
+
- lib/less.rb
|
73
|
+
- lib/less/compiler.js
|
74
|
+
- lib/less/defaults.rb
|
75
|
+
- lib/less/parser.rb
|
76
|
+
- lib/less/runner.js
|
77
|
+
- lib/less/version.rb
|
78
|
+
- spec/less/one/one.less
|
79
|
+
- spec/less/parser_spec.rb
|
80
|
+
- spec/less/two/two.less
|
81
|
+
- spec/spec_helper.rb
|
82
|
+
homepage: http://lesscss.org
|
83
|
+
licenses: []
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project: less-rb
|
101
|
+
rubygems_version: 2.5.1
|
102
|
+
signing_key:
|
103
|
+
specification_version: 4
|
104
|
+
summary: Leaner CSS, in your browser or Ruby (via less.js)
|
105
|
+
test_files: []
|