sprockets 3.3.3 → 3.3.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: faadf5a06d9bd72e3aea6d55c30d04dc5521b3b9
4
- data.tar.gz: 8f383977d36ebfa7ab7033304d01bb67a95665fc
3
+ metadata.gz: 868a8e68a48bc62811df5a4ab64435cda6212082
4
+ data.tar.gz: 539c10477811018ad2b8d0f0c8fa9d59191790ce
5
5
  SHA512:
6
- metadata.gz: b42b6cb6a38a4301f18c419a903c3e3d352fd001067ab66a25d75e98ba091e599269d452041f0bb195190fdf60d74e077d13676c7a810889230f76442443aa0f
7
- data.tar.gz: 5f386a5ef36a610d4a84f74283b5eeb7afa32567f47c6dab8c4ee0151d59b856d6d0995f0c7cc0de7e31fd283cad02f72c85d38aa779b023dd77a39fe9066c15
6
+ metadata.gz: 68ffe6c3fb1a5e6d78d44ddcf5450eb075dc7934e84635d73c7878494b958e2939f055686b7976d43448dda199410e0aa7813e341600a8490eaff9e8bd210996
7
+ data.tar.gz: 46d1701fce3b87c73e45deb3977385cdb3b73031ff245d5b57132910246b291ee937372a6dde87fc779eb27bffa6ad7dbea42d67fe823e085e4acc6261bcab06
@@ -1,3 +1,7 @@
1
+ **3.3.4** (September 1, 2015)
2
+
3
+ * Relative cache contents now work with windows.
4
+
1
5
  **3.3.3** (August 21, 2015)
2
6
 
3
7
  * Remove more absolute paths from cache contents.
@@ -19,7 +19,7 @@ module Sprockets
19
19
  #
20
20
  # Returns UnloadedAsset.
21
21
  def initialize(uri, env)
22
- @uri = uri
22
+ @uri = uri.to_s
23
23
  @env = env
24
24
  @compressed_path = URITar.new(uri, env).compressed_path
25
25
  @params = nil # lazy loaded
@@ -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 path.start_with?("/".freeze)
62
+ if absolute_path?
51
63
  # Stored path was absolute, don't add root
52
64
  scheme + path
53
65
  else
54
- # Stored path was relative, add root
55
- scheme + File.join(root, path)
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
- if compressed_path = @env.split_subpath(root, path)
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
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "3.3.3"
2
+ VERSION = "3.3.4"
3
3
  end
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.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-08-21 00:00:00.000000000 Z
12
+ date: 2015-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack