sprockets 2.4.3 → 2.4.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprockets might be problematic. Click here for more details.
- data/README.md +5 -0
- data/lib/sprockets/asset.rb +2 -0
- data/lib/sprockets/base.rb +10 -0
- data/lib/sprockets/context.rb +5 -1
- data/lib/sprockets/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -361,6 +361,11 @@ submit a pull request.
|
|
361
361
|
|
362
362
|
## Version History ##
|
363
363
|
|
364
|
+
**2.4.4** (July 2, 2012)
|
365
|
+
|
366
|
+
* Canonicalize logical path extensions
|
367
|
+
* Check absolute paths passed to depend_on
|
368
|
+
|
364
369
|
**2.4.3** (May 16, 2012)
|
365
370
|
|
366
371
|
* Exposed :sprockets in sass options
|
data/lib/sprockets/asset.rb
CHANGED
@@ -33,6 +33,8 @@ module Sprockets
|
|
33
33
|
alias_method :bytesize, :length
|
34
34
|
|
35
35
|
def initialize(environment, logical_path, pathname)
|
36
|
+
raise ArgumentError, "Asset logical path has no extension: #{logical_path}" if File.extname(logical_path) == ""
|
37
|
+
|
36
38
|
@root = environment.root
|
37
39
|
@logical_path = logical_path.to_s
|
38
40
|
@pathname = Pathname.new(pathname)
|
data/lib/sprockets/base.rb
CHANGED
@@ -252,6 +252,16 @@ module Sprockets
|
|
252
252
|
else
|
253
253
|
begin
|
254
254
|
pathname = resolve(logical_path)
|
255
|
+
|
256
|
+
# If logical path is missing a mime type extension, append
|
257
|
+
# the absolute path extname so it has one.
|
258
|
+
#
|
259
|
+
# Ensures some consistency between finding "foo/bar" vs
|
260
|
+
# "foo/bar.js".
|
261
|
+
if File.extname(logical_path) == ""
|
262
|
+
expanded_logical_path = attributes_for(pathname).logical_path
|
263
|
+
logical_path += File.extname(expanded_logical_path)
|
264
|
+
end
|
255
265
|
rescue FileNotFound
|
256
266
|
return nil
|
257
267
|
end
|
data/lib/sprockets/context.rb
CHANGED
@@ -81,7 +81,11 @@ module Sprockets
|
|
81
81
|
attributes = environment.attributes_for(pathname)
|
82
82
|
|
83
83
|
if pathname.absolute?
|
84
|
-
pathname
|
84
|
+
if environment.stat(pathname)
|
85
|
+
pathname
|
86
|
+
else
|
87
|
+
raise FileNotFound, "couldn't find file '#{pathname}'"
|
88
|
+
end
|
85
89
|
|
86
90
|
elsif content_type = options[:content_type]
|
87
91
|
content_type = self.content_type if content_type == :self
|
data/lib/sprockets/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 2.4.
|
9
|
+
- 4
|
10
|
+
version: 2.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sam Stephenson
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-07-03 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: hike
|