lib/weneedfeed/item.rb in weneedfeed-0.9.2 vs lib/weneedfeed/item.rb in weneedfeed-0.10.0
- old
+ new
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-require 'mimemagic'
+require 'marcel'
require 'uri'
module Weneedfeed
class Item
class << self
@@ -52,11 +52,10 @@
# @return [String, nil]
def image_mime_type
return unless image_url
- uri = ::URI.parse(image_url)
- ::MimeMagic.by_path(uri.path)&.type
+ ::Marcel::Magic.by_path(image_url)&.type
end
# @return [String, nil]
def image_path_or_url
return unless @image_selector