obf 0.6.27 → 0.6.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf/utils.rb +4 -4
- data/lib/obf/validator.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9021540fe4fd1a5cc720dd97fa2df31bfcef423
|
4
|
+
data.tar.gz: 0e2e3778ee1109325afff79f712fcd93035faf61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 914a79d9a01aa5c294d068c8c443e74ced76baeb2d93c21f5e385d10e0b1446d6fd192cfdde6b7020f6b03e137f1cd593399ca6dcebf7339f0ddc47fb86019d6
|
7
|
+
data.tar.gz: 6aaf40ba2561302004f617d3026b97de3751e41b7d72247eea7df5d9c07511444f269baee2c011f5478f3f42bccfbb481a6a775ba48300f42f764de94a0135c2
|
data/lib/obf/utils.rb
CHANGED
@@ -26,7 +26,7 @@ module OBF::Utils
|
|
26
26
|
'extension' => extension
|
27
27
|
}
|
28
28
|
if content_type && content_type.match(/^image/)
|
29
|
-
attrs = image_attrs(data)
|
29
|
+
attrs = image_attrs(data, extension)
|
30
30
|
res['content_type'] ||= attrs['content_type']
|
31
31
|
res['width'] ||= attrs['width']
|
32
32
|
res['height'] ||= attrs['height']
|
@@ -269,12 +269,12 @@ module OBF::Utils
|
|
269
269
|
res
|
270
270
|
end
|
271
271
|
|
272
|
-
def self.image_attrs(path)
|
272
|
+
def self.image_attrs(path, extension='')
|
273
273
|
res = {}
|
274
274
|
if path.match(/^data:/)
|
275
275
|
res['content_type'] = path.split(/;/)[0].split(/:/)[1]
|
276
276
|
raw = Base64.strict_decode64(path.split(/\,/, 2)[1])
|
277
|
-
file = Tempfile.new('file')
|
277
|
+
file = Tempfile.new(['file', extension])
|
278
278
|
path = file.path
|
279
279
|
file.binmode
|
280
280
|
file.write raw
|
@@ -282,7 +282,7 @@ module OBF::Utils
|
|
282
282
|
else
|
283
283
|
is_file = File.exist?(path) rescue false
|
284
284
|
if !is_file
|
285
|
-
file = Tempfile.new('file')
|
285
|
+
file = Tempfile.new(['file', extension])
|
286
286
|
file.binmode
|
287
287
|
file.write path
|
288
288
|
path = file.path
|
data/lib/obf/validator.rb
CHANGED
@@ -316,7 +316,7 @@ module OBF
|
|
316
316
|
end
|
317
317
|
|
318
318
|
add_check('extras', "extra attributes") do
|
319
|
-
attrs = ['format', 'id', 'locale', 'url', 'data_url', 'name', 'description_html', 'buttons', 'images', 'sounds', 'grid', 'license']
|
319
|
+
attrs = ['format', 'id', 'locale', 'url', 'data_url', 'name', 'description_html', 'default_layout', 'buttons', 'images', 'sounds', 'grid', 'license']
|
320
320
|
ext.keys.each do |key|
|
321
321
|
if !attrs.include?(key) && !key.match(/^ext_/)
|
322
322
|
warn "#{key} attribute is not defined in the spec, should be prefixed with ext_yourapp_"
|