lib/prawn/emoji/image.rb in prawn-emoji-4.2.0 vs lib/prawn/emoji/image.rb in prawn-emoji-5.0.0

- old
+ new

@@ -15,21 +15,10 @@ @emoji_char = emoji_char end def render(document, at:) x, y = at - - position = [x, y + height] - - if Prawn::VERSION >= '2.3.0' - document.image(path, at: position, width: width) - else - # Prawn 2.2 does not close the image file when Pathname is passed to Document#image method. - # https://github.com/prawnpdf/prawn/pull/1090 - File.open(path, 'rb') do |image_file| - document.image(image_file, at: position, width: width) - end - end + document.image(path, at: [x, y + height], width: width) end def path STORE.join("#{emoji_char.codepoint}.png").to_s end