less 2.0.10 → 2.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/lib/less/loader.rb CHANGED
@@ -29,6 +29,10 @@ module Less
29
29
  def dirname(path)
30
30
  File.dirname(path)
31
31
  end
32
+
33
+ def basename(path)
34
+ File.basename(path)
35
+ end
32
36
  end
33
37
 
34
38
  class Sys
data/lib/less/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Less
2
- VERSION = '2.0.10'
2
+ VERSION = '2.0.11'
3
3
  end
@@ -0,0 +1,3 @@
1
+ body {
2
+ color: @a;
3
+ }
@@ -14,17 +14,27 @@ describe Less::Parser do
14
14
  subject.parse(".class {width: 1+1}").to_css(:compress => true).strip.should eql ".class{width:2;}"
15
15
  end
16
16
  end
17
+
17
18
  it "throws a ParseError if the lesscss is bogus" do
18
19
  expect {subject.parse('{^)')}.should raise_error(Less::ParseError)
19
20
  end
20
21
 
22
+ it "passes exceptions from the less compiler" do
23
+ expect {subject.parse('body { color: @a; }').to_css}.should raise_error(Less::ParseError, /variable @a is undefined/)
24
+ end
25
+
21
26
  describe "when configured with multiple load paths" do
22
- before {@parser = Less::Parser.new :paths => [cwd.join('one'), cwd.join('two')]}
27
+ subject {Less::Parser.new :paths => [cwd.join('one'), cwd.join('two'), cwd.join('faulty')]}
23
28
 
24
29
  it "will load files from both paths" do
25
- @parser.parse('@import "one.less";').to_css.gsub(/\n/,'').strip.should eql ".one { width: 1;}"
26
- @parser.parse('@import "two.less";').to_css.gsub(/\n/,'').strip.should eql ".two { width: 1;}"
30
+ subject.parse('@import "one.less";').to_css.gsub(/\n/,'').strip.should eql ".one { width: 1;}"
31
+ subject.parse('@import "two.less";').to_css.gsub(/\n/,'').strip.should eql ".two { width: 1;}"
32
+ end
33
+
34
+ it "passes exceptions from less imported less files" do
35
+ expect {subject.parse('@import "faulty.less";').to_css}.should raise_error(Less::ParseError, /variable @a is undefined/)
27
36
  end
37
+
28
38
  end
29
39
 
30
40
  describe "when load paths are specified in as default options" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: less
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.10
4
+ version: 2.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-10 00:00:00.000000000 Z
12
+ date: 2012-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: therubyracer
16
- requirement: &2156079620 !ruby/object:Gem::Requirement
16
+ requirement: &2152292600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.9.9
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156079620
24
+ version_requirements: *2152292600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: commonjs
27
- requirement: &2156078880 !ruby/object:Gem::Requirement
27
+ requirement: &2152336920 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.2.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2156078880
35
+ version_requirements: *2152336920
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &2156077340 !ruby/object:Gem::Requirement
38
+ requirement: &2152348120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2156077340
46
+ version_requirements: *2152348120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2156165280 !ruby/object:Gem::Requirement
49
+ requirement: &2152381220 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '2.0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2156165280
57
+ version_requirements: *2152381220
58
58
  description: Invoke the Less CSS compiler from Ruby
59
59
  email:
60
60
  - cowboyd@thefrontside.net
@@ -76,6 +76,7 @@ files:
76
76
  - lib/less/loader.rb
77
77
  - lib/less/parser.rb
78
78
  - lib/less/version.rb
79
+ - spec/less/faulty/faulty.less
79
80
  - spec/less/one/one.less
80
81
  - spec/less/parser_spec.rb
81
82
  - spec/less/two/two.less
@@ -355,7 +356,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
355
356
  version: '0'
356
357
  segments:
357
358
  - 0
358
- hash: 539538396847452201
359
+ hash: -4502537437615116696
359
360
  required_rubygems_version: !ruby/object:Gem::Requirement
360
361
  none: false
361
362
  requirements:
@@ -364,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
365
  version: '0'
365
366
  segments:
366
367
  - 0
367
- hash: 539538396847452201
368
+ hash: -4502537437615116696
368
369
  requirements: []
369
370
  rubyforge_project: less
370
371
  rubygems_version: 1.8.17
@@ -372,6 +373,7 @@ signing_key:
372
373
  specification_version: 3
373
374
  summary: Leaner CSS, in your browser or Ruby (via less.js)
374
375
  test_files:
376
+ - spec/less/faulty/faulty.less
375
377
  - spec/less/one/one.less
376
378
  - spec/less/parser_spec.rb
377
379
  - spec/less/two/two.less