sprockets-less 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b098db9b4c19e57fe7bf83efc38b84594b3a6d4
4
- data.tar.gz: 46e151212de124e4af1eb97a09ceffec19b4dc36
3
+ metadata.gz: f1ad71859d298ef38f1c41dee1db6c19a8e94e53
4
+ data.tar.gz: 6ac1b2c1a799e0cb0ada139f2c3fc7555e18eb9f
5
5
  SHA512:
6
- metadata.gz: 827444386d69e3d512f42e486990e9b1f33203d5e4fb5c604da61fbdf8a161a5cd6b400b7958a3e9dbf81cbb5b07e39dcedc49f2afc6f234edf4199a40f7a545
7
- data.tar.gz: ec96eeed8aa008a661b9ee9b4ad0c79d31a2bdd8c59966da178ba8665c4abeaffcdc1febc83e6d991dd9f44471d21c61c1cf3b12155f5779a1cef4d051644389
6
+ metadata.gz: 309dd018adc37c9ed24a8bd34491fd1be0482541902680c1f53767862977d27be9dbe09cf927cc5d2a1efafac24ea5deb45227bfafc09f9ae5298b51b15391d0
7
+ data.tar.gz: 83879a9eeeb3ea92f294dd4f0dd040021a4b2e3a0887a0f6a280cf819c04d95190456607f756335e9172db5206198d1497359bed83c2479cc512e2cdf6135037
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem "therubyracer", ">= 0.10.1", :require => nil, :platforms => :ruby
5
- gem "therubyrhino", ">= 1.73.2", :require => nil, :platforms => :jruby
4
+ gem "therubyracer", "~> 0.12", :require => nil, :platforms => :ruby
5
+ gem "therubyrhino", "~> 2.0", :require => nil, :platforms => :jruby
data/README.md CHANGED
@@ -6,12 +6,6 @@ When using Sprockets 2.x with Less you will eventually run into a pretty big iss
6
6
 
7
7
  _Note: If you use Rails 3.1, you may want to use the [less-rails gem](http://github.com/rails/less-rails). But if you want to use Sprockets and Less anywhere else, like Sinatra, use `sprockets-less`._
8
8
 
9
- ## Installing
10
-
11
- Once you have set up Sprockets to behave on Rails 2.3 (see RAILS_UP for how to uprate your app), just bundle up less-rails in your Gemfile. This will pull in less as a runtime dependency too. This gem shall not be published at rubygems under this name, so be sure to set up both git and the branch correctly.
12
-
13
- gem 'less-rails', :git => https://github.com/lloeki/less-rails.git, :branch => 'rails-2.3-backport'
14
-
15
9
  ## Usage
16
10
 
17
11
  In your Rack application, setup Sprockets as you normally would, and require "sprockets-less":
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Less
3
- VERSION = '0.5.3'
3
+ VERSION = '0.6.0'
4
4
  end
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'sprockets'
2
2
  require 'sprockets-less'
3
3
  require 'sprockets-helpers'
4
- require 'construct'
4
+ require 'test_construct'
5
5
 
6
6
  # Requires supporting files with custom matchers and macros, etc,
7
7
  # in ./support/ and its subdirectories.
8
8
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
9
9
 
10
10
  RSpec.configure do |config|
11
- config.include Construct::Helpers
11
+ config.include TestConstruct::Helpers
12
12
  end
@@ -12,32 +12,32 @@ describe Sprockets::Less do
12
12
  @env = Sprockets::Environment.new @root.to_s
13
13
  @env.append_path @assets.to_s
14
14
  end
15
-
15
+
16
16
  after :each do
17
17
  @root.destroy!
18
18
  end
19
-
19
+
20
20
  it 'processes less files normally' do
21
21
  @assets.file 'main.css.less', '//= require dep'
22
22
  @assets.file 'dep.less', %(body { color: blue; })
23
23
  asset = @env['main.css']
24
24
  asset.to_s.should == "body {\n color: blue;\n}\n"
25
25
  end
26
-
26
+
27
27
  it 'imports standard files' do
28
28
  @assets.file 'main.css.less', %(@import "dep";\nbody { color: @color; })
29
29
  @assets.file 'dep.less', '@color: blue;'
30
30
  asset = @env['main.css']
31
31
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
32
32
  end
33
-
33
+
34
34
  it 'imports partials' do
35
35
  @assets.file 'main.css.less', %(@import "_dep";\nbody { color: @color; })
36
36
  @assets.file '_dep.less', '@color: blue;'
37
37
  asset = @env['main.css']
38
38
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
39
39
  end
40
-
40
+
41
41
  it 'imports files with the correct content type', :broken => true do
42
42
  @assets.file 'main.css.less', %(@import "dep";\nbody { color: @color; })
43
43
  @assets.file 'dep.js', 'var app = {};'
@@ -45,7 +45,7 @@ describe Sprockets::Less do
45
45
  asset = @env['main.css']
46
46
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
47
47
  end
48
-
48
+
49
49
  it 'imports files with directives', :todo => true do
50
50
  @assets.file 'main.css.less', %(@import "dep";)
51
51
  @assets.file 'dep.css', "/*\n *= require subdep\n */"
@@ -53,14 +53,14 @@ describe Sprockets::Less do
53
53
  asset = @env['main.css']
54
54
  asset.to_s.should include("body {\n color: #0000ff; }\n")
55
55
  end
56
-
56
+
57
57
  it 'imports files with additional processors', :todo => true do
58
58
  @assets.file 'main.css.less', %(@import "dep";\nbody { color: @color; })
59
59
  @assets.file 'dep.css.less.erb', "@color: <%= 'blue' %>;"
60
60
  asset = @env['main.css']
61
61
  asset.to_s.should == "body {\n color: blue; }\n"
62
62
  end
63
-
63
+
64
64
  it 'imports relative files', :todo => true do
65
65
  @assets.file 'folder/main.css.less', %(@import "./dep-1";\n@import "./subfolder/dep-2";\nbody { background-color: @background-color; color: @color; })
66
66
  @assets.file 'folder/dep-1.less', '@background-color: red;'
@@ -68,7 +68,7 @@ describe Sprockets::Less do
68
68
  asset = @env['folder/main.css']
69
69
  asset.to_s.should == "body {\n background-color: #ff0000;\n color: #0000ff; }\n"
70
70
  end
71
-
71
+
72
72
  it 'imports relative partials', :todo => true do
73
73
  @assets.file 'folder/main.css.less', %(@import "./dep-1";\n@import "./subfolder/dep-2";\nbody { background-color: @background-color; color: @color; })
74
74
  @assets.file 'folder/_dep-1.less', '@background-color: red;'
@@ -76,7 +76,7 @@ describe Sprockets::Less do
76
76
  asset = @env['folder/main.css']
77
77
  asset.to_s.should == "body {\n background-color: #ff0000;\n color: blue; }\n"
78
78
  end
79
-
79
+
80
80
  it 'imports relative files without preceding ./', :todo => true do
81
81
  @assets.file 'folder/main.css.less', %(@import "dep-1";\n@import "subfolder/dep-2";\nbody { background-color: @background-color; color: @color; })
82
82
  @assets.file 'folder/dep-1.less', '@background-color: red;'
@@ -84,7 +84,7 @@ describe Sprockets::Less do
84
84
  asset = @env['folder/main.css']
85
85
  asset.to_s.should == "body {\n background-color: red;\n color: blue; }\n"
86
86
  end
87
-
87
+
88
88
  it 'imports relative partials without preceding ./', :todo => true do
89
89
  @assets.file 'folder/main.css.less', %(@import "dep-1";\n@import "subfolder/dep-2";\nbody { background-color: @background-color; color: @color; })
90
90
  @assets.file 'folder/_dep-1.less', '@background-color: red;'
@@ -92,21 +92,21 @@ describe Sprockets::Less do
92
92
  asset = @env['folder/main.css']
93
93
  asset.to_s.should == "body {\n background-color: red;\n color: blue; }\n"
94
94
  end
95
-
95
+
96
96
  it 'imports files relative to root' do
97
97
  @assets.file 'folder/main.css.less', %(@import "dep";\nbody { color: @color; })
98
98
  @assets.file 'dep.less', '@color: blue;'
99
99
  asset = @env['folder/main.css']
100
100
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
101
101
  end
102
-
102
+
103
103
  it 'imports partials relative to root', :broken => true do
104
104
  @assets.file 'folder/main.css.less', %(@import "dep";\nbody { color: @color; })
105
105
  @assets.file '_dep.less', '@color: blue;'
106
106
  asset = @env['folder/main.css']
107
107
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
108
108
  end
109
-
109
+
110
110
  it 'shares Less environment with other imports' do
111
111
  @assets.file 'main.css.less', %(@import "dep-1";\n@import "dep-2";)
112
112
  @assets.file 'dep-1.less', '@color: blue;'
@@ -114,30 +114,30 @@ describe Sprockets::Less do
114
114
  asset = @env['main.css']
115
115
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
116
116
  end
117
-
117
+
118
118
  it 'imports files from the assets load path' do
119
119
  vendor = @root.directory 'vendor'
120
120
  @env.append_path vendor.to_s
121
-
121
+
122
122
  @assets.file 'main.css.less', %(@import "dep";\nbody { color: @color; })
123
123
  vendor.file 'dep.less', '@color: blue;'
124
124
  asset = @env['main.css']
125
125
  asset.to_s.should == "body {\n color: #0000ff;\n}\n"
126
126
  end
127
-
127
+
128
128
  it 'allows global Less configuration' do
129
129
  Sprockets::Less.options[:compress] = true
130
- @assets.file 'main.css.less', "body {\n color: blue;\n}"
131
-
130
+ @assets.file 'main.css.less', "body {\n color: #00f;\n}"
131
+
132
132
  asset = @env['main.css']
133
- asset.to_s.should == "body{color:blue;}\n"
133
+ asset.to_s.should == "body{color:#00f}\n"
134
134
  Sprockets::Less.options.delete(:compress)
135
135
  end
136
-
136
+
137
137
  it 'imports files from the Less load path' do
138
138
  vendor = @root.directory 'vendor'
139
139
  Sprockets::Less.options[:paths] = [ vendor.to_s ]
140
-
140
+
141
141
  @assets.file 'main.css.less', %(@import "dep";\nbody { color: @color; })
142
142
  vendor.file 'dep.less', '@color: blue;'
143
143
  asset = @env['main.css']
@@ -148,14 +148,14 @@ describe Sprockets::Less do
148
148
  it 'adds dependencies when imported' do
149
149
  @assets.file 'main.css.less', %(@import "dep";\nbody { color: @color; })
150
150
  dep = @assets.file 'dep.less', '@color: blue;'
151
-
151
+
152
152
  asset = @env['main.css']
153
153
  asset.should be_fresh(@env)
154
-
154
+
155
155
  mtime = Time.now + 1
156
156
  dep.open('w') { |f| f.write '@color: red;' }
157
157
  dep.utime mtime, mtime
158
-
158
+
159
159
  asset.should_not be_fresh(@env)
160
160
  end
161
161
 
@@ -163,48 +163,48 @@ describe Sprockets::Less do
163
163
  @assets.file 'main.css.less', %(@import "dep-1";\nbody { color: @color; })
164
164
  @assets.file 'dep-1.less', %(@import "dep-2";\n)
165
165
  dep = @assets.file 'dep-2.less', '@color: blue;'
166
-
166
+
167
167
  asset = @env['main.css']
168
168
  asset.should be_fresh(@env)
169
-
169
+
170
170
  mtime = Time.now + 1
171
171
  dep.open('w') { |f| f.write '@color: red;' }
172
172
  dep.utime mtime, mtime
173
-
173
+
174
174
  asset.should_not be_fresh(@env)
175
175
  end
176
-
176
+
177
177
  it "uses the environment's cache", :todo => true do
178
178
  cache = {}
179
179
  @env.cache = cache
180
-
180
+
181
181
  @assets.file 'main.css.less', %(@color: blue;\nbody { color: @color; })
182
-
182
+
183
183
  @env['main.css'].to_s
184
184
  less_cache = cache.keys.detect { |key| key =~ /main\.css\.less/ }
185
185
  less_cache.should_not be_nil
186
186
  end
187
-
187
+
188
188
  it 'adds the #asset_path helper', :broken => true do
189
189
  @assets.file 'asset_path.css.less', %(body { background: url(asset-path("image.jpg")); })
190
190
  @assets.file 'asset_url.css.less', %(body { background: asset-url("image.jpg"); })
191
191
  @assets.file 'asset_path_options.css.less', %(body { background: url(asset-path("image.jpg", $digest: true, $prefix: "/themes")); })
192
192
  @assets.file 'asset_url_options.css.less', %(body { background: asset-url("image.jpg", $digest: true, $prefix: "/themes"); })
193
193
  @assets.file 'image.jpg'
194
-
194
+
195
195
  @env['asset_path.css'].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n)
196
196
  @env['asset_url.css'].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n)
197
197
  @env['asset_path_options.css'].to_s.should =~ %r(body \{\n background: url\("/themes/image-[0-9a-f]+.jpg"\); \}\n)
198
198
  @env['asset_url_options.css'].to_s.should =~ %r(body \{\n background: url\("/themes/image-[0-9a-f]+.jpg"\); \}\n)
199
199
  end
200
-
200
+
201
201
  it 'adds the #image_path helper', :broken => true do
202
202
  @assets.file 'image_path.css.less', %(body { background: url(image-path("image.jpg")); })
203
203
  @assets.file 'image_url.css.less', %(body { background: image-url("image.jpg"); })
204
204
  @assets.file 'image_path_options.css.less', %(body { background: url(image-path("image.jpg", $digest: true, $prefix: "/themes")); })
205
205
  @assets.file 'image_url_options.css.less', %(body { background: image-url("image.jpg", $digest: true, $prefix: "/themes"); })
206
206
  @assets.file 'image.jpg'
207
-
207
+
208
208
  @env['image_path.css'].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n)
209
209
  @env['image_url.css'].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n)
210
210
  @env['image_path_options.css'].to_s.should =~ %r(body \{\n background: url\("/themes/image-[0-9a-f]+.jpg"\); \}\n)
@@ -217,25 +217,25 @@ describe Sprockets::Less do
217
217
  @assets.file 'font_path_options.css.less', %(@font-face { src: url(font-path("font.ttf", $digest: true, $prefix: "/themes")); })
218
218
  @assets.file 'font_url_options.css.less', %(@font-face { src: font-url("font.ttf", $digest: true, $prefix: "/themes"); })
219
219
  @assets.file 'font.ttf'
220
-
220
+
221
221
  @env['font_path.css'].to_s.should == %(@font-face {\n src: url("/assets/font.ttf"); }\n)
222
222
  @env['font_url.css'].to_s.should == %(@font-face {\n src: url("/assets/font.ttf"); }\n)
223
223
  @env['font_path_options.css'].to_s.should =~ %r(@font-face \{\n src: url\("/themes/font-[0-9a-f]+.ttf"\); \}\n)
224
224
  @env['font_url_options.css'].to_s.should =~ %r(@font-face \{\n src: url\("/themes/font-[0-9a-f]+.ttf"\); \}\n)
225
225
  end
226
-
226
+
227
227
  it 'adds the #asset_data_uri helper', :broken => true do
228
228
  @assets.file 'asset_data_uri.css.less', %(body { background: asset-data-uri("image.jpg"); })
229
229
  @assets.file 'image.jpg', File.read('spec/fixtures/image.jpg')
230
-
230
+
231
231
  @env['asset_data_uri.css'].to_s.should == %(body {\n background: url(data:image/jpeg;base64,%2F9j%2F4AAQSkZJRgABAgAAZABkAAD%2F7AARRHVja3kAAQAEAAAAPAAA%2F%2B4ADkFkb2JlAGTAAAAAAf%2FbAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f%2F8AAEQgAAQABAwERAAIRAQMRAf%2FEAEoAAQAAAAAAAAAAAAAAAAAAAAgBAQAAAAAAAAAAAAAAAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD%2F2gAMAwEAAhEDEQA%2FACoD%2F9k%3D); }\n)
232
232
  end
233
-
233
+
234
234
  it "mirrors Less::Rails's #asset_path helpers", :broken => true do
235
235
  @assets.file 'asset_path.css.less', %(body { background: url(asset-path("image.jpg", image)); })
236
236
  @assets.file 'asset_url.css.less', %(body { background: asset-url("icon.jpg", image); })
237
237
  @assets.file 'image.jpg'
238
-
238
+
239
239
  @env['asset_path.css'].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n)
240
240
  @env['asset_url.css'].to_s.should == %(body {\n background: url("/images/icon.jpg"); }\n)
241
241
  end
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
14
14
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
15
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
16
  s.require_paths = ["lib"]
17
- s.add_dependency 'less', '~> 2.3.0'
17
+ s.add_dependency 'less', '~> 2.4'
18
18
  s.add_dependency 'tilt', '~> 1.1'
19
19
  s.add_development_dependency 'sprockets-helpers', '~> 0.6'
20
20
  s.add_development_dependency 'rspec', '~> 2.6'
21
- s.add_development_dependency 'test-construct', '~> 1.2'
21
+ s.add_development_dependency 'test_construct', '~> 2.0'
22
22
  s.add_development_dependency 'rake'
23
23
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-less
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Nageleisen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-02 00:00:00.000000000 Z
11
+ date: 2014-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: less
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.0
19
+ version: '2.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.0
26
+ version: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tilt
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sprockets-helpers
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.6'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.6'
69
69
  - !ruby/object:Gem::Dependency
70
- name: test-construct
70
+ name: test_construct
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.2'
75
+ version: '2.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.2'
82
+ version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: The dynamic stylesheet language for the Sprockets asset pipeline.
@@ -101,7 +101,7 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
104
+ - ".gitignore"
105
105
  - Gemfile
106
106
  - LICENSE
107
107
  - README.md
@@ -126,17 +126,17 @@ require_paths:
126
126
  - lib
127
127
  required_ruby_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - '>='
134
+ - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.0.0
139
+ rubygems_version: 2.2.0
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: The dynamic stylesheet language for the Sprockets asset pipeline.
@@ -145,3 +145,4 @@ test_files:
145
145
  - spec/spec_helper.rb
146
146
  - spec/sprockets-less_spec.rb
147
147
  - spec/support/be_fresh_matcher.rb
148
+ has_rdoc: