sprockets 3.0.0.beta.9 → 3.0.0.beta.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sprockets.rb +4 -25
- data/lib/sprockets/bower.rb +1 -2
- data/lib/sprockets/context.rb +5 -1
- data/lib/sprockets/manifest.rb +1 -0
- data/lib/sprockets/path_utils.rb +22 -9
- data/lib/sprockets/processing.rb +1 -0
- 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: 62bc83e5dba29c526fc06ee79618cac3013f5ab1
|
4
|
+
data.tar.gz: 8d5716e9158a481ac8893badaddba2562b2d5e2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e31bcaac28fe9d231373471e49c91edf25bc27775ebc80f14949258be4dea66ddf9f48340b5e44613d195ade34b96c74898fd482224fe91a0204d69cea5312a
|
7
|
+
data.tar.gz: 48002bb898333ca896ec592603ef32ece5a1528d8dbc45d12618e5f80cd2cc905f758795f7d1305a6e44086fcf47f4ecdb422ca78404b70b2a454cbfd7df0473
|
data/lib/sprockets.rb
CHANGED
@@ -1,32 +1,11 @@
|
|
1
1
|
require 'sprockets/version'
|
2
2
|
require 'sprockets/autoload'
|
3
|
+
require 'sprockets/cache'
|
4
|
+
require 'sprockets/environment'
|
5
|
+
require 'sprockets/errors'
|
6
|
+
require 'sprockets/manifest'
|
3
7
|
|
4
8
|
module Sprockets
|
5
|
-
# Environment
|
6
|
-
autoload :Asset, 'sprockets/asset'
|
7
|
-
autoload :Base, 'sprockets/base'
|
8
|
-
autoload :CachedEnvironment, 'sprockets/cached_environment'
|
9
|
-
autoload :Environment, 'sprockets/environment'
|
10
|
-
autoload :Manifest, 'sprockets/manifest'
|
11
|
-
|
12
|
-
# Processing
|
13
|
-
autoload :Bundle, 'sprockets/bundle'
|
14
|
-
autoload :Context, 'sprockets/context'
|
15
|
-
autoload :DirectiveProcessor, 'sprockets/directive_processor'
|
16
|
-
autoload :FileReader, 'sprockets/file_reader'
|
17
|
-
|
18
|
-
# Internal utilities
|
19
|
-
autoload :ArgumentError, 'sprockets/errors'
|
20
|
-
autoload :Cache, 'sprockets/cache'
|
21
|
-
autoload :ContentTypeMismatch, 'sprockets/errors'
|
22
|
-
autoload :DigestUtils, 'sprockets/digest_utils'
|
23
|
-
autoload :EncodingUtils, 'sprockets/encoding_utils'
|
24
|
-
autoload :Error, 'sprockets/errors'
|
25
|
-
autoload :FileNotFound, 'sprockets/errors'
|
26
|
-
autoload :HTTPUtils, 'sprockets/http_utils'
|
27
|
-
autoload :PathUtils, 'sprockets/path_utils'
|
28
|
-
autoload :Utils, 'sprockets/utils'
|
29
|
-
|
30
9
|
require 'sprockets/processor_utils'
|
31
10
|
extend ProcessorUtils
|
32
11
|
|
data/lib/sprockets/bower.rb
CHANGED
@@ -19,9 +19,8 @@ module Sprockets
|
|
19
19
|
# bower.json can only be nested one level deep
|
20
20
|
if !logical_path.index('/')
|
21
21
|
dirname = File.join(load_path, logical_path)
|
22
|
-
stat = self.stat(dirname)
|
23
22
|
|
24
|
-
if
|
23
|
+
if directory?(dirname)
|
25
24
|
filenames = POSSIBLE_BOWER_JSONS.map { |basename| File.join(dirname, basename) }
|
26
25
|
filename = filenames.detect { |fn| self.file?(fn) }
|
27
26
|
|
data/lib/sprockets/context.rb
CHANGED
@@ -108,7 +108,11 @@ module Sprockets
|
|
108
108
|
# the dependency file with invalidate the cache of the
|
109
109
|
# source file.
|
110
110
|
def depend_on(path)
|
111
|
-
|
111
|
+
if environment.absolute_path?(path) && environment.directory?(path)
|
112
|
+
@dependencies << environment.build_file_digest_uri(path)
|
113
|
+
else
|
114
|
+
resolve(path, compat: false)
|
115
|
+
end
|
112
116
|
nil
|
113
117
|
end
|
114
118
|
|
data/lib/sprockets/manifest.rb
CHANGED
@@ -240,6 +240,7 @@ module Sprockets
|
|
240
240
|
# Persist manfiest back to FS
|
241
241
|
def save
|
242
242
|
if @rename_filename
|
243
|
+
logger.info "Renaming #{@filename} to #{@rename_filename}"
|
243
244
|
FileUtils.mv(@filename, @rename_filename)
|
244
245
|
@filename = @rename_filename
|
245
246
|
@rename_filename = nil
|
data/lib/sprockets/path_utils.rb
CHANGED
@@ -8,7 +8,7 @@ module Sprockets
|
|
8
8
|
module PathUtils
|
9
9
|
extend self
|
10
10
|
|
11
|
-
#
|
11
|
+
# Public: Like `File.stat`.
|
12
12
|
#
|
13
13
|
# path - String file or directory path
|
14
14
|
#
|
@@ -21,7 +21,7 @@ module Sprockets
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
#
|
24
|
+
# Public: Like `File.file?`.
|
25
25
|
#
|
26
26
|
# path - String file path.
|
27
27
|
#
|
@@ -34,7 +34,20 @@ module Sprockets
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
#
|
37
|
+
# Public: Like `File.directory?`.
|
38
|
+
#
|
39
|
+
# path - String file path.
|
40
|
+
#
|
41
|
+
# Returns true path exists and is a directory.
|
42
|
+
def directory?(path)
|
43
|
+
if stat = self.stat(path)
|
44
|
+
stat.directory?
|
45
|
+
else
|
46
|
+
false
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Public: A version of `Dir.entries` that filters out `.` files and `~`
|
38
51
|
# swap files.
|
39
52
|
#
|
40
53
|
# path - String directory path
|
@@ -48,7 +61,7 @@ module Sprockets
|
|
48
61
|
end
|
49
62
|
end
|
50
63
|
|
51
|
-
#
|
64
|
+
# Public: Check if path is absolute or relative.
|
52
65
|
#
|
53
66
|
# path - String path.
|
54
67
|
#
|
@@ -73,7 +86,7 @@ module Sprockets
|
|
73
86
|
SEPARATOR_PATTERN = "#{Regexp.quote(File::SEPARATOR)}"
|
74
87
|
end
|
75
88
|
|
76
|
-
#
|
89
|
+
# Public: Check if path is explicitly relative.
|
77
90
|
# Starts with "./" or "../".
|
78
91
|
#
|
79
92
|
# path - String path.
|
@@ -178,7 +191,7 @@ module Sprockets
|
|
178
191
|
nil
|
179
192
|
end
|
180
193
|
|
181
|
-
#
|
194
|
+
# Public: Stat all the files under a directory.
|
182
195
|
#
|
183
196
|
# dir - A String directory
|
184
197
|
#
|
@@ -196,7 +209,7 @@ module Sprockets
|
|
196
209
|
nil
|
197
210
|
end
|
198
211
|
|
199
|
-
#
|
212
|
+
# Public: Recursive stat all the files under a directory.
|
200
213
|
#
|
201
214
|
# dir - A String directory
|
202
215
|
#
|
@@ -215,7 +228,7 @@ module Sprockets
|
|
215
228
|
nil
|
216
229
|
end
|
217
230
|
|
218
|
-
#
|
231
|
+
# Public: Recursive stat all the files under a directory in alphabetical
|
219
232
|
# order.
|
220
233
|
#
|
221
234
|
# dir - A String directory
|
@@ -237,7 +250,7 @@ module Sprockets
|
|
237
250
|
nil
|
238
251
|
end
|
239
252
|
|
240
|
-
#
|
253
|
+
# Public: Write to a file atomically. Useful for situations where you
|
241
254
|
# don't want other processes or threads to see half-written files.
|
242
255
|
#
|
243
256
|
# Utils.atomic_write('important.file') do |file|
|
data/lib/sprockets/processing.rb
CHANGED
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.0.0.beta.
|
4
|
+
version: 3.0.0.beta.10
|
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-03-
|
12
|
+
date: 2015-03-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|