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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a2dfd326edc9e166f9013d9695d4d2b4daea593
4
- data.tar.gz: c1e8018503cc574b66bebd1fd88d2035d310bf13
3
+ metadata.gz: a9021540fe4fd1a5cc720dd97fa2df31bfcef423
4
+ data.tar.gz: 0e2e3778ee1109325afff79f712fcd93035faf61
5
5
  SHA512:
6
- metadata.gz: f60d286764fd4a389766827dd9480acf4c87b09964f2d5f951799a7aa91d29d9d186dd8a6ba3cd5fcda5214244a12abb4120f7ad68004848fd1399ee4d743364
7
- data.tar.gz: a67b8f446e52d5e997f78cfa556719cbcf01d8bd7289db11fb9957af21779c4925e06189e79ac46bba655d393e17098af4c3302dc1d10d13a69d8b796fadd332
6
+ metadata.gz: 914a79d9a01aa5c294d068c8c443e74ced76baeb2d93c21f5e385d10e0b1446d6fd192cfdde6b7020f6b03e137f1cd593399ca6dcebf7339f0ddc47fb86019d6
7
+ data.tar.gz: 6aaf40ba2561302004f617d3026b97de3751e41b7d72247eea7df5d9c07511444f269baee2c011f5478f3f42bccfbb481a6a775ba48300f42f764de94a0135c2
@@ -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
@@ -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_"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.27
4
+ version: 0.6.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer