Skip to content

Fix deprecated warning for File.exists?#30

Open
johan-smits wants to merge 1 commit into
nehresma:masterfrom
LeftClickBV:master
Open

Fix deprecated warning for File.exists?#30
johan-smits wants to merge 1 commit into
nehresma:masterfrom
LeftClickBV:master

Conversation

@johan-smits

Copy link
Copy Markdown

Since Ruby 3.0 this gives a warning.

@teksetter

Copy link
Copy Markdown

In ruby 3.2 it is a bug.
To solve the problem I modified the file "cupsffi/lib/cupsffi/printer.rb" line 133 fron

raise "File not found: #{file_name}" unless File.exists? file_name

to

raise "File not found: #{file_name}" unless File.exist? file_name

@spuder

spuder commented Dec 27, 2024

Copy link
Copy Markdown

This is a issue on 3.3.6.

Work around is to monkey patch the File class or downgrade to ruby older than 3.2

class File
  def self.exists?(filename)
    self.exist?(filename)
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants