sprockets-derailleur 0.0.10 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sprockets-derailleur/manifest.rb +25 -7
- data/lib/sprockets-derailleur/version.rb +1 -1
- data/sprockets-derailleur.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44edd61c8b242defbd08b9e80a68cef7b2f15ebc
|
4
|
+
data.tar.gz: bbe80f95343fc291abb6138a543769411f51a0fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab698ea4f8ae75a34e724c000a07fa7605a0bf8db4f71bb08144440886e9aafa84a622c467754859b26f809b9e6187161b625450b09b13412615cb7ef9a2b54
|
7
|
+
data.tar.gz: 6e40312aabc329f8d56340105720d3394c5ca0c0d7cf888a6b8cdc013a7695370ea3c2bfe1525c3516f7c7bae490ee25210018cd3efa24129de1992f400a9ad7
|
@@ -98,8 +98,7 @@ module Sprockets
|
|
98
98
|
time = Benchmark.measure do
|
99
99
|
data = {'assets' => {}, 'files' => {}, 'errors' => {}}
|
100
100
|
|
101
|
-
|
102
|
-
|
101
|
+
version_agnostic_find(path).each do |asset|
|
103
102
|
data['files'][asset.digest_path] = {
|
104
103
|
'logical_path' => asset.logical_path,
|
105
104
|
'mtime' => asset.mtime.iso8601,
|
@@ -113,14 +112,11 @@ module Sprockets
|
|
113
112
|
if File.exist?(target)
|
114
113
|
logger.debug "Skipping #{target}, already exists"
|
115
114
|
else
|
116
|
-
logger.
|
115
|
+
logger.info "Writing #{target}"
|
117
116
|
asset.write_to target
|
118
|
-
asset.write_to "#{target}.gz"
|
117
|
+
asset.write_to "#{target}.gz" unless skip_gzip?(asset)
|
119
118
|
end
|
120
119
|
|
121
|
-
Marshal.dump(data, child_write)
|
122
|
-
else
|
123
|
-
data['errors'][path] = "Not found"
|
124
120
|
Marshal.dump(data, child_write)
|
125
121
|
end
|
126
122
|
end
|
@@ -138,5 +134,27 @@ module Sprockets
|
|
138
134
|
|
139
135
|
{:read => parent_read, :write => parent_write, :pid => pid}
|
140
136
|
end
|
137
|
+
|
138
|
+
private
|
139
|
+
|
140
|
+
def version_agnostic_find(*args)
|
141
|
+
if sprockets2?
|
142
|
+
[find_asset(*args)].each
|
143
|
+
else
|
144
|
+
find(*args)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def sprockets2?
|
149
|
+
Sprockets::VERSION.start_with?('2')
|
150
|
+
end
|
151
|
+
|
152
|
+
def skip_gzip?(asset)
|
153
|
+
if sprockets2?
|
154
|
+
asset.is_a?(BundledAsset)
|
155
|
+
else
|
156
|
+
environment.skip_gzip?
|
157
|
+
end
|
158
|
+
end
|
141
159
|
end
|
142
160
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-derailleur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steel Fu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sprockets
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2'
|
27
27
|
description: Speed up sprockets compiling by forking processes
|