Just trying to detect png and jpg images in the github pull request using DangerFile. Here is everything that I found
modified_files_has_wrong_pic_formant = git.modified_files.any? { |file| /.*\.(png|jpg)/.match(File.extname(file)) }
added_files_has_wrong_pic_formant = git.added_files.any? { |file| /.*\.(png|jpg)/.match(File.extname(file)) }
Does it work or can you suggest a better solution?