sprockets 3.3.3 → 3.3.4
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.
Potentially problematic release.
This version of sprockets might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sprockets/unloaded_asset.rb +1 -1
- data/lib/sprockets/uri_tar.rb +28 -4
- data/lib/sprockets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 868a8e68a48bc62811df5a4ab64435cda6212082
|
4
|
+
data.tar.gz: 539c10477811018ad2b8d0f0c8fa9d59191790ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68ffe6c3fb1a5e6d78d44ddcf5450eb075dc7934e84635d73c7878494b958e2939f055686b7976d43448dda199410e0aa7813e341600a8490eaff9e8bd210996
|
7
|
+
data.tar.gz: 46d1701fce3b87c73e45deb3977385cdb3b73031ff245d5b57132910246b291ee937372a6dde87fc779eb27bffa6ad7dbea42d67fe823e085e4acc6261bcab06
|
data/CHANGELOG.md
CHANGED
data/lib/sprockets/uri_tar.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'sprockets/path_utils'
|
2
|
+
|
1
3
|
module Sprockets
|
2
4
|
# Internal: used to "expand" and "compress" values for storage
|
3
5
|
class URITar
|
@@ -10,6 +12,7 @@ module Sprockets
|
|
10
12
|
def initialize(uri, env)
|
11
13
|
@root = env.root
|
12
14
|
@env = env
|
15
|
+
uri = uri.to_s
|
13
16
|
if uri.include?("://".freeze)
|
14
17
|
uri_array = uri.split("://".freeze)
|
15
18
|
@scheme = uri_array.shift
|
@@ -34,6 +37,15 @@ module Sprockets
|
|
34
37
|
scheme + compressed_path
|
35
38
|
end
|
36
39
|
|
40
|
+
# Internal: Tells us if we are using an absolute path
|
41
|
+
#
|
42
|
+
# Nix* systems start with a `/` like /Users/schneems.
|
43
|
+
# Windows systems start with a drive letter than colon and slash
|
44
|
+
# like C:/Schneems.
|
45
|
+
def absolute_path?
|
46
|
+
PathUtils.absolute_path?(path)
|
47
|
+
end
|
48
|
+
|
37
49
|
# Internal: Convert a "compressed" uri to an absolute path
|
38
50
|
#
|
39
51
|
# If a uri is inside of the environment's root it will not
|
@@ -47,12 +59,17 @@ module Sprockets
|
|
47
59
|
#
|
48
60
|
# Returns String
|
49
61
|
def expand
|
50
|
-
if
|
62
|
+
if absolute_path?
|
51
63
|
# Stored path was absolute, don't add root
|
52
64
|
scheme + path
|
53
65
|
else
|
54
|
-
|
55
|
-
|
66
|
+
if scheme.empty?
|
67
|
+
File.join(root, path)
|
68
|
+
else
|
69
|
+
# We always want to return an absolute uri,
|
70
|
+
# make sure the path starts with a slash.
|
71
|
+
scheme + File.join("/".freeze, root, path)
|
72
|
+
end
|
56
73
|
end
|
57
74
|
end
|
58
75
|
|
@@ -66,7 +83,14 @@ module Sprockets
|
|
66
83
|
#
|
67
84
|
# Returns String
|
68
85
|
def compressed_path
|
69
|
-
|
86
|
+
# windows
|
87
|
+
if !@root.start_with?("/".freeze) && path.start_with?("/".freeze)
|
88
|
+
consistent_root = "/".freeze + @root
|
89
|
+
else
|
90
|
+
consistent_root = @root
|
91
|
+
end
|
92
|
+
|
93
|
+
if compressed_path = PathUtils.split_subpath(consistent_root, path)
|
70
94
|
compressed_path
|
71
95
|
else
|
72
96
|
path
|
data/lib/sprockets/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|