Skip to content

Commit 649e548

Browse files
committed
code refactor
1 parent fa16792 commit 649e548

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/rtesseract/base.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ def temp_file_path
1010
Pathname.new(Dir.tmpdir).join("rtesseract_#{SecureRandom.uuid}").to_s
1111
end
1212

13-
def remove_tmp_file(output_path)
14-
Dir["#{Dir.tmpdir}/*"].each do |filename|
15-
if filename.include?(output_path)
16-
File.delete(filename)
17-
break
18-
end
19-
end
13+
def remove_tmp_file(absolute_file_path)
14+
File.delete(absolute_file_path) if File.file?(absolute_file_path)
2015
end
2116
end
2217
end

0 commit comments

Comments
 (0)