middleman-sprockets 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +0 -6
- data/CHANGELOG.md +10 -0
- data/Gemfile +3 -0
- data/Gemfile-3.1 +1 -1
- data/Rakefile +6 -1
- data/features/asset_hash-3.0.feature +105 -0
- data/features/asset_hash.feature +17 -16
- data/features/sprockets.feature +12 -0
- data/features/sprockets_gems.feature +10 -3
- data/fixtures/sprockets-app-debug-assets/source/index.html.erb +2 -1
- data/fixtures/sprockets-app-debug-assets/source/stylesheets/app.css.scss +4 -0
- data/fixtures/sprockets-app-debug-assets/source/stylesheets/dependency1.css +0 -0
- data/fixtures/sprockets-app-debug-assets/source/stylesheets/dependency2.css.scss +0 -0
- data/lib/middleman-sprockets/extension.rb +34 -1
- data/lib/middleman-sprockets/sass_function_hack.rb +6 -1
- data/lib/middleman-sprockets/version.rb +1 -1
- data/middleman-sprockets.gemspec +7 -3
- metadata +66 -12
- checksums.yaml +0 -7
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
master
|
|
2
2
|
===
|
|
3
3
|
|
|
4
|
+
* Compatibility with Middleman 3.1's removal of the middleman-more gem.
|
|
5
|
+
* Add sprockets-helpers to the list of dependencies to fix various path-related bugs. #34
|
|
6
|
+
* Patch generated_image_url so that Compass sprites work. middleman/middleman#890.
|
|
7
|
+
* Output .jst, .eco, and .ejs files with a .js extension. middleman/middleman#888.
|
|
8
|
+
* Fix :debug_assets for files that include scripts from gems. #29.
|
|
9
|
+
* :debug_assets will now expand CSS included via Sprockets requires as well as JavaScript. #30
|
|
10
|
+
|
|
11
|
+
3.1.0
|
|
12
|
+
===
|
|
13
|
+
|
|
4
14
|
* Hack around infinite recursion between bootstrap-sass and sprockets-sass. middleman/middleman#864
|
|
5
15
|
* Fix for fonts in Sass files having ".font" appended to them. middleman/middleman#866.
|
|
6
16
|
* Enable in-memory caching in Sprockets, so unchanged assets don't get recompiled when other assets change. #25
|
data/Gemfile
CHANGED
data/Gemfile-3.1
CHANGED
data/Rakefile
CHANGED
|
@@ -3,8 +3,13 @@ Bundler::GemHelper.install_tasks
|
|
|
3
3
|
|
|
4
4
|
require 'cucumber/rake/task'
|
|
5
5
|
|
|
6
|
+
require 'middleman-core/version'
|
|
7
|
+
|
|
6
8
|
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
|
7
|
-
|
|
9
|
+
exempt_tags = ["--tags ~@wip"]
|
|
10
|
+
exempt_tags << "--tags ~@new" unless Middleman::VERSION.start_with? ("3.1")
|
|
11
|
+
exempt_tags << "--tags ~@old" unless Middleman::VERSION.start_with? ("3.0")
|
|
12
|
+
t.cucumber_opts = "--color #{exempt_tags.join(" ")} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
|
|
8
13
|
end
|
|
9
14
|
|
|
10
15
|
require 'rake/clean'
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
@old
|
|
2
|
+
Feature: Assets get a file hash appended to their URL and references to them are updated
|
|
3
|
+
Scenario: Hashed-asset files are produced, and HTML, CSS, and JavaScript gets rewritten to reference the new files
|
|
4
|
+
Given a successfully built app at "asset-hash-app"
|
|
5
|
+
When I cd to "build"
|
|
6
|
+
Then the following files should exist:
|
|
7
|
+
| index.html |
|
|
8
|
+
| images/100px-1242c368.png |
|
|
9
|
+
| images/100px-5fd6fb90.jpg |
|
|
10
|
+
| images/100px-5fd6fb90.gif |
|
|
11
|
+
| javascripts/application-df677242.js |
|
|
12
|
+
| stylesheets/site-570b0b7d.css |
|
|
13
|
+
| index.html |
|
|
14
|
+
| subdir/index.html |
|
|
15
|
+
| other/index.html |
|
|
16
|
+
And the following files should not exist:
|
|
17
|
+
| images/100px.png |
|
|
18
|
+
| images/100px.jpg |
|
|
19
|
+
| images/100px.gif |
|
|
20
|
+
| javascripts/application.js |
|
|
21
|
+
| stylesheets/site.css |
|
|
22
|
+
|
|
23
|
+
And the file "javascripts/application-df677242.js" should contain "img.src = '/images/100px-5fd6fb90.jpg'"
|
|
24
|
+
And the file "stylesheets/site-570b0b7d.css" should contain 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
|
25
|
+
And the file "index.html" should contain 'href="stylesheets/site-570b0b7d.css"'
|
|
26
|
+
And the file "index.html" should contain 'src="javascripts/application-df677242.js"'
|
|
27
|
+
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
|
28
|
+
And the file "subdir/index.html" should contain 'href="../stylesheets/site-570b0b7d.css"'
|
|
29
|
+
And the file "subdir/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
|
30
|
+
And the file "subdir/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
|
31
|
+
And the file "other/index.html" should contain 'href="../stylesheets/site-570b0b7d.css"'
|
|
32
|
+
And the file "other/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
|
33
|
+
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
|
34
|
+
|
|
35
|
+
Scenario: Hashed assets work in preview server
|
|
36
|
+
Given the Server is running at "asset-hash-app"
|
|
37
|
+
When I go to "/"
|
|
38
|
+
Then I should see 'href="stylesheets/site-570b0b7d.css"'
|
|
39
|
+
Then I should see 'href="stylesheets/jquery-mobile-044da59f.css"'
|
|
40
|
+
And I should see 'src="javascripts/application-df677242.js"'
|
|
41
|
+
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
|
42
|
+
When I go to "/subdir/"
|
|
43
|
+
Then I should see 'href="../stylesheets/site-570b0b7d.css"'
|
|
44
|
+
And I should see 'src="../javascripts/application-df677242.js"'
|
|
45
|
+
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
|
46
|
+
When I go to "/other/"
|
|
47
|
+
Then I should see 'href="../stylesheets/site-570b0b7d.css"'
|
|
48
|
+
And I should see 'src="../javascripts/application-df677242.js"'
|
|
49
|
+
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
|
50
|
+
When I go to "/javascripts/application-df677242.js"
|
|
51
|
+
Then I should see "img.src = '/images/100px-5fd6fb90.jpg'"
|
|
52
|
+
When I go to "/stylesheets/site-570b0b7d.css"
|
|
53
|
+
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
|
54
|
+
When I go to "/stylesheets/jquery-mobile-044da59f.css"
|
|
55
|
+
Then I should see 'background-image: url("../images/jquery-mobile/icons-18-white-1681b2cc.png")'
|
|
56
|
+
|
|
57
|
+
Scenario: Enabling an asset host still produces hashed files and references
|
|
58
|
+
Given the Server is running at "asset-hash-host-app"
|
|
59
|
+
When I go to "/"
|
|
60
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-72c69c91.css"'
|
|
61
|
+
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
|
62
|
+
When I go to "/subdir/"
|
|
63
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-72c69c91.css"'
|
|
64
|
+
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
|
65
|
+
When I go to "/other/"
|
|
66
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-72c69c91.css"'
|
|
67
|
+
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
|
68
|
+
|
|
69
|
+
Scenario: The asset hash should change when a SASS partial changes
|
|
70
|
+
Given the Server is running at "asset-hash-app"
|
|
71
|
+
And the file "source/stylesheets/_partial.sass" has the contents
|
|
72
|
+
"""
|
|
73
|
+
body
|
|
74
|
+
font-size: 14px
|
|
75
|
+
"""
|
|
76
|
+
When I go to "/partials/"
|
|
77
|
+
Then I should see 'href="../stylesheets/uses_partials-423a00f7.css'
|
|
78
|
+
And wait a second
|
|
79
|
+
And the file "source/stylesheets/_partial.sass" has the contents
|
|
80
|
+
"""
|
|
81
|
+
body
|
|
82
|
+
font-size: 18px !important
|
|
83
|
+
"""
|
|
84
|
+
When I go to "/partials/"
|
|
85
|
+
Then I should see 'href="../stylesheets/uses_partials-e8c3d4eb.css'
|
|
86
|
+
|
|
87
|
+
Scenario: The asset hash should change when a Javascript partial changes
|
|
88
|
+
Given the Server is running at "asset-hash-app"
|
|
89
|
+
And the file "source/javascripts/sprockets_sub.js" has the contents
|
|
90
|
+
"""
|
|
91
|
+
function sprockets_sub_function() { }
|
|
92
|
+
"""
|
|
93
|
+
When I go to "/partials/"
|
|
94
|
+
Then I should see 'src="../javascripts/sprockets_base-0252a861.js'
|
|
95
|
+
When I go to "/javascripts/sprockets_base-0252a861.js"
|
|
96
|
+
Then I should see "sprockets_sub_function"
|
|
97
|
+
And wait a second
|
|
98
|
+
And the file "source/javascripts/sprockets_sub.js" has the contents
|
|
99
|
+
"""
|
|
100
|
+
function sprockets_sub2_function() { }
|
|
101
|
+
"""
|
|
102
|
+
When I go to "/partials/"
|
|
103
|
+
Then I should see 'src="../javascripts/sprockets_base-5121d891.js'
|
|
104
|
+
When I go to "/javascripts/sprockets_base-5121d891.js"
|
|
105
|
+
Then I should see "sprockets_sub2_function"
|
data/features/asset_hash.feature
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
@new
|
|
2
|
+
Feature: Assets get a file hash appended to their URL and references to them are updated
|
|
2
3
|
Scenario: Hashed-asset files are produced, and HTML, CSS, and JavaScript gets rewritten to reference the new files
|
|
3
4
|
Given a successfully built app at "asset-hash-app"
|
|
4
5
|
When I cd to "build"
|
|
@@ -8,7 +9,7 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
|
|
8
9
|
| images/100px-5fd6fb90.jpg |
|
|
9
10
|
| images/100px-5fd6fb90.gif |
|
|
10
11
|
| javascripts/application-df677242.js |
|
|
11
|
-
| stylesheets/site-
|
|
12
|
+
| stylesheets/site-b7f4d02f.css |
|
|
12
13
|
| index.html |
|
|
13
14
|
| subdir/index.html |
|
|
14
15
|
| other/index.html |
|
|
@@ -20,51 +21,51 @@ Feature: Assets get a file hash appended to their and references to them are upd
|
|
|
20
21
|
| stylesheets/site.css |
|
|
21
22
|
|
|
22
23
|
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-
|
|
24
|
+
And the file "stylesheets/site-b7f4d02f.css" should contain 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
|
25
|
+
And the file "index.html" should contain 'href="stylesheets/site-b7f4d02f.css"'
|
|
25
26
|
And the file "index.html" should contain 'src="javascripts/application-df677242.js"'
|
|
26
27
|
And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
|
|
27
|
-
And the file "subdir/index.html" should contain 'href="../stylesheets/site-
|
|
28
|
+
And the file "subdir/index.html" should contain 'href="../stylesheets/site-b7f4d02f.css"'
|
|
28
29
|
And the file "subdir/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
|
29
30
|
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-
|
|
31
|
+
And the file "other/index.html" should contain 'href="../stylesheets/site-b7f4d02f.css"'
|
|
31
32
|
And the file "other/index.html" should contain 'src="../javascripts/application-df677242.js"'
|
|
32
33
|
And the file "other/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
|
|
33
34
|
|
|
34
35
|
Scenario: Hashed assets work in preview server
|
|
35
36
|
Given the Server is running at "asset-hash-app"
|
|
36
37
|
When I go to "/"
|
|
37
|
-
Then I should see 'href="stylesheets/site-
|
|
38
|
-
Then I should see 'href="stylesheets/jquery-mobile-
|
|
38
|
+
Then I should see 'href="stylesheets/site-b7f4d02f.css"'
|
|
39
|
+
Then I should see 'href="stylesheets/jquery-mobile-9835967d.css"'
|
|
39
40
|
And I should see 'src="javascripts/application-df677242.js"'
|
|
40
41
|
And I should see 'src="images/100px-5fd6fb90.jpg"'
|
|
41
42
|
When I go to "/subdir/"
|
|
42
|
-
Then I should see 'href="../stylesheets/site-
|
|
43
|
+
Then I should see 'href="../stylesheets/site-b7f4d02f.css"'
|
|
43
44
|
And I should see 'src="../javascripts/application-df677242.js"'
|
|
44
45
|
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
|
45
46
|
When I go to "/other/"
|
|
46
|
-
Then I should see 'href="../stylesheets/site-
|
|
47
|
+
Then I should see 'href="../stylesheets/site-b7f4d02f.css"'
|
|
47
48
|
And I should see 'src="../javascripts/application-df677242.js"'
|
|
48
49
|
And I should see 'src="../images/100px-5fd6fb90.jpg"'
|
|
49
50
|
When I go to "/javascripts/application-df677242.js"
|
|
50
51
|
Then I should see "img.src = '/images/100px-5fd6fb90.jpg'"
|
|
51
|
-
When I go to "/stylesheets/site-
|
|
52
|
+
When I go to "/stylesheets/site-b7f4d02f.css"
|
|
52
53
|
Then I should see 'background-image: url("../images/100px-5fd6fb90.jpg")'
|
|
53
|
-
When I go to "/stylesheets/jquery-mobile-
|
|
54
|
+
When I go to "/stylesheets/jquery-mobile-9835967d.css"
|
|
54
55
|
Then I should see 'background-image: url("../images/jquery-mobile/icons-18-white-1681b2cc.png")'
|
|
55
56
|
|
|
56
57
|
Scenario: Enabling an asset host still produces hashed files and references
|
|
57
58
|
Given the Server is running at "asset-hash-host-app"
|
|
58
59
|
When I go to "/"
|
|
59
|
-
Then I should see 'href="http://middlemanapp.com/stylesheets/site-
|
|
60
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-1fdf4fb5.css"'
|
|
60
61
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
|
61
62
|
When I go to "/subdir/"
|
|
62
|
-
Then I should see 'href="http://middlemanapp.com/stylesheets/site-
|
|
63
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-1fdf4fb5.css"'
|
|
63
64
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
|
64
65
|
When I go to "/other/"
|
|
65
|
-
Then I should see 'href="http://middlemanapp.com/stylesheets/site-
|
|
66
|
+
Then I should see 'href="http://middlemanapp.com/stylesheets/site-1fdf4fb5.css"'
|
|
66
67
|
And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
|
|
67
|
-
When I go to "/stylesheets/site-
|
|
68
|
+
When I go to "/stylesheets/site-1fdf4fb5.css"
|
|
68
69
|
Then I should see 'background-image: url("http://middlemanapp.com/images/100px-5fd6fb90.jpg")'
|
|
69
70
|
|
|
70
71
|
Scenario: The asset hash should change when a SASS partial changes
|
data/features/sprockets.feature
CHANGED
|
@@ -43,7 +43,19 @@ Feature: Sprockets
|
|
|
43
43
|
Then I should see 'src="/javascripts/dependency2.js?body=1"'
|
|
44
44
|
Then I should see 'src="/javascripts/dependency1.js?body=1"'
|
|
45
45
|
Then I should see 'src="/javascripts/main.js?body=1"'
|
|
46
|
+
|
|
47
|
+
Scenario: Sprockets CSS should only contain body when requested
|
|
48
|
+
Given the Server is running at "sprockets-app-debug-assets"
|
|
49
|
+
When I go to "/stylesheets/app.css?body=1"
|
|
50
|
+
Then I should see "body"
|
|
46
51
|
|
|
52
|
+
Scenario: Stylesheets tags should be provided individually while debugging assets
|
|
53
|
+
Given the Server is running at "sprockets-app-debug-assets"
|
|
54
|
+
When I go to "/index.html"
|
|
55
|
+
Then I should see 'href="/stylesheets/app.css?body=1"'
|
|
56
|
+
Then I should see 'href="/stylesheets/dependency1.css?body=1"'
|
|
57
|
+
Then I should see 'href="/stylesheets/dependency2.css?body=1"'
|
|
58
|
+
|
|
47
59
|
Scenario: Multiple engine files should build correctly
|
|
48
60
|
Given a successfully built app at "sprockets-app2"
|
|
49
61
|
When I cd to "build"
|
|
@@ -3,17 +3,17 @@ Feature: Sprockets Gems
|
|
|
3
3
|
Given the Server is running at "sprockets-app"
|
|
4
4
|
When I go to "/library/js/jquery_include.js"
|
|
5
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"
|
|
9
9
|
When I go to "/library/css/bootstrap_include.css"
|
|
10
10
|
Then I should see ".btn-mini"
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
Scenario: Sprockets can pull js from vendored assets
|
|
13
13
|
Given the Server is running at "sprockets-app"
|
|
14
14
|
When I go to "/library/js/vendored_include.js"
|
|
15
15
|
Then I should see "var vendored_js_included = true;"
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
Scenario: Sprockets can pull js from custom vendor dir
|
|
18
18
|
Given the Server is running at "asset-paths-app"
|
|
19
19
|
When I go to "/javascripts/vendored_include.js"
|
|
@@ -58,3 +58,10 @@ Feature: Sprockets Gems
|
|
|
58
58
|
And the Server is running at "jquery-mobile-app"
|
|
59
59
|
When I go to "/javascripts/jquery.mobile.js"
|
|
60
60
|
Then I should get a response with status "200"
|
|
61
|
+
|
|
62
|
+
Scenario: JS/CSS from gems are accessible when debugging assets and they are required
|
|
63
|
+
Given the Server is running at "sprockets-app-debug-assets"
|
|
64
|
+
And the Server is running at "sprockets-app-debug-assets"
|
|
65
|
+
When I go to "/index.html"
|
|
66
|
+
When I go to "/javascripts/bootstrap-alert.js?body=1"
|
|
67
|
+
Then I should get a response with status "200"
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
<%= javascript_include_tag "main", :data => { :name => "main" } %>
|
|
1
|
+
<%= javascript_include_tag "main", :data => { :name => "main" } %>
|
|
2
|
+
<%= stylesheet_link_tag "app" %>
|
|
File without changes
|
|
File without changes
|
|
@@ -14,11 +14,17 @@ module Middleman::Sprockets
|
|
|
14
14
|
app.send :include, InstanceMethods
|
|
15
15
|
|
|
16
16
|
app.helpers JavascriptTagHelper
|
|
17
|
+
app.helpers StylesheetTagHelper
|
|
17
18
|
|
|
18
19
|
::Tilt.register ::Sprockets::EjsTemplate, 'ejs'
|
|
19
20
|
::Tilt.register ::Sprockets::EcoTemplate, 'eco'
|
|
21
|
+
::Tilt.register ::Sprockets::JstProcessor, 'jst'
|
|
20
22
|
|
|
21
23
|
app.after_configuration do
|
|
24
|
+
template_extensions :jst => :js, :eco => :js, :ejs => :js
|
|
25
|
+
|
|
26
|
+
sitemap.rebuild_resource_list!
|
|
27
|
+
|
|
22
28
|
# Add any gems with (vendor|app|.)/assets/javascripts to paths
|
|
23
29
|
# also add similar directories from project root (like in rails)
|
|
24
30
|
try_paths = [
|
|
@@ -217,7 +223,8 @@ module Middleman::Sprockets
|
|
|
217
223
|
end
|
|
218
224
|
resource = @app.sitemap.find_resource_by_destination_path(request_path)
|
|
219
225
|
|
|
220
|
-
|
|
226
|
+
debug_assets = @app.respond_to?(:debug_assets) && @app.debug_assets && !@app.build?
|
|
227
|
+
if !resource && !debug_assets
|
|
221
228
|
response = ::Rack::Response.new
|
|
222
229
|
response.status = 404
|
|
223
230
|
response.write """<html><body><h1>File Not Found</h1><p>#{request_path}</p>
|
|
@@ -267,6 +274,32 @@ module Middleman::Sprockets
|
|
|
267
274
|
end
|
|
268
275
|
end
|
|
269
276
|
|
|
277
|
+
module StylesheetTagHelper
|
|
278
|
+
|
|
279
|
+
# extend padrinos stylesheet_link_tag with debug functionality
|
|
280
|
+
# splits up stylesheets dependencies in individual files when
|
|
281
|
+
# configuration variable :debug_assets is set to true
|
|
282
|
+
def stylesheet_link_tag(*sources)
|
|
283
|
+
if respond_to?(:debug_assets) && debug_assets && !build?
|
|
284
|
+
options = sources.extract_options!.symbolize_keys
|
|
285
|
+
# loop through all sources and the dependencies and
|
|
286
|
+
# output each as script tag in the correct order
|
|
287
|
+
|
|
288
|
+
sources.map do |source|
|
|
289
|
+
dependencies_paths = sprockets[source].to_a.map do |dependency|
|
|
290
|
+
# if sprockets sees "?body=1" it only gives back the body
|
|
291
|
+
# of the script without the dependencies included
|
|
292
|
+
dependency.logical_path + "?body=1"
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
super(dependencies_paths, options)
|
|
296
|
+
end.join("").gsub("body=1.css", "body=1")
|
|
297
|
+
else
|
|
298
|
+
super
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
270
303
|
class SitemapExtension
|
|
271
304
|
def initialize(app)
|
|
272
305
|
@app = app
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# who tries something similar, this redefines sprockets-sass' function to not refer to image_path.
|
|
4
4
|
#
|
|
5
5
|
# See https://github.com/middleman/middleman/issues/864 for more info.
|
|
6
|
-
#
|
|
6
|
+
#
|
|
7
7
|
module Sass::Script::Functions
|
|
8
8
|
def image_url(source, options = {}, cache_buster = nil)
|
|
9
9
|
# Work with the Compass #image_url API
|
|
@@ -17,4 +17,9 @@ module Sass::Script::Functions
|
|
|
17
17
|
end
|
|
18
18
|
::Sass::Script::String.new "url(\"#{sprockets_context.image_path(source.value, map_options(options)).to_s}\")"
|
|
19
19
|
end
|
|
20
|
+
|
|
21
|
+
# Also override generated_image_url to use Sprockets a la https://github.com/Compass/compass-rails/blob/98e4b115c8bb6395a1c3351926d574321396778b/lib/compass-rails/patches/3_1.rb
|
|
22
|
+
def generated_image_url(path, only_path = nil)
|
|
23
|
+
asset_url(path, Sass::Script::String.new("image"))
|
|
24
|
+
end
|
|
20
25
|
end
|
data/middleman-sprockets.gemspec
CHANGED
|
@@ -17,8 +17,12 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
s.files = `git ls-files -z`.split("\0")
|
|
18
18
|
s.test_files = `git ls-files -z -- {fixtures,features}/*`.split("\0")
|
|
19
19
|
s.require_paths = ["lib"]
|
|
20
|
-
|
|
21
|
-
s.add_dependency("middleman-
|
|
20
|
+
|
|
21
|
+
s.add_dependency("middleman-core", [">= 3.0.14"])
|
|
22
22
|
s.add_dependency("sprockets", ["~> 2.1"])
|
|
23
23
|
s.add_dependency("sprockets-sass", ["~> 1.0.0"])
|
|
24
|
-
|
|
24
|
+
s.add_dependency("sprockets-helpers", ["~> 1.0.0"])
|
|
25
|
+
|
|
26
|
+
# We must depend on padrino-helpers so that middleman-core loads its helpers
|
|
27
|
+
s.add_dependency("padrino-helpers", ["0.10.7"])
|
|
28
|
+
end
|
metadata
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: middleman-sprockets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.1
|
|
5
|
+
prerelease:
|
|
5
6
|
platform: ruby
|
|
6
7
|
authors:
|
|
7
8
|
- Thomas Reynolds
|
|
8
9
|
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date: 2013-05-
|
|
12
|
+
date: 2013-05-12 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: middleman-
|
|
15
|
+
name: middleman-core
|
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
16
18
|
requirements:
|
|
17
|
-
- - '>='
|
|
19
|
+
- - ! '>='
|
|
18
20
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.0.
|
|
21
|
+
version: 3.0.14
|
|
20
22
|
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
23
26
|
requirements:
|
|
24
|
-
- - '>='
|
|
27
|
+
- - ! '>='
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.0.
|
|
29
|
+
version: 3.0.14
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
|
28
31
|
name: sprockets
|
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
30
34
|
requirements:
|
|
31
35
|
- - ~>
|
|
32
36
|
- !ruby/object:Gem::Version
|
|
@@ -34,6 +38,7 @@ dependencies:
|
|
|
34
38
|
type: :runtime
|
|
35
39
|
prerelease: false
|
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
37
42
|
requirements:
|
|
38
43
|
- - ~>
|
|
39
44
|
- !ruby/object:Gem::Version
|
|
@@ -41,6 +46,7 @@ dependencies:
|
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
|
42
47
|
name: sprockets-sass
|
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
44
50
|
requirements:
|
|
45
51
|
- - ~>
|
|
46
52
|
- !ruby/object:Gem::Version
|
|
@@ -48,10 +54,43 @@ dependencies:
|
|
|
48
54
|
type: :runtime
|
|
49
55
|
prerelease: false
|
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
51
58
|
requirements:
|
|
52
59
|
- - ~>
|
|
53
60
|
- !ruby/object:Gem::Version
|
|
54
61
|
version: 1.0.0
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
63
|
+
name: sprockets-helpers
|
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
|
65
|
+
none: false
|
|
66
|
+
requirements:
|
|
67
|
+
- - ~>
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: 1.0.0
|
|
70
|
+
type: :runtime
|
|
71
|
+
prerelease: false
|
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ~>
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: 1.0.0
|
|
78
|
+
- !ruby/object:Gem::Dependency
|
|
79
|
+
name: padrino-helpers
|
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - '='
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: 0.10.7
|
|
86
|
+
type: :runtime
|
|
87
|
+
prerelease: false
|
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
+
none: false
|
|
90
|
+
requirements:
|
|
91
|
+
- - '='
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: 0.10.7
|
|
55
94
|
description: Sprockets support for Middleman
|
|
56
95
|
email:
|
|
57
96
|
- me@tdreyno.com
|
|
@@ -67,6 +106,7 @@ files:
|
|
|
67
106
|
- LICENSE
|
|
68
107
|
- README.md
|
|
69
108
|
- Rakefile
|
|
109
|
+
- features/asset_hash-3.0.feature
|
|
70
110
|
- features/asset_hash.feature
|
|
71
111
|
- features/jst.feature
|
|
72
112
|
- features/sass_globs.feature
|
|
@@ -124,6 +164,9 @@ files:
|
|
|
124
164
|
- fixtures/sprockets-app-debug-assets/source/javascripts/dependency1.js
|
|
125
165
|
- fixtures/sprockets-app-debug-assets/source/javascripts/dependency2.js
|
|
126
166
|
- fixtures/sprockets-app-debug-assets/source/javascripts/main.js
|
|
167
|
+
- fixtures/sprockets-app-debug-assets/source/stylesheets/app.css.scss
|
|
168
|
+
- fixtures/sprockets-app-debug-assets/source/stylesheets/dependency1.css
|
|
169
|
+
- fixtures/sprockets-app-debug-assets/source/stylesheets/dependency2.css.scss
|
|
127
170
|
- fixtures/sprockets-app/config.rb
|
|
128
171
|
- fixtures/sprockets-app/source/index.html.erb
|
|
129
172
|
- fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss
|
|
@@ -162,28 +205,36 @@ files:
|
|
|
162
205
|
- middleman-sprockets.gemspec
|
|
163
206
|
homepage: https://github.com/middleman/middleman-sprockets
|
|
164
207
|
licenses: []
|
|
165
|
-
metadata: {}
|
|
166
208
|
post_install_message:
|
|
167
209
|
rdoc_options: []
|
|
168
210
|
require_paths:
|
|
169
211
|
- lib
|
|
170
212
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
|
+
none: false
|
|
171
214
|
requirements:
|
|
172
|
-
- - '>='
|
|
215
|
+
- - ! '>='
|
|
173
216
|
- !ruby/object:Gem::Version
|
|
174
217
|
version: '0'
|
|
218
|
+
segments:
|
|
219
|
+
- 0
|
|
220
|
+
hash: 2326151710291453877
|
|
175
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
|
+
none: false
|
|
176
223
|
requirements:
|
|
177
|
-
- - '>='
|
|
224
|
+
- - ! '>='
|
|
178
225
|
- !ruby/object:Gem::Version
|
|
179
226
|
version: '0'
|
|
227
|
+
segments:
|
|
228
|
+
- 0
|
|
229
|
+
hash: 2326151710291453877
|
|
180
230
|
requirements: []
|
|
181
231
|
rubyforge_project: middleman-sprockets
|
|
182
|
-
rubygems_version:
|
|
232
|
+
rubygems_version: 1.8.24
|
|
183
233
|
signing_key:
|
|
184
|
-
specification_version:
|
|
234
|
+
specification_version: 3
|
|
185
235
|
summary: Sprockets support for Middleman
|
|
186
236
|
test_files:
|
|
237
|
+
- features/asset_hash-3.0.feature
|
|
187
238
|
- features/asset_hash.feature
|
|
188
239
|
- features/jst.feature
|
|
189
240
|
- features/sass_globs.feature
|
|
@@ -241,6 +292,9 @@ test_files:
|
|
|
241
292
|
- fixtures/sprockets-app-debug-assets/source/javascripts/dependency1.js
|
|
242
293
|
- fixtures/sprockets-app-debug-assets/source/javascripts/dependency2.js
|
|
243
294
|
- fixtures/sprockets-app-debug-assets/source/javascripts/main.js
|
|
295
|
+
- fixtures/sprockets-app-debug-assets/source/stylesheets/app.css.scss
|
|
296
|
+
- fixtures/sprockets-app-debug-assets/source/stylesheets/dependency1.css
|
|
297
|
+
- fixtures/sprockets-app-debug-assets/source/stylesheets/dependency2.css.scss
|
|
244
298
|
- fixtures/sprockets-app/config.rb
|
|
245
299
|
- fixtures/sprockets-app/source/index.html.erb
|
|
246
300
|
- fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss
|
checksums.yaml
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
SHA1:
|
|
3
|
-
metadata.gz: aa7d0080651243d4dcebda2e3b0331031da0e96e
|
|
4
|
-
data.tar.gz: 7bfc7aa5dff00b290ec486ea20ca24908833eca5
|
|
5
|
-
SHA512:
|
|
6
|
-
metadata.gz: 85f41fa46b95f6b74aeb3ca3a7249dd95cc35838cbfcdf7453c53eed8b215a8697bbc12e0e813def7c7a540ec9b9f426bea39e05c3a72d55369b49a5268dea86
|
|
7
|
-
data.tar.gz: d4675f3b632e72aac0858e5514648acfb4ded84c1b16346cbe2168044400f533736a53705fbfc1303ca77514939031b61630465fdab08e96020d3f454e2ef20f
|