Skip to content

Commit 990b045

Browse files
author
=
committed
Fix deprecated method File.exists? to File.exist?
1 parent ff3b443 commit 990b045

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/docsplit/page_extractor.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def extract(pdfs, opts)
1010
[pdfs].flatten.each do |pdf|
1111
pdf_name = File.basename(pdf, File.extname(pdf))
1212
page_path = ESCAPE[File.join(@output, "#{pdf_name}")] + "_%d.pdf"
13-
FileUtils.mkdir_p @output unless File.exists?(@output)
14-
13+
FileUtils.mkdir_p @output unless File.exist?(@output)
14+
1515
cmd = if DEPENDENCIES[:pdftailor] # prefer pdftailor, but keep pdftk for backwards compatability
1616
"pdftailor unstitch --output #{page_path} #{ESCAPE[pdf]} 2>&1"
1717
else

lib/docsplit/text_extractor.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize
2828
# Extract text from a list of PDFs.
2929
def extract(pdfs, opts)
3030
extract_options opts
31-
FileUtils.mkdir_p @output unless File.exists?(@output)
31+
FileUtils.mkdir_p @output unless File.exist?(@output)
3232
[pdfs].flatten.each do |pdf|
3333
@pdf_name = File.basename(pdf, File.extname(pdf))
3434
pages = (@pages == 'all') ? 1..Docsplit.extract_length(pdf) : @pages

0 commit comments

Comments
 (0)