middleman-sprockets 3.0.11 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +25 -0
- data/Gemfile +13 -15
- data/Gemfile-3.1 +31 -0
- data/features/asset_hash.feature +16 -15
- data/features/sprockets_gems.feature +18 -1
- data/fixtures/asset-hash-app/source/layout.erb +1 -0
- data/lib/middleman-sprockets/extension.rb +96 -32
- data/lib/middleman-sprockets/sass_function_hack.rb +20 -0
- data/lib/middleman-sprockets/version.rb +1 -1
- data/middleman-sprockets.gemspec +1 -1
- metadata +14 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: aa7d0080651243d4dcebda2e3b0331031da0e96e
|
4
|
+
data.tar.gz: 7bfc7aa5dff00b290ec486ea20ca24908833eca5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 85f41fa46b95f6b74aeb3ca3a7249dd95cc35838cbfcdf7453c53eed8b215a8697bbc12e0e813def7c7a540ec9b9f426bea39e05c3a72d55369b49a5268dea86
|
7
|
+
data.tar.gz: d4675f3b632e72aac0858e5514648acfb4ded84c1b16346cbe2168044400f533736a53705fbfc1303ca77514939031b61630465fdab08e96020d3f454e2ef20f
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
master
|
2
|
+
===
|
3
|
+
|
4
|
+
* Hack around infinite recursion between bootstrap-sass and sprockets-sass. middleman/middleman#864
|
5
|
+
* Fix for fonts in Sass files having ".font" appended to them. middleman/middleman#866.
|
6
|
+
* Enable in-memory caching in Sprockets, so unchanged assets don't get recompiled when other assets change. #25
|
7
|
+
* Refuse to serve gem-assets that haven't been added to the Middleman sitemap. #23
|
8
|
+
* Allow importing JS/CSS assets from gems by their logical path, using `sprockets.import_asset`. #23
|
9
|
+
* Fix a bug where, when `:debug_assets` was enabled, refreshing the page would produce the wrong JavaScript include path. #26
|
10
|
+
|
11
|
+
3.0.11
|
12
|
+
===
|
13
|
+
|
14
|
+
* Fonts are now included in the Sprockets load path.
|
15
|
+
* When `:debug_assets` is on, do not add `?body=1` multiple times. #24
|
16
|
+
* :js_assets_paths configuration is deprecated in favor of just calling sprockets.append_path. #22
|
17
|
+
* Sprockets integration, especially with regard to helper methods, is significantly improved. #22
|
18
|
+
* Images and fonts from gems added to the Sprockets load path will now be copied to the build output. #22
|
19
|
+
* Compatibility with newer Sprockets versions.
|
20
|
+
|
21
|
+
3.0.10
|
22
|
+
===
|
23
|
+
|
24
|
+
* No longer expire Sprockets index in development mode. #18
|
25
|
+
|
data/Gemfile
CHANGED
@@ -1,13 +1,6 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
4
|
-
gem "middleman"
|
5
|
-
gem "middleman-core"
|
6
|
-
gem "middleman-more"
|
7
|
-
end
|
8
|
-
#gem "middleman", :path => '../middleman'
|
9
|
-
|
10
|
-
# Specify your gem's dependencies in middleman-blog.gemspec
|
3
|
+
# Specify your gem's dependencies in middleman-sprockets.gemspec
|
11
4
|
gemspec
|
12
5
|
|
13
6
|
# Build and doc tools
|
@@ -16,15 +9,20 @@ gem "yard", "~> 0.8.0"
|
|
16
9
|
|
17
10
|
# Test tools
|
18
11
|
gem "cucumber"
|
19
|
-
gem "fivemat"
|
12
|
+
gem "fivemat"
|
20
13
|
gem "aruba"
|
21
|
-
gem "
|
22
|
-
gem
|
14
|
+
gem "builder", "~> 3.0.0"
|
15
|
+
gem "rspec"
|
23
16
|
|
24
17
|
# For actual tests
|
25
|
-
|
26
|
-
|
18
|
+
# Make sure to lock down the versions of the asset gems
|
19
|
+
# so they don't cause asset hashes to change.
|
20
|
+
gem "jquery-rails", '2.2.1', :require => false
|
21
|
+
gem "bootstrap-sass", '2.3.1.0', :require => false
|
22
|
+
|
23
|
+
gem 'jquery_mobile_rails', '1.3.0', :require => false
|
24
|
+
gem 'sprockets', '~> 2.2.1', :require => false
|
25
|
+
|
27
26
|
gem "ejs", "~> 1.1.1"
|
28
27
|
gem "eco", "~> 1.0.0"
|
29
|
-
gem "erubis", "~> 2.7.0"
|
30
|
-
gem 'jquery_mobile_rails', '~>1.2.0', :require => false
|
28
|
+
gem "erubis", "~> 2.7.0"
|
data/Gemfile-3.1
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem "middleman", "3.1.0", :github => "middleman/middleman"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in middleman-sprockets.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
# Build and doc tools
|
9
|
+
gem "rake", "~> 10.0.3"
|
10
|
+
gem "yard", "~> 0.8.0"
|
11
|
+
|
12
|
+
# Test tools
|
13
|
+
gem "cucumber"
|
14
|
+
gem "fivemat"
|
15
|
+
gem "aruba"
|
16
|
+
gem "builder", "~> 3.0.0"
|
17
|
+
gem "rspec"
|
18
|
+
|
19
|
+
# For actual tests
|
20
|
+
# Make sure to lock down the versions of the asset gems
|
21
|
+
# so they don't cause asset hashes to change.
|
22
|
+
gem "jquery-rails", '2.2.1', :require => false
|
23
|
+
gem "bootstrap-sass", '2.3.1.0', :require => false
|
24
|
+
|
25
|
+
gem 'jquery_mobile_rails', '1.3.0', :require => false
|
26
|
+
gem 'sprockets', '~> 2.2.1', :require => false
|
27
|
+
gem 'rack', '1.4.5', :require => false
|
28
|
+
|
29
|
+
gem "ejs", "~> 1.1.1"
|
30
|
+
gem "eco", "~> 1.0.0"
|
31
|
+
gem "erubis", "~> 2.7.0"
|
data/features/asset_hash.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
|
8
8
|
| images/100px-5fd6fb90.jpg |
|
9
9
|
| images/100px-5fd6fb90.gif |
|
10
10
|
| javascripts/application-df677242.js |
|
11
|
-
| stylesheets/site-
|
11
|
+
| stylesheets/site-570b0b7d.css |
|
12
12
|
| index.html |
|
13
13
|
| subdir/index.html |
|
14
14
|
| other/index.html |
|
@@ -20,50 +20,51 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
|
20
20
|
| stylesheets/site.css |
|
21
21
|
|
22
22
|
And the file "javascripts/application-df677242.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
|
23
|
-
And the file "stylesheets/site-
|
24
|
-
And the file "index.html" should contain 'href="stylesheets/site-
|
23
|
+
And the file "stylesheets/site-570b0b7d.css" should contain 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
24
|
+
And the file "index.html" should contain 'href="stylesheets/site-570b0b7d.css"'
|
25
25
|
And the file "index.html" should contain 'src="javascripts/application-df677242.js"'
|
26
26
|
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
27
|
-
And the file "subdir/index.html" should contain 'href="../stylesheets/site-
|
27
|
+
And the file "subdir/index.html" should contain 'href="../stylesheets/site-570b0b7d.css"'
|
28
28
|
And the file "subdir/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
29
29
|
And the file "subdir/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
30
|
-
And the file "other/index.html" should contain 'href="../stylesheets/site-
|
30
|
+
And the file "other/index.html" should contain 'href="../stylesheets/site-570b0b7d.css"'
|
31
31
|
And the file "other/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
32
32
|
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
33
33
|
|
34
34
|
Scenario: Hashed assets work in preview server
|
35
35
|
Given the Server is running at "asset-hash-app"
|
36
36
|
When I go to "/"
|
37
|
-
Then I should see 'href="stylesheets/site-
|
37
|
+
Then I should see 'href="stylesheets/site-570b0b7d.css"'
|
38
|
+
Then I should see 'href="stylesheets/jquery-mobile-044da59f.css"'
|
38
39
|
And I should see 'src="javascripts/application-df677242.js"'
|
39
40
|
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
40
41
|
When I go to "/subdir/"
|
41
|
-
Then I should see 'href="../stylesheets/site-
|
42
|
+
Then I should see 'href="../stylesheets/site-570b0b7d.css"'
|
42
43
|
And I should see 'src="../javascripts/application-df677242.js"'
|
43
44
|
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
44
45
|
When I go to "/other/"
|
45
|
-
Then I should see 'href="../stylesheets/site-
|
46
|
+
Then I should see 'href="../stylesheets/site-570b0b7d.css"'
|
46
47
|
And I should see 'src="../javascripts/application-df677242.js"'
|
47
48
|
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
48
49
|
When I go to "/javascripts/application-df677242.js"
|
49
50
|
Then I should see "img.src = '/images/100px-5fd6fb90.jpg'"
|
50
|
-
When I go to "/stylesheets/site-
|
51
|
+
When I go to "/stylesheets/site-570b0b7d.css"
|
51
52
|
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
52
|
-
When I go to "/stylesheets/jquery-mobile-
|
53
|
-
Then I should see 'background-image: url("../images/jquery-mobile/icons-18-white-
|
53
|
+
When I go to "/stylesheets/jquery-mobile-044da59f.css"
|
54
|
+
Then I should see 'background-image: url("../images/jquery-mobile/icons-18-white-1681b2cc.png")'
|
54
55
|
|
55
56
|
Scenario: Enabling an asset host still produces hashed files and references
|
56
57
|
Given the Server is running at "asset-hash-host-app"
|
57
58
|
When I go to "/"
|
58
|
-
Then I should see 'href="http://middlemanapp.com/stylesheets/site-
|
59
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-72c69c91.css"'
|
59
60
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
60
61
|
When I go to "/subdir/"
|
61
|
-
Then I should see 'href="http://middlemanapp.com/stylesheets/site-
|
62
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-72c69c91.css"'
|
62
63
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
63
64
|
When I go to "/other/"
|
64
|
-
Then I should see 'href="http://middlemanapp.com/stylesheets/site-
|
65
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-72c69c91.css"'
|
65
66
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
66
|
-
When I go to "/stylesheets/site-
|
67
|
+
When I go to "/stylesheets/site-72c69c91.css"
|
67
68
|
Then I should see 'background-image: url("http://middlemanapp.com/images/100px-5fd6fb90.jpg")'
|
68
69
|
|
69
70
|
Scenario: The asset hash should change when a SASS partial changes
|
@@ -2,7 +2,7 @@ Feature: Sprockets Gems
|
|
2
2
|
Scenario: Sprockets can pull jQuery from gem
|
3
3
|
Given the Server is running at "sprockets-app"
|
4
4
|
When I go to "/library/js/jquery_include.js"
|
5
|
-
Then I should see "
|
5
|
+
Then I should see "window.jQuery ="
|
6
6
|
|
7
7
|
Scenario: Sprockets can pull CSS from gem
|
8
8
|
Given the Server is running at "sprockets-app"
|
@@ -41,3 +41,20 @@ Feature: Sprockets Gems
|
|
41
41
|
Given the Server is running at "jquery-mobile-app"
|
42
42
|
When I go to "/stylesheets/base.css"
|
43
43
|
Then I should see 'url("../images/jquery-mobile/icons-36-white.png")'
|
44
|
+
|
45
|
+
Scenario: JS/CSS from gems aren't aumatically in the site
|
46
|
+
Given the Server is running at "jquery-mobile-app"
|
47
|
+
When I go to "/javascripts/jquery.mobile.js"
|
48
|
+
Then I should get a response with status "404"
|
49
|
+
|
50
|
+
Scenario: JS/CSS from gems can be declared to be accessible
|
51
|
+
Given a fixture app "jquery-mobile-app"
|
52
|
+
Given a file named "config.rb" with:
|
53
|
+
"""
|
54
|
+
after_configuration do
|
55
|
+
sprockets.import_asset 'jquery.mobile'
|
56
|
+
end
|
57
|
+
"""
|
58
|
+
And the Server is running at "jquery-mobile-app"
|
59
|
+
When I go to "/javascripts/jquery.mobile.js"
|
60
|
+
Then I should get a response with status "200"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "sprockets"
|
2
2
|
require "sprockets-sass"
|
3
|
+
require "middleman-sprockets/sass_function_hack"
|
3
4
|
|
4
5
|
# Sprockets extension
|
5
6
|
module Middleman::Sprockets
|
@@ -12,12 +13,12 @@ module Middleman::Sprockets
|
|
12
13
|
# Add class methods to context
|
13
14
|
app.send :include, InstanceMethods
|
14
15
|
|
15
|
-
app.
|
16
|
-
helpers JavascriptTagHelper
|
16
|
+
app.helpers JavascriptTagHelper
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
::Tilt.register ::Sprockets::EjsTemplate, 'ejs'
|
19
|
+
::Tilt.register ::Sprockets::EcoTemplate, 'eco'
|
20
20
|
|
21
|
+
app.after_configuration do
|
21
22
|
# Add any gems with (vendor|app|.)/assets/javascripts to paths
|
22
23
|
# also add similar directories from project root (like in rails)
|
23
24
|
try_paths = [
|
@@ -72,9 +73,43 @@ module Middleman::Sprockets
|
|
72
73
|
class MiddlemanSprocketsEnvironment < ::Sprockets::Environment
|
73
74
|
# Setup
|
74
75
|
def initialize(app)
|
76
|
+
@imported_assets = []
|
75
77
|
@app = app
|
78
|
+
|
76
79
|
super app.source_dir
|
77
80
|
|
81
|
+
# By default, sprockets has no cache! Give it an in-memory one using a Hash
|
82
|
+
@cache = {}
|
83
|
+
|
84
|
+
enhance_context_class!
|
85
|
+
|
86
|
+
# Remove compressors, we handle these with middleware
|
87
|
+
unregister_bundle_processor 'application/javascript', :js_compressor
|
88
|
+
unregister_bundle_processor 'text/css', :css_compressor
|
89
|
+
|
90
|
+
# configure search paths
|
91
|
+
append_path app.js_dir
|
92
|
+
append_path app.css_dir
|
93
|
+
append_path app.images_dir
|
94
|
+
append_path app.fonts_dir
|
95
|
+
|
96
|
+
# add custom assets paths to the scope
|
97
|
+
app.js_assets_paths.each do |p|
|
98
|
+
warn ":js_assets_paths is deprecated. Call sprockets.append_path instead."
|
99
|
+
append_path p
|
100
|
+
end if app.respond_to?(:js_assets_paths)
|
101
|
+
|
102
|
+
# Stylus support
|
103
|
+
if defined?(::Stylus)
|
104
|
+
require 'stylus/sprockets'
|
105
|
+
::Stylus.setup(self, app.styl)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# Add our own customizations to the Sprockets context class
|
110
|
+
def enhance_context_class!
|
111
|
+
app = @app
|
112
|
+
|
78
113
|
# Make the app context available to Sprockets
|
79
114
|
context_class.send(:define_method, :app) { app }
|
80
115
|
|
@@ -106,7 +141,9 @@ module Middleman::Sprockets
|
|
106
141
|
|
107
142
|
# Expand logical font asset path.
|
108
143
|
def font_path(path, options={})
|
109
|
-
|
144
|
+
# Knock .fonts off the end, because Middleman < 3.1 doesn't handle fonts
|
145
|
+
# in asset_path
|
146
|
+
asset_path(path, :type => :font).sub(/\.fonts$/, '')
|
110
147
|
end
|
111
148
|
|
112
149
|
# Expand logical javascript asset path.
|
@@ -133,29 +170,8 @@ module Middleman::Sprockets
|
|
133
170
|
super || app.respond_to?(method, include_private)
|
134
171
|
end
|
135
172
|
end
|
136
|
-
|
137
|
-
# Remove compressors, we handle these with middleware
|
138
|
-
unregister_bundle_processor 'application/javascript', :js_compressor
|
139
|
-
unregister_bundle_processor 'text/css', :css_compressor
|
140
|
-
|
141
|
-
# configure search paths
|
142
|
-
append_path app.js_dir
|
143
|
-
append_path app.css_dir
|
144
|
-
append_path app.images_dir
|
145
|
-
append_path app.fonts_dir
|
146
|
-
|
147
|
-
# add custom assets paths to the scope
|
148
|
-
app.js_assets_paths.each do |p|
|
149
|
-
warn ":js_assets_paths is deprecated. Call sprockets.append_path instead."
|
150
|
-
append_path p
|
151
|
-
end if app.respond_to?(:js_assets_paths)
|
152
|
-
|
153
|
-
# Stylus support
|
154
|
-
if defined?(::Stylus)
|
155
|
-
require 'stylus/sprockets'
|
156
|
-
::Stylus.setup(self, app.styl)
|
157
|
-
end
|
158
173
|
end
|
174
|
+
private :enhance_context_class!
|
159
175
|
|
160
176
|
# Override Sprockets' default digest function to *not*
|
161
177
|
# change depending on the exact Sprockets version. It still takes
|
@@ -195,10 +211,34 @@ module Middleman::Sprockets
|
|
195
211
|
|
196
212
|
def call(env)
|
197
213
|
# Set the app current path based on the full URL so that helpers work
|
198
|
-
|
199
|
-
|
214
|
+
request_path = URI.decode(File.join(env['SCRIPT_NAME'], env['PATH_INFO']))
|
215
|
+
if request_path.respond_to? :force_encoding
|
216
|
+
request_path.force_encoding('UTF-8')
|
217
|
+
end
|
218
|
+
resource = @app.sitemap.find_resource_by_destination_path(request_path)
|
219
|
+
|
220
|
+
if !resource
|
221
|
+
response = ::Rack::Response.new
|
222
|
+
response.status = 404
|
223
|
+
response.write """<html><body><h1>File Not Found</h1><p>#{request_path}</p>
|
224
|
+
<p>If this is an an asset from a gem, add <tt>sprockets.import_asset '#{File.basename(request_path)}'</tt>
|
225
|
+
to your <tt>config.rb</tt>.</body>"""
|
226
|
+
return response.finish
|
227
|
+
end
|
228
|
+
|
229
|
+
@app.current_path = request_path
|
230
|
+
|
200
231
|
super
|
201
232
|
end
|
233
|
+
|
234
|
+
# A list of Sprockets logical paths for assets that should be brought into the
|
235
|
+
# Middleman application and built.
|
236
|
+
attr_accessor :imported_assets
|
237
|
+
|
238
|
+
# Tell Middleman to build this asset, referenced as a logical path.
|
239
|
+
def import_asset(asset_logical_path)
|
240
|
+
imported_assets << asset_logical_path
|
241
|
+
end
|
202
242
|
end
|
203
243
|
|
204
244
|
module JavascriptTagHelper
|
@@ -216,7 +256,7 @@ module Middleman::Sprockets
|
|
216
256
|
dependencies_paths = sprockets[source].to_a.map do |dependency|
|
217
257
|
# if sprockets sees "?body=1" it only gives back the body
|
218
258
|
# of the script without the dependencies included
|
219
|
-
dependency.logical_path
|
259
|
+
dependency.logical_path + "?body=1"
|
220
260
|
end
|
221
261
|
|
222
262
|
super(dependencies_paths, options)
|
@@ -234,19 +274,43 @@ module Middleman::Sprockets
|
|
234
274
|
|
235
275
|
# Add sitemap resource for every image in the sprockets load path
|
236
276
|
def manipulate_resource_list(resources)
|
277
|
+
sprockets = @app.sprockets
|
278
|
+
|
279
|
+
imported_assets = []
|
280
|
+
sprockets.imported_assets.each do |asset_logical_path|
|
281
|
+
assets = []
|
282
|
+
sprockets.resolve(asset_logical_path) do |asset|
|
283
|
+
assets << asset
|
284
|
+
@app.logger.debug "== Importing Sprockets asset #{asset}"
|
285
|
+
end
|
286
|
+
raise ::Sprockets::FileNotFound, "couldn't find asset '#{asset_logical_path}'" if assets.empty?
|
287
|
+
imported_assets.concat(assets)
|
288
|
+
end
|
289
|
+
|
237
290
|
resources_list = []
|
238
|
-
|
291
|
+
sprockets.paths.each do |load_path|
|
239
292
|
output_dir = nil
|
293
|
+
export_all = false
|
240
294
|
if load_path.end_with?('/images')
|
241
295
|
output_dir = @app.images_dir
|
296
|
+
export_all = true
|
242
297
|
elsif load_path.end_with?('/fonts')
|
243
298
|
output_dir = @app.fonts_dir
|
299
|
+
export_all = true
|
300
|
+
elsif load_path.end_with?('/stylesheets')
|
301
|
+
output_dir = @app.css_dir
|
302
|
+
elsif load_path.end_with?('/javascripts')
|
303
|
+
output_dir = @app.js_dir
|
244
304
|
end
|
245
305
|
|
246
306
|
if output_dir
|
247
|
-
|
307
|
+
sprockets.each_entry(load_path) do |path|
|
248
308
|
next unless path.file?
|
309
|
+
next if path.basename.to_s.start_with?('_')
|
310
|
+
next unless export_all || imported_assets.include?(path)
|
311
|
+
|
249
312
|
base_path = path.sub("#{load_path}/", '')
|
313
|
+
|
250
314
|
new_path = File.join(output_dir, base_path)
|
251
315
|
resources_list << ::Middleman::Sitemap::Resource.new(@app.sitemap, new_path.to_s, path.to_s)
|
252
316
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# sprockets-sass implements an image_url function that calls over to image_path. But bootstrap-sass
|
2
|
+
# defines an image_path function that calls image_url! To avoid the probem in bootstrap-sass (and anyone
|
3
|
+
# who tries something similar, this redefines sprockets-sass' function to not refer to image_path.
|
4
|
+
#
|
5
|
+
# See https://github.com/middleman/middleman/issues/864 for more info.
|
6
|
+
#x
|
7
|
+
module Sass::Script::Functions
|
8
|
+
def image_url(source, options = {}, cache_buster = nil)
|
9
|
+
# Work with the Compass #image_url API
|
10
|
+
if options.respond_to? :value
|
11
|
+
case options.value
|
12
|
+
when true
|
13
|
+
return ::Sass::Script::String.new sprockets_context.image_path(source.value).to_s, :string
|
14
|
+
else
|
15
|
+
options = {}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
::Sass::Script::String.new "url(\"#{sprockets_context.image_path(source.value, map_options(options)).to_s}\")"
|
19
|
+
end
|
20
|
+
end
|
data/middleman-sprockets.gemspec
CHANGED
metadata
CHANGED
@@ -1,36 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
5
|
-
prerelease:
|
4
|
+
version: 3.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Thomas Reynolds
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-01 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: middleman-more
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.0.11
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.0.11
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: sprockets
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,19 +41,17 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: sprockets-sass
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.
|
47
|
+
version: 1.0.0
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
54
|
+
version: 1.0.0
|
62
55
|
description: Sprockets support for Middleman
|
63
56
|
email:
|
64
57
|
- me@tdreyno.com
|
@@ -68,7 +61,9 @@ extra_rdoc_files: []
|
|
68
61
|
files:
|
69
62
|
- .gitignore
|
70
63
|
- .travis.yml
|
64
|
+
- CHANGELOG.md
|
71
65
|
- Gemfile
|
66
|
+
- Gemfile-3.1
|
72
67
|
- LICENSE
|
73
68
|
- README.md
|
74
69
|
- Rakefile
|
@@ -161,38 +156,32 @@ files:
|
|
161
156
|
- fixtures/sprockets-images-app/vendor/assets/images/cat-2.jpg
|
162
157
|
- lib/middleman-sprockets.rb
|
163
158
|
- lib/middleman-sprockets/extension.rb
|
159
|
+
- lib/middleman-sprockets/sass_function_hack.rb
|
164
160
|
- lib/middleman-sprockets/version.rb
|
165
161
|
- lib/middleman_extension.rb
|
166
162
|
- middleman-sprockets.gemspec
|
167
163
|
homepage: https://github.com/middleman/middleman-sprockets
|
168
164
|
licenses: []
|
165
|
+
metadata: {}
|
169
166
|
post_install_message:
|
170
167
|
rdoc_options: []
|
171
168
|
require_paths:
|
172
169
|
- lib
|
173
170
|
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
-
none: false
|
175
171
|
requirements:
|
176
|
-
- -
|
172
|
+
- - '>='
|
177
173
|
- !ruby/object:Gem::Version
|
178
174
|
version: '0'
|
179
|
-
segments:
|
180
|
-
- 0
|
181
|
-
hash: -471944256885700963
|
182
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
-
none: false
|
184
176
|
requirements:
|
185
|
-
- -
|
177
|
+
- - '>='
|
186
178
|
- !ruby/object:Gem::Version
|
187
179
|
version: '0'
|
188
|
-
segments:
|
189
|
-
- 0
|
190
|
-
hash: -471944256885700963
|
191
180
|
requirements: []
|
192
181
|
rubyforge_project: middleman-sprockets
|
193
|
-
rubygems_version:
|
182
|
+
rubygems_version: 2.0.0
|
194
183
|
signing_key:
|
195
|
-
specification_version:
|
184
|
+
specification_version: 4
|
196
185
|
summary: Sprockets support for Middleman
|
197
186
|
test_files:
|
198
187
|
- features/asset_hash.feature
|