lib/emojidex/data/emoji/asset_information.rb in emojidex-0.2.2 vs lib/emojidex/data/emoji/asset_information.rb in emojidex-0.2.3
- old
+ new
@@ -113,10 +113,13 @@
File.open(@paths[:svg], 'wb') { |fp| fp.write(response.body) }
generate_local_checksum(:svg)
end
def _cache_png(sizes)
+ sizes = sizes.keys if sizes.is_a?(Hash)
sizes.each do |size|
+ size = size.first if size.is_a?(Array)
+ size = size.key if size.is_a?(Hash)
unless @paths.include?(:png) &&
@paths[:png].include?(size) && @paths[:png][size].nil? == false
@paths[:png][size] = "#{Dir.pwd}/#{size}/#{@code}.png"
end
next if File.exist?(@paths[:png][size]) &&