Skip to content

Commit cde4191

Browse files
yahondaclaude
andcommitted
Use Gem::Version for ruby-oci8 version comparison
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9b6d0fb commit cde4191

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/plsql/oci_connection.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
end
1616

1717
# check ruby-oci8 version
18-
required_oci8_version = [2, 1, 0]
19-
oci8_version_ints = OCI8::VERSION.scan(/\d+/).map { |s| s.to_i }
20-
if (oci8_version_ints <=> required_oci8_version) < 0
21-
raise LoadError, "ERROR: ruby-oci8 version #{OCI8::VERSION} is too old. Please install ruby-oci8 version #{required_oci8_version.join('.')} or later."
18+
required_oci8_version = "2.1.0"
19+
if Gem::Version.new(OCI8::VERSION) < Gem::Version.new(required_oci8_version)
20+
raise LoadError, "ERROR: ruby-oci8 version #{OCI8::VERSION} is too old. Please install ruby-oci8 version #{required_oci8_version} or later."
2221
end
2322

2423
module PLSQL

0 commit comments

Comments
 (0)