Skip to content

Commit

Permalink
[Analyzer] Do not require dependency if already defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Mth0158 committed Dec 11, 2024
1 parent 96033ed commit 214e74e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Analyzer::ImageAnalyzer::ImageMagick < Analyzer::ImageAnalyzer

def read_image
begin
require "mini_magick"
require "mini_magick" unless defined?(MiniMagick)
rescue LoadError
logger.info "Skipping image analysis because the mini_magick gem isn't installed"
return {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Analyzer::ImageAnalyzer::Vips < Analyzer::ImageAnalyzer

def read_image
begin
require "ruby-vips"
require "vips" unless defined?(::Vips)
rescue LoadError
logger.info "Skipping image analysis because the ruby-vips gem isn't installed"
return {}
Expand Down

0 comments on commit 214e74e

Please sign in to comment.