middleman-sprockets 4.1.0 → 4.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.
- checksums.yaml +4 -4
- data/.travis.yml +7 -8
- data/CHANGELOG.md +5 -0
- data/ISSUE_TEMPLATE.md +10 -0
- data/README.md +1 -0
- data/features/test_cases/proxy_asset.feature +70 -0
- data/lib/middleman-sprockets/extension.rb +13 -1
- data/lib/middleman-sprockets/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34a2daf8999a062df4e3c9748976ae478e53909d
|
|
4
|
+
data.tar.gz: e01569c1de6a03bbb4a82fd55b2858a7358c59a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b7fc8ee856ba9f10aec3778eb0f63c66293d122017b26fd234f78e3914b1a16d1cb1575fc3639db68da2dd16bbe8b25202cbb8c6fd80b935be68e97d672f371
|
|
7
|
+
data.tar.gz: a39d233603ba9e607add0c774fa0ecf724fca7bb21cc6fde2fe2f06b3b67909c5dbb33e6a872921e4619a4ff70860776f5d34a0618c6d0ec01e08c8aada19e8a
|
data/.travis.yml
CHANGED
|
@@ -4,10 +4,9 @@ sudo: false
|
|
|
4
4
|
env: TEST=true
|
|
5
5
|
|
|
6
6
|
rvm:
|
|
7
|
-
- 2.
|
|
8
|
-
- 2.
|
|
9
|
-
- 2.
|
|
10
|
-
- 2.3.1
|
|
7
|
+
- 2.2
|
|
8
|
+
- 2.3.4
|
|
9
|
+
- 2.4.1
|
|
11
10
|
- ruby-head
|
|
12
11
|
|
|
13
12
|
gemfile:
|
|
@@ -15,17 +14,17 @@ gemfile:
|
|
|
15
14
|
|
|
16
15
|
matrix:
|
|
17
16
|
include:
|
|
18
|
-
- rvm: 2.
|
|
17
|
+
- rvm: 2.4.1
|
|
19
18
|
gemfile: gemfiles/middleman-head.gemfile
|
|
20
19
|
env: SKIP_ASSET_HASH=true MIDDLEMAN_HEAD=true
|
|
21
|
-
- rvm: 2.
|
|
20
|
+
- rvm: 2.4.1
|
|
22
21
|
gemfile: gemfiles/middleman-4.0.gemfile
|
|
23
22
|
env: SKIP_ASSET_HASH=true
|
|
24
|
-
- rvm: 2.
|
|
23
|
+
- rvm: 2.4.1
|
|
25
24
|
gemfile: gemfiles/sprockets-4.0.gemfile
|
|
26
25
|
env: SKIP_ASSET_HASH=true
|
|
27
26
|
|
|
28
27
|
allow_failures:
|
|
29
28
|
- rvm: ruby-head
|
|
30
|
-
- rvm: 2.
|
|
29
|
+
- rvm: 2.4.1
|
|
31
30
|
gemfile: gemfiles/sprockets-4.0.gemfile
|
data/CHANGELOG.md
CHANGED
data/ISSUE_TEMPLATE.md
ADDED
data/README.md
CHANGED
|
@@ -108,6 +108,7 @@ The best way to get quick responses to your issues and swift fixes to your bugs
|
|
|
108
108
|
3. Run `bundle install` inside the project root to install the gem dependencies.
|
|
109
109
|
4. Run test cases: `bundle exec rake test`
|
|
110
110
|
|
|
111
|
+
To run specs for an individual feature, `cucumber features/PATH_TO_FEATURE`
|
|
111
112
|
|
|
112
113
|
## Donate
|
|
113
114
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Feature: Handles proxied assets
|
|
2
|
+
|
|
3
|
+
Scenario: Proxied assets can be renderable via Sprockets
|
|
4
|
+
Given a fixture app "base-app"
|
|
5
|
+
And a file named "config.rb" with:
|
|
6
|
+
"""
|
|
7
|
+
proxy "assets/vendor/site.js", "vendor/site.js"
|
|
8
|
+
|
|
9
|
+
activate :sprockets
|
|
10
|
+
sprockets.append_path File.join(root, "source", "vendor")
|
|
11
|
+
"""
|
|
12
|
+
And a file named "source/vendor/site.js" with:
|
|
13
|
+
"""
|
|
14
|
+
alert("site.js");
|
|
15
|
+
"""
|
|
16
|
+
And the Server is running
|
|
17
|
+
|
|
18
|
+
When I go to "/assets/vendor/site.js"
|
|
19
|
+
Then I should see 'alert("site.js");'
|
|
20
|
+
|
|
21
|
+
Scenario: Proxied assets should be able to require files relative to their source
|
|
22
|
+
Given a fixture app "base-app"
|
|
23
|
+
And a file named "config.rb" with:
|
|
24
|
+
"""
|
|
25
|
+
proxy "assets/vendor/site.js", "vendor/site.js"
|
|
26
|
+
|
|
27
|
+
activate :sprockets
|
|
28
|
+
sprockets.append_path File.join(root, "source", "vendor")
|
|
29
|
+
"""
|
|
30
|
+
And a file named "source/vendor/_include.js" with:
|
|
31
|
+
"""
|
|
32
|
+
console.log("include");
|
|
33
|
+
"""
|
|
34
|
+
And a file named "source/vendor/site.js" with:
|
|
35
|
+
"""
|
|
36
|
+
//= require "_include.js"
|
|
37
|
+
"""
|
|
38
|
+
And the Server is running
|
|
39
|
+
|
|
40
|
+
When I go to "/assets/vendor/site.js"
|
|
41
|
+
Then I should see 'console.log("include");'
|
|
42
|
+
|
|
43
|
+
When I go to "/vendor/site.js"
|
|
44
|
+
Then I should see 'console.log("include");'
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
Scenario: Proxied assets can ignore their source file
|
|
48
|
+
Given a fixture app "base-app"
|
|
49
|
+
And a file named "config.rb" with:
|
|
50
|
+
"""
|
|
51
|
+
proxy "javascripts/site.js", "vendor/site.js", ignore: true
|
|
52
|
+
|
|
53
|
+
activate :sprockets
|
|
54
|
+
sprockets.append_path File.join(root, "source", "vendor")
|
|
55
|
+
"""
|
|
56
|
+
And a file named "source/vendor/_include.js" with:
|
|
57
|
+
"""
|
|
58
|
+
console.log("include");
|
|
59
|
+
"""
|
|
60
|
+
And a file named "source/vendor/site.js" with:
|
|
61
|
+
"""
|
|
62
|
+
//= require "_include.js"
|
|
63
|
+
"""
|
|
64
|
+
And the Server is running
|
|
65
|
+
|
|
66
|
+
When I go to "/javascripts/site.js"
|
|
67
|
+
Then I should see 'console.log("include");'
|
|
68
|
+
|
|
69
|
+
When I go to "/vendor/site.js"
|
|
70
|
+
Then the status code should be "404"
|
|
@@ -114,9 +114,15 @@ module Middleman
|
|
|
114
114
|
Contract ::Middleman::Sitemap::Resource => Or[::Middleman::Sitemap::Resource, Resource]
|
|
115
115
|
def process_sprockets_resource resource
|
|
116
116
|
::Middleman::Util.instrument 'sprockets', name: 'process_resource', resource: resource do
|
|
117
|
-
sprockets_resource = generate_resource(
|
|
117
|
+
sprockets_resource = generate_resource(
|
|
118
|
+
resource.path,
|
|
119
|
+
resource.source_file,
|
|
120
|
+
source_file_relative_to_root(resource)
|
|
121
|
+
)
|
|
118
122
|
@resources.add sprockets_resource
|
|
119
123
|
|
|
124
|
+
sprockets_resource.ignore! if resource.ignored?
|
|
125
|
+
|
|
120
126
|
sprockets_resource
|
|
121
127
|
end
|
|
122
128
|
rescue => e
|
|
@@ -147,6 +153,12 @@ module Middleman
|
|
|
147
153
|
' consider using Sprockets 4.x to render with SassC'
|
|
148
154
|
end
|
|
149
155
|
|
|
156
|
+
def source_file_relative_to_root resource
|
|
157
|
+
Pathname.new(resource.source_file).relative_path_from(
|
|
158
|
+
Pathname.new(File.join(@app.root, @app.config[:source]))
|
|
159
|
+
).to_s
|
|
160
|
+
end
|
|
161
|
+
|
|
150
162
|
# Backwards compatible means of finding all the latest gemspecs
|
|
151
163
|
# available on the system
|
|
152
164
|
#
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: middleman-sprockets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.1.
|
|
4
|
+
version: 4.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Reynolds
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2017-08-28 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: middleman-core
|
|
@@ -72,6 +72,7 @@ files:
|
|
|
72
72
|
- CHANGELOG.md
|
|
73
73
|
- CONTRIBUTING.md
|
|
74
74
|
- Gemfile
|
|
75
|
+
- ISSUE_TEMPLATE.md
|
|
75
76
|
- LICENSE.md
|
|
76
77
|
- README.md
|
|
77
78
|
- Rakefile
|
|
@@ -100,6 +101,7 @@ files:
|
|
|
100
101
|
- features/test_cases/partial_rendering.feature
|
|
101
102
|
- features/test_cases/path_helpers.feature
|
|
102
103
|
- features/test_cases/processible_outside_asset_dir.feature
|
|
104
|
+
- features/test_cases/proxy_asset.feature
|
|
103
105
|
- features/test_cases/sass_globs.feature
|
|
104
106
|
- features/test_cases/sass_partials.feature
|
|
105
107
|
- features/test_cases/sassc.feature
|
|
@@ -205,6 +207,7 @@ test_files:
|
|
|
205
207
|
- features/test_cases/partial_rendering.feature
|
|
206
208
|
- features/test_cases/path_helpers.feature
|
|
207
209
|
- features/test_cases/processible_outside_asset_dir.feature
|
|
210
|
+
- features/test_cases/proxy_asset.feature
|
|
208
211
|
- features/test_cases/sass_globs.feature
|
|
209
212
|
- features/test_cases/sass_partials.feature
|
|
210
213
|
- features/test_cases/sassc.feature
|