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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caf3244905bdee840f05ab6759977b7f98c64921
4
- data.tar.gz: f676a2f7daa2c17cf32e1b7d4b3746a7a5e2d0bc
3
+ metadata.gz: 44edd61c8b242defbd08b9e80a68cef7b2f15ebc
4
+ data.tar.gz: bbe80f95343fc291abb6138a543769411f51a0fd
5
5
  SHA512:
6
- metadata.gz: 83a6b09367f665122853260c998c9f057c6adc5a1f5b027859889716eb6629853ea051ecdac22cf37f2a7e15c292111164571ea2faa07ae956f74fb866b5c793
7
- data.tar.gz: 15a912b6380ccdda59ed1fd4067159d71c27e2826492ed20480654ed55cd20f9a785cd01a797863bb554b2ddc10559a2e8b6bbe8b3e852f135e91cef2d392cfa
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
- if asset = find_asset(path)
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.debug "Writing #{target}"
115
+ logger.info "Writing #{target}"
117
116
  asset.write_to target
118
- asset.write_to "#{target}.gz" if asset.is_a?(BundledAsset)
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
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module Derailleur
3
- VERSION = "0.0.10"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency 'sprockets', "~>2"
20
+ gem.add_dependency 'sprockets', '>= 2'
21
21
  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.10
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-06-28 00:00:00.000000000 Z
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