sprockets 2.4.0 → 2.4.1

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.

data/README.md CHANGED
@@ -361,6 +361,11 @@ submit a pull request.
361
361
 
362
362
  ## Version History ##
363
363
 
364
+ **2.4.1** (April 26, 2012)
365
+
366
+ * Fixed MultiJson API change
367
+ * Fixed gzip mtime
368
+
364
369
  **2.4.0** (March 27, 2012)
365
370
 
366
371
  * Added global path registry
@@ -145,6 +145,7 @@ module Sprockets
145
145
  if options[:compress]
146
146
  # Run contents through `Zlib`
147
147
  gz = Zlib::GzipWriter.new(f, Zlib::BEST_COMPRESSION)
148
+ gz.mtime = mtime.to_i
148
149
  gz.write to_s
149
150
  gz.close
150
151
  else
@@ -28,12 +28,12 @@ module Sprockets
28
28
  # Sprockets.register_engine '.sass', SassTemplate
29
29
  #
30
30
  module Engines
31
- # Returns an `Array` of `Engine`s registered on the
32
- # `Environment`. If an `ext` argument is supplied, the `Engine`
33
- # register under that extension will be returned.
31
+ # Returns a `Hash` of `Engine`s registered on the `Environment`.
32
+ # If an `ext` argument is supplied, the `Engine` associated with
33
+ # that extension will be returned.
34
34
  #
35
35
  # environment.engines
36
- # # => [CoffeeScriptTemplate, SassTemplate, ...]
36
+ # # => {".coffee" => CoffeeScriptTemplate, ".sass" => SassTemplate, ...}
37
37
  #
38
38
  # environment.engines('.coffee')
39
39
  # # => CoffeeScriptTemplate
@@ -37,7 +37,7 @@ module Sprockets
37
37
 
38
38
  begin
39
39
  if File.exist?(@path)
40
- data = MultiJson.decode(File.read(@path))
40
+ data = json_decode(File.read(@path))
41
41
  end
42
42
  rescue MultiJson::DecodeError => e
43
43
  logger.error "#{@path} is invalid: #{e.class} #{e.message}"
@@ -186,11 +186,32 @@ module Sprockets
186
186
  def save
187
187
  FileUtils.mkdir_p dir
188
188
  File.open(path, 'w') do |f|
189
- f.write MultiJson.encode(@data)
189
+ f.write json_encode(@data)
190
190
  end
191
191
  end
192
192
 
193
193
  private
194
+ # Feature detect newer MultiJson API
195
+ if MultiJson.respond_to?(:load)
196
+ def json_decode(obj)
197
+ MultiJson.load(obj)
198
+ end
199
+ else
200
+ def json_decode(obj)
201
+ MultiJson.decode(obj)
202
+ end
203
+ end
204
+
205
+ if MultiJson.respond_to?(:dump)
206
+ def json_encode(obj)
207
+ MultiJson.dump(obj)
208
+ end
209
+ else
210
+ def json_encode(obj)
211
+ MultiJson.encode(obj)
212
+ end
213
+ end
214
+
194
215
  def logger
195
216
  environment.logger
196
217
  end
@@ -30,6 +30,7 @@ module Sprockets
30
30
  pathname.open('rb') do |rd|
31
31
  File.open("#{filename}+", 'wb') do |wr|
32
32
  gz = Zlib::GzipWriter.new(wr, Zlib::BEST_COMPRESSION)
33
+ gz.mtime = mtime.to_i
33
34
  buf = ""
34
35
  while rd.read(16384, buf)
35
36
  gz.write(buf)
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
metadata CHANGED
@@ -1,236 +1,241 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sprockets
3
- version: !ruby/object:Gem::Version
4
- hash: 31
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.4.1
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 4
9
- - 0
10
- version: 2.4.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Sam Stephenson
14
9
  - Joshua Peek
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-03-27 00:00:00 -05:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
13
+ date: 2012-04-26 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
23
16
  name: hike
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
26
18
  none: false
27
- requirements:
19
+ requirements:
28
20
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 11
31
- segments:
32
- - 1
33
- - 2
34
- version: "1.2"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.2'
35
23
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: multi_json
39
24
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
41
26
  none: false
42
- requirements:
27
+ requirements:
43
28
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 15
46
- segments:
47
- - 1
48
- - 0
49
- version: "1.0"
29
+ - !ruby/object:Gem::Version
30
+ version: '1.2'
31
+ - !ruby/object:Gem::Dependency
32
+ name: multi_json
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
36
+ - - ~>
37
+ - !ruby/object:Gem::Version
38
+ version: '1.0'
50
39
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: rack
54
40
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ version_requirements: !ruby/object:Gem::Requirement
56
42
  none: false
57
- requirements:
43
+ requirements:
58
44
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 15
61
- segments:
62
- - 1
63
- - 0
64
- version: "1.0"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rack
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
65
55
  type: :runtime
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- name: tilt
69
56
  prerelease: false
70
- requirement: &id004 !ruby/object:Gem::Requirement
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '1.0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: tilt
65
+ requirement: !ruby/object:Gem::Requirement
71
66
  none: false
72
- requirements:
67
+ requirements:
73
68
  - - ~>
74
- - !ruby/object:Gem::Version
75
- hash: 13
76
- segments:
77
- - 1
78
- - 1
79
- version: "1.1"
80
- - - "!="
81
- - !ruby/object:Gem::Version
82
- hash: 27
83
- segments:
84
- - 1
85
- - 3
86
- - 0
69
+ - !ruby/object:Gem::Version
70
+ version: '1.1'
71
+ - - ! '!='
72
+ - !ruby/object:Gem::Version
87
73
  version: 1.3.0
88
74
  type: :runtime
89
- version_requirements: *id004
90
- - !ruby/object:Gem::Dependency
91
- name: coffee-script
92
75
  prerelease: false
93
- requirement: &id005 !ruby/object:Gem::Requirement
76
+ version_requirements: !ruby/object:Gem::Requirement
94
77
  none: false
95
- requirements:
78
+ requirements:
96
79
  - - ~>
97
- - !ruby/object:Gem::Version
98
- hash: 3
99
- segments:
100
- - 2
101
- - 0
102
- version: "2.0"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.1'
82
+ - - ! '!='
83
+ - !ruby/object:Gem::Version
84
+ version: 1.3.0
85
+ - !ruby/object:Gem::Dependency
86
+ name: coffee-script
87
+ requirement: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ~>
91
+ - !ruby/object:Gem::Version
92
+ version: '2.0'
103
93
  type: :development
104
- version_requirements: *id005
105
- - !ruby/object:Gem::Dependency
106
- name: coffee-script-source
107
94
  prerelease: false
108
- requirement: &id006 !ruby/object:Gem::Requirement
95
+ version_requirements: !ruby/object:Gem::Requirement
109
96
  none: false
110
- requirements:
97
+ requirements:
111
98
  - - ~>
112
- - !ruby/object:Gem::Version
113
- hash: 31
114
- segments:
115
- - 1
116
- - 2
117
- - 0
99
+ - !ruby/object:Gem::Version
100
+ version: '2.0'
101
+ - !ruby/object:Gem::Dependency
102
+ name: coffee-script-source
103
+ requirement: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ~>
107
+ - !ruby/object:Gem::Version
118
108
  version: 1.2.0
119
109
  type: :development
120
- version_requirements: *id006
121
- - !ruby/object:Gem::Dependency
122
- name: eco
123
110
  prerelease: false
124
- requirement: &id007 !ruby/object:Gem::Requirement
111
+ version_requirements: !ruby/object:Gem::Requirement
125
112
  none: false
126
- requirements:
113
+ requirements:
127
114
  - - ~>
128
- - !ruby/object:Gem::Version
129
- hash: 15
130
- segments:
131
- - 1
132
- - 0
133
- version: "1.0"
115
+ - !ruby/object:Gem::Version
116
+ version: 1.2.0
117
+ - !ruby/object:Gem::Dependency
118
+ name: eco
119
+ requirement: !ruby/object:Gem::Requirement
120
+ none: false
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
134
125
  type: :development
135
- version_requirements: *id007
136
- - !ruby/object:Gem::Dependency
137
- name: ejs
138
126
  prerelease: false
139
- requirement: &id008 !ruby/object:Gem::Requirement
127
+ version_requirements: !ruby/object:Gem::Requirement
140
128
  none: false
141
- requirements:
129
+ requirements:
142
130
  - - ~>
143
- - !ruby/object:Gem::Version
144
- hash: 15
145
- segments:
146
- - 1
147
- - 0
148
- version: "1.0"
131
+ - !ruby/object:Gem::Version
132
+ version: '1.0'
133
+ - !ruby/object:Gem::Dependency
134
+ name: ejs
135
+ requirement: !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ~>
139
+ - !ruby/object:Gem::Version
140
+ version: '1.0'
149
141
  type: :development
150
- version_requirements: *id008
151
- - !ruby/object:Gem::Dependency
152
- name: execjs
153
142
  prerelease: false
154
- requirement: &id009 !ruby/object:Gem::Requirement
143
+ version_requirements: !ruby/object:Gem::Requirement
155
144
  none: false
156
- requirements:
145
+ requirements:
157
146
  - - ~>
158
- - !ruby/object:Gem::Version
159
- hash: 15
160
- segments:
161
- - 1
162
- - 0
163
- version: "1.0"
147
+ - !ruby/object:Gem::Version
148
+ version: '1.0'
149
+ - !ruby/object:Gem::Dependency
150
+ name: execjs
151
+ requirement: !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ~>
155
+ - !ruby/object:Gem::Version
156
+ version: '1.0'
164
157
  type: :development
165
- version_requirements: *id009
166
- - !ruby/object:Gem::Dependency
167
- name: json
168
158
  prerelease: false
169
- requirement: &id010 !ruby/object:Gem::Requirement
159
+ version_requirements: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ~>
163
+ - !ruby/object:Gem::Version
164
+ version: '1.0'
165
+ - !ruby/object:Gem::Dependency
166
+ name: json
167
+ requirement: !ruby/object:Gem::Requirement
170
168
  none: false
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- hash: 3
175
- segments:
176
- - 0
177
- version: "0"
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
178
173
  type: :development
179
- version_requirements: *id010
180
- - !ruby/object:Gem::Dependency
181
- name: rack-test
182
174
  prerelease: false
183
- requirement: &id011 !ruby/object:Gem::Requirement
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ none: false
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rack-test
183
+ requirement: !ruby/object:Gem::Requirement
184
184
  none: false
185
- requirements:
186
- - - ">="
187
- - !ruby/object:Gem::Version
188
- hash: 3
189
- segments:
190
- - 0
191
- version: "0"
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
192
189
  type: :development
193
- version_requirements: *id011
194
- - !ruby/object:Gem::Dependency
195
- name: rake
196
190
  prerelease: false
197
- requirement: &id012 !ruby/object:Gem::Requirement
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ none: false
193
+ requirements:
194
+ - - ! '>='
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ - !ruby/object:Gem::Dependency
198
+ name: rake
199
+ requirement: !ruby/object:Gem::Requirement
198
200
  none: false
199
- requirements:
200
- - - ">="
201
- - !ruby/object:Gem::Version
202
- hash: 3
203
- segments:
204
- - 0
205
- version: "0"
201
+ requirements:
202
+ - - ! '>='
203
+ - !ruby/object:Gem::Version
204
+ version: '0'
206
205
  type: :development
207
- version_requirements: *id012
208
- - !ruby/object:Gem::Dependency
209
- name: sass
210
206
  prerelease: false
211
- requirement: &id013 !ruby/object:Gem::Requirement
207
+ version_requirements: !ruby/object:Gem::Requirement
208
+ none: false
209
+ requirements:
210
+ - - ! '>='
211
+ - !ruby/object:Gem::Version
212
+ version: '0'
213
+ - !ruby/object:Gem::Dependency
214
+ name: sass
215
+ requirement: !ruby/object:Gem::Requirement
212
216
  none: false
213
- requirements:
217
+ requirements:
214
218
  - - ~>
215
- - !ruby/object:Gem::Version
216
- hash: 5
217
- segments:
218
- - 3
219
- - 1
220
- version: "3.1"
219
+ - !ruby/object:Gem::Version
220
+ version: '3.1'
221
221
  type: :development
222
- version_requirements: *id013
223
- description: Sprockets is a Rack-based asset packaging system that concatenates and serves JavaScript, CoffeeScript, CSS, LESS, Sass, and SCSS.
224
- email:
222
+ prerelease: false
223
+ version_requirements: !ruby/object:Gem::Requirement
224
+ none: false
225
+ requirements:
226
+ - - ~>
227
+ - !ruby/object:Gem::Version
228
+ version: '3.1'
229
+ description: Sprockets is a Rack-based asset packaging system that concatenates and
230
+ serves JavaScript, CoffeeScript, CSS, LESS, Sass, and SCSS.
231
+ email:
225
232
  - sstephenson@gmail.com
226
233
  - josh@joshpeek.com
227
- executables:
234
+ executables:
228
235
  - sprockets
229
236
  extensions: []
230
-
231
237
  extra_rdoc_files: []
232
-
233
- files:
238
+ files:
234
239
  - README.md
235
240
  - LICENSE
236
241
  - lib/rake/sprocketstask.rb
@@ -267,39 +272,28 @@ files:
267
272
  - lib/sprockets/version.rb
268
273
  - lib/sprockets.rb
269
274
  - bin/sprockets
270
- has_rdoc: true
271
275
  homepage: http://getsprockets.org/
272
276
  licenses: []
273
-
274
277
  post_install_message:
275
278
  rdoc_options: []
276
-
277
- require_paths:
279
+ require_paths:
278
280
  - lib
279
- required_ruby_version: !ruby/object:Gem::Requirement
281
+ required_ruby_version: !ruby/object:Gem::Requirement
280
282
  none: false
281
- requirements:
282
- - - ">="
283
- - !ruby/object:Gem::Version
284
- hash: 3
285
- segments:
286
- - 0
287
- version: "0"
288
- required_rubygems_version: !ruby/object:Gem::Requirement
283
+ requirements:
284
+ - - ! '>='
285
+ - !ruby/object:Gem::Version
286
+ version: '0'
287
+ required_rubygems_version: !ruby/object:Gem::Requirement
289
288
  none: false
290
- requirements:
291
- - - ">="
292
- - !ruby/object:Gem::Version
293
- hash: 3
294
- segments:
295
- - 0
296
- version: "0"
289
+ requirements:
290
+ - - ! '>='
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
297
293
  requirements: []
298
-
299
294
  rubyforge_project: sprockets
300
- rubygems_version: 1.6.2
295
+ rubygems_version: 1.8.23
301
296
  signing_key:
302
297
  specification_version: 3
303
298
  summary: Rack-based asset packaging system
304
299
  test_files: []
305
-