less 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - ree
5
+ notifications:
6
+ recipients:
7
+ - cowboyd@thefrontside.net
data/Rakefile CHANGED
@@ -5,3 +5,5 @@ require "rspec/core/rake_task"
5
5
  Bundler::GemHelper.install_tasks
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
+ task :default => :spec
9
+
@@ -21,9 +21,10 @@ Gem::Specification.new do |s|
21
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
23
  s.require_paths = ["lib"]
24
-
24
+
25
25
  s.add_dependency "therubyracer", "~> 0.9.2"
26
- s.add_development_dependency "rake", "~> 0.9.2"
26
+
27
+ s.add_development_dependency "rake"
27
28
  s.add_development_dependency "rspec", "~> 2.0"
28
29
  end
29
30
 
@@ -1,13 +1,12 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
1
+ require 'v8'
2
+ require 'pathname'
3
+ require 'less/parser'
4
+ require 'less/loader'
5
+ require 'less/version'
6
+ require 'less/defaults'
3
7
 
4
8
  module Less
5
-
6
- require 'v8'
7
- require 'pathname'
8
- require 'less/parser'
9
- require 'less/loader'
10
- require 'less/version'
9
+ extend Less::Defaults
11
10
 
12
11
  @loader = Less::Loader.new
13
12
  @less = @loader.require('less/index')
@@ -0,0 +1,13 @@
1
+
2
+ module Less
3
+ module Defaults
4
+
5
+ def defaults
6
+ @defaults ||= {:paths => []}
7
+ end
8
+
9
+ def paths
10
+ defaults[:paths]
11
+ end
12
+ end
13
+ end
@@ -48,7 +48,7 @@ module Less
48
48
  # @option opts [String] :filename to associate with resulting parse trees (useful for generating errors)
49
49
  def initialize(options = {})
50
50
  stringy = {}
51
- options.each do |k,v|
51
+ Less.defaults.merge(options).each do |k,v|
52
52
  stringy[k.to_s] = v.is_a?(Array) ? v.map(&:to_s) : v.to_s
53
53
  end
54
54
  lock do
@@ -1,3 +1,3 @@
1
1
  module Less
2
- VERSION = '2.0.6'
2
+ VERSION = '2.0.7'
3
3
  end
@@ -18,7 +18,7 @@ describe Less::Parser do
18
18
  expect {subject.parse('{^)')}.should raise_error(Less::ParseError)
19
19
  end
20
20
 
21
- describe "when configured with mulitple load paths" do
21
+ describe "when configured with multiple load paths" do
22
22
  before {@parser = Less::Parser.new :paths => [cwd.join('one'), cwd.join('two')]}
23
23
 
24
24
  it "will load files from both paths" do
@@ -27,4 +27,20 @@ describe Less::Parser do
27
27
  end
28
28
  end
29
29
 
30
+ describe "when load paths are specified in as default options" do
31
+ before do
32
+ Less.paths << cwd.join('one')
33
+ Less.paths << cwd.join('two')
34
+ @parser = Less::Parser.new
35
+ end
36
+ after do
37
+ Less.paths.clear
38
+ end
39
+
40
+ it "will load files from default load paths" do
41
+ @parser.parse('@import "one.less";').to_css.gsub(/\n/,'').strip.should eql ".one { width: 1;}"
42
+ @parser.parse('@import "two.less";').to_css.gsub(/\n/,'').strip.should eql ".two { width: 1;}"
43
+ end
44
+ end
45
+
30
46
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: less
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.6
5
+ version: 2.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Charles Lowell
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-23 00:00:00 -05:00
13
+ date: 2011-09-20 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -29,9 +29,9 @@ dependencies:
29
29
  requirement: &id002 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
- - - ~>
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 0.9.2
34
+ version: "0"
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: *id002
@@ -58,12 +58,14 @@ extra_rdoc_files: []
58
58
  files:
59
59
  - .gitignore
60
60
  - .gitmodules
61
+ - .travis.yml
61
62
  - Gemfile
62
63
  - README.md
63
64
  - Rakefile
64
65
  - bin/lessc
65
66
  - less.gemspec
66
67
  - lib/less.rb
68
+ - lib/less/defaults.rb
67
69
  - lib/less/loader.rb
68
70
  - lib/less/parser.rb
69
71
  - lib/less/version.rb
@@ -182,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
184
  requirements:
183
185
  - - ">="
184
186
  - !ruby/object:Gem::Version
185
- hash: 2053547067050762116
187
+ hash: -4170628397031877353
186
188
  segments:
187
189
  - 0
188
190
  version: "0"
@@ -191,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
193
  requirements:
192
194
  - - ">="
193
195
  - !ruby/object:Gem::Version
194
- hash: 2053547067050762116
196
+ hash: -4170628397031877353
195
197
  segments:
196
198
  - 0
197
199
  version: "0"