sprockets 2.9.0 → 2.9.2

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.

@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2df972b3d977e878f633cc6f24da271aed3875d3
4
+ data.tar.gz: e9dbcb0969a3abcfe3aab778031e888208e77bbe
5
+ SHA512:
6
+ metadata.gz: b6125c1652c05352c6fce6863359d07985519a2ac4277d1498143d6f02e0407a2a5947dce507e9566defb9b2417902f8a741cb54abb0fdb25bb8f5026da25ca9
7
+ data.tar.gz: 89b4f4977147c2f06f433a7e445f8dccbac53282d00fea2ebd3a3b65ae21a306a45eb7ebeef2de92e0b1b7e99ab1693ae7c0adfb88b7c2ece4c2cc9054572250
data/README.md CHANGED
@@ -361,6 +361,15 @@ submit a pull request.
361
361
 
362
362
  ## Version History ##
363
363
 
364
+ **2.9.2** (April 8, 2013)
365
+
366
+ * Improve file freshness check performance
367
+ * Directive processor encoding fixes
368
+
369
+ **2.9.1** (April 6, 2013)
370
+
371
+ * Support for Uglifier 2.x
372
+
364
373
  **2.9.0** (February 25, 2013)
365
374
 
366
375
  * Write out gzipped variants of bundled assets.
@@ -39,7 +39,8 @@ module Sprockets
39
39
  @logical_path = logical_path.to_s
40
40
  @pathname = Pathname.new(pathname)
41
41
  @content_type = environment.content_type_of(pathname)
42
- @mtime = environment.stat(pathname).mtime
42
+ # drop precision to 1 second, same pattern followed elsewhere
43
+ @mtime = Time.at(environment.stat(pathname).mtime.to_i)
43
44
  @length = environment.stat(pathname).size
44
45
  @digest = environment.file_digest(pathname).hexdigest
45
46
  end
@@ -58,8 +59,7 @@ module Sprockets
58
59
  end
59
60
 
60
61
  if mtime = coder['mtime']
61
- # Parse time string
62
- @mtime = Time.parse(mtime)
62
+ @mtime = Time.at(mtime)
63
63
  end
64
64
 
65
65
  if length = coder['length']
@@ -74,7 +74,7 @@ module Sprockets
74
74
  coder['logical_path'] = logical_path
75
75
  coder['pathname'] = relativize_root_path(pathname).to_s
76
76
  coder['content_type'] = content_type
77
- coder['mtime'] = mtime.iso8601
77
+ coder['mtime'] = mtime.to_i
78
78
  coder['length'] = length
79
79
  coder['digest'] = digest
80
80
  end
@@ -244,7 +244,11 @@ module Sprockets
244
244
  # stale. Many deployment environments may recopy or recheckout
245
245
  # assets on each deploy. In this case the mtime would be the
246
246
  # time of deploy rather than modified time.
247
- if mtime >= stat.mtime
247
+ #
248
+ # Note: to_i is used in eql? and write_to we assume fidelity of 1 second
249
+ # if people save files more frequently than 1 second sprockets may
250
+ # not pick it up, by design
251
+ if mtime.to_i >= stat.mtime.to_i
248
252
  return true
249
253
  end
250
254
 
@@ -17,10 +17,8 @@ module Sprockets
17
17
  @required_assets = @processed_asset.required_assets
18
18
  @dependency_paths = @processed_asset.dependency_paths
19
19
 
20
- @source = ""
21
-
22
20
  # Explode Asset into parts and gather the dependency bodies
23
- to_a.each { |dependency| @source << dependency.to_s }
21
+ @source = to_a.map { |dependency| dependency.to_s }.join
24
22
 
25
23
  # Run bundle processors on concatenated source
26
24
  context = environment.context_class.new(environment, logical_path, pathname)
@@ -92,6 +92,8 @@ module Sprockets
92
92
  @context = context
93
93
 
94
94
  @result = ""
95
+ @result.force_encoding(body.encoding) if body.respond_to?(:encoding)
96
+
95
97
  @has_written_body = false
96
98
 
97
99
  process_directives
@@ -16,7 +16,14 @@ module Sprockets
16
16
  end
17
17
 
18
18
  def evaluate(context, locals, &block)
19
- Uglifier.new(:copyright => false).compile(data)
19
+ # Feature detect Uglifier 2.0 option support
20
+ if Uglifier::DEFAULTS[:copyright]
21
+ # Uglifier < 2.x
22
+ Uglifier.new(:copyright => false).compile(data)
23
+ else
24
+ # Uglifier >= 2.x
25
+ Uglifier.new(:comments => :none).compile(data)
26
+ end
20
27
  end
21
28
  end
22
29
  end
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "2.9.0"
2
+ VERSION = "2.9.2"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
5
- prerelease:
4
+ version: 2.9.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Sam Stephenson
@@ -10,12 +9,11 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-02-25 00:00:00.000000000 Z
12
+ date: 2013-04-09 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: hike
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ~>
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
@@ -31,7 +28,6 @@ dependencies:
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: multi_json
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
32
  - - ~>
37
33
  - !ruby/object:Gem::Version
@@ -39,7 +35,6 @@ dependencies:
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
39
  - - ~>
45
40
  - !ruby/object:Gem::Version
@@ -47,7 +42,6 @@ dependencies:
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rack
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
46
  - - ~>
53
47
  - !ruby/object:Gem::Version
@@ -55,7 +49,6 @@ dependencies:
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
53
  - - ~>
61
54
  - !ruby/object:Gem::Version
@@ -63,45 +56,40 @@ dependencies:
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: tilt
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
60
  - - ~>
69
61
  - !ruby/object:Gem::Version
70
62
  version: '1.1'
71
- - - ! '!='
63
+ - - '!='
72
64
  - !ruby/object:Gem::Version
73
65
  version: 1.3.0
74
66
  type: :runtime
75
67
  prerelease: false
76
68
  version_requirements: !ruby/object:Gem::Requirement
77
- none: false
78
69
  requirements:
79
70
  - - ~>
80
71
  - !ruby/object:Gem::Version
81
72
  version: '1.1'
82
- - - ! '!='
73
+ - - '!='
83
74
  - !ruby/object:Gem::Version
84
75
  version: 1.3.0
85
76
  - !ruby/object:Gem::Dependency
86
77
  name: closure-compiler
87
78
  requirement: !ruby/object:Gem::Requirement
88
- none: false
89
79
  requirements:
90
- - - ! '>='
80
+ - - '>='
91
81
  - !ruby/object:Gem::Version
92
82
  version: '0'
93
83
  type: :development
94
84
  prerelease: false
95
85
  version_requirements: !ruby/object:Gem::Requirement
96
- none: false
97
86
  requirements:
98
- - - ! '>='
87
+ - - '>='
99
88
  - !ruby/object:Gem::Version
100
89
  version: '0'
101
90
  - !ruby/object:Gem::Dependency
102
91
  name: coffee-script
103
92
  requirement: !ruby/object:Gem::Requirement
104
- none: false
105
93
  requirements:
106
94
  - - ~>
107
95
  - !ruby/object:Gem::Version
@@ -109,7 +97,6 @@ dependencies:
109
97
  type: :development
110
98
  prerelease: false
111
99
  version_requirements: !ruby/object:Gem::Requirement
112
- none: false
113
100
  requirements:
114
101
  - - ~>
115
102
  - !ruby/object:Gem::Version
@@ -117,23 +104,20 @@ dependencies:
117
104
  - !ruby/object:Gem::Dependency
118
105
  name: coffee-script-source
119
106
  requirement: !ruby/object:Gem::Requirement
120
- none: false
121
107
  requirements:
122
108
  - - ~>
123
109
  - !ruby/object:Gem::Version
124
- version: 1.2.0
110
+ version: '1.2'
125
111
  type: :development
126
112
  prerelease: false
127
113
  version_requirements: !ruby/object:Gem::Requirement
128
- none: false
129
114
  requirements:
130
115
  - - ~>
131
116
  - !ruby/object:Gem::Version
132
- version: 1.2.0
117
+ version: '1.2'
133
118
  - !ruby/object:Gem::Dependency
134
119
  name: eco
135
120
  requirement: !ruby/object:Gem::Requirement
136
- none: false
137
121
  requirements:
138
122
  - - ~>
139
123
  - !ruby/object:Gem::Version
@@ -141,7 +125,6 @@ dependencies:
141
125
  type: :development
142
126
  prerelease: false
143
127
  version_requirements: !ruby/object:Gem::Requirement
144
- none: false
145
128
  requirements:
146
129
  - - ~>
147
130
  - !ruby/object:Gem::Version
@@ -149,7 +132,6 @@ dependencies:
149
132
  - !ruby/object:Gem::Dependency
150
133
  name: ejs
151
134
  requirement: !ruby/object:Gem::Requirement
152
- none: false
153
135
  requirements:
154
136
  - - ~>
155
137
  - !ruby/object:Gem::Version
@@ -157,7 +139,6 @@ dependencies:
157
139
  type: :development
158
140
  prerelease: false
159
141
  version_requirements: !ruby/object:Gem::Requirement
160
- none: false
161
142
  requirements:
162
143
  - - ~>
163
144
  - !ruby/object:Gem::Version
@@ -165,7 +146,6 @@ dependencies:
165
146
  - !ruby/object:Gem::Dependency
166
147
  name: execjs
167
148
  requirement: !ruby/object:Gem::Requirement
168
- none: false
169
149
  requirements:
170
150
  - - ~>
171
151
  - !ruby/object:Gem::Version
@@ -173,7 +153,6 @@ dependencies:
173
153
  type: :development
174
154
  prerelease: false
175
155
  version_requirements: !ruby/object:Gem::Requirement
176
- none: false
177
156
  requirements:
178
157
  - - ~>
179
158
  - !ruby/object:Gem::Version
@@ -181,55 +160,48 @@ dependencies:
181
160
  - !ruby/object:Gem::Dependency
182
161
  name: json
183
162
  requirement: !ruby/object:Gem::Requirement
184
- none: false
185
163
  requirements:
186
- - - ! '>='
164
+ - - '>='
187
165
  - !ruby/object:Gem::Version
188
166
  version: '0'
189
167
  type: :development
190
168
  prerelease: false
191
169
  version_requirements: !ruby/object:Gem::Requirement
192
- none: false
193
170
  requirements:
194
- - - ! '>='
171
+ - - '>='
195
172
  - !ruby/object:Gem::Version
196
173
  version: '0'
197
174
  - !ruby/object:Gem::Dependency
198
175
  name: rack-test
199
176
  requirement: !ruby/object:Gem::Requirement
200
- none: false
201
177
  requirements:
202
- - - ! '>='
178
+ - - '>='
203
179
  - !ruby/object:Gem::Version
204
180
  version: '0'
205
181
  type: :development
206
182
  prerelease: false
207
183
  version_requirements: !ruby/object:Gem::Requirement
208
- none: false
209
184
  requirements:
210
- - - ! '>='
185
+ - - '>='
211
186
  - !ruby/object:Gem::Version
212
187
  version: '0'
213
188
  - !ruby/object:Gem::Dependency
214
189
  name: rake
215
190
  requirement: !ruby/object:Gem::Requirement
216
- none: false
217
191
  requirements:
218
- - - ! '>='
192
+ - - '>='
219
193
  - !ruby/object:Gem::Version
220
194
  version: '0'
221
195
  type: :development
222
196
  prerelease: false
223
197
  version_requirements: !ruby/object:Gem::Requirement
224
- none: false
225
198
  requirements:
226
- - - ! '>='
199
+ - - '>='
227
200
  - !ruby/object:Gem::Version
228
201
  version: '0'
229
202
  - !ruby/object:Gem::Dependency
230
203
  name: sass
231
204
  requirement: !ruby/object:Gem::Requirement
232
- none: false
233
205
  requirements:
234
206
  - - ~>
235
207
  - !ruby/object:Gem::Version
@@ -237,7 +209,6 @@ dependencies:
237
209
  type: :development
238
210
  prerelease: false
239
211
  version_requirements: !ruby/object:Gem::Requirement
240
- none: false
241
212
  requirements:
242
213
  - - ~>
243
214
  - !ruby/object:Gem::Version
@@ -245,33 +216,29 @@ dependencies:
245
216
  - !ruby/object:Gem::Dependency
246
217
  name: uglifier
247
218
  requirement: !ruby/object:Gem::Requirement
248
- none: false
249
219
  requirements:
250
- - - ! '>='
220
+ - - '>='
251
221
  - !ruby/object:Gem::Version
252
222
  version: '0'
253
223
  type: :development
254
224
  prerelease: false
255
225
  version_requirements: !ruby/object:Gem::Requirement
256
- none: false
257
226
  requirements:
258
- - - ! '>='
227
+ - - '>='
259
228
  - !ruby/object:Gem::Version
260
229
  version: '0'
261
230
  - !ruby/object:Gem::Dependency
262
231
  name: yui-compressor
263
232
  requirement: !ruby/object:Gem::Requirement
264
- none: false
265
233
  requirements:
266
- - - ! '>='
234
+ - - '>='
267
235
  - !ruby/object:Gem::Version
268
236
  version: '0'
269
237
  type: :development
270
238
  prerelease: false
271
239
  version_requirements: !ruby/object:Gem::Requirement
272
- none: false
273
240
  requirements:
274
- - - ! '>='
241
+ - - '>='
275
242
  - !ruby/object:Gem::Version
276
243
  version: '0'
277
244
  description: Sprockets is a Rack-based asset packaging system that concatenates and
@@ -329,27 +296,25 @@ files:
329
296
  homepage: http://getsprockets.org/
330
297
  licenses:
331
298
  - MIT
299
+ metadata: {}
332
300
  post_install_message:
333
301
  rdoc_options: []
334
302
  require_paths:
335
303
  - lib
336
304
  required_ruby_version: !ruby/object:Gem::Requirement
337
- none: false
338
305
  requirements:
339
- - - ! '>='
306
+ - - '>='
340
307
  - !ruby/object:Gem::Version
341
308
  version: '0'
342
309
  required_rubygems_version: !ruby/object:Gem::Requirement
343
- none: false
344
310
  requirements:
345
- - - ! '>='
311
+ - - '>='
346
312
  - !ruby/object:Gem::Version
347
313
  version: '0'
348
314
  requirements: []
349
315
  rubyforge_project: sprockets
350
- rubygems_version: 1.8.24
316
+ rubygems_version: 2.0.0
351
317
  signing_key:
352
- specification_version: 3
318
+ specification_version: 4
353
319
  summary: Rack-based asset packaging system
354
320
  test_files: []
355
- has_rdoc: