Skip to content

Replace File.exists? with File.exist?#267

Merged
yahonda merged 1 commit into
rsim:masterfrom
yahonda:fix-file-exists
Apr 13, 2026
Merged

Replace File.exists? with File.exist?#267
yahonda merged 1 commit into
rsim:masterfrom
yahonda:fix-file-exists

Conversation

@yahonda
Copy link
Copy Markdown
Collaborator

@yahonda yahonda commented Apr 13, 2026

Summary

  • Replace File.exists? with File.exist? in jdbc_connection.rb
  • File.exists? was deprecated in Ruby 2.1 and removed in Ruby 4.0 / JRuby 10.1, causing JDBC driver loading to fail with NoMethodError: undefined method 'exists?' for class File

Test plan

  • Verify JRuby CI passes (jruby-head uses Ruby 4.0 compatibility)

🤖 Generated with Claude Code

File.exists? was removed in Ruby 4.0 / JRuby 10.1, causing
JDBC driver loading to fail with NoMethodError.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yahonda yahonda requested a review from Copilot April 13, 2026 14:00
yahonda added a commit to yahonda/oracle-enhanced that referenced this pull request Apr 13, 2026
The File.exists? shim is no longer needed now that ruby-plsql has been
fixed to use File.exist? in rsim/ruby-plsql#267.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes JDBC driver discovery/loading under Ruby 4.0 compatibility (e.g., JRuby-head) by replacing the removed/deprecated File.exists? call with File.exist? in the JDBC connection setup.

Changes:

  • Replace File.exists? with File.exist? when checking for JDBC driver jar files.
  • Prevent NoMethodError during driver loading on Ruby versions where File.exists? is removed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yahonda yahonda merged commit 5ea974a into rsim:master Apr 13, 2026
22 checks passed
@yahonda yahonda deleted the fix-file-exists branch April 29, 2026 23:08
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.

2 participants