From 442d19ecb517097a30207f665f38f3cb1203025b Mon Sep 17 00:00:00 2001 From: mahlon Date: Mon, 8 Aug 2022 23:02:59 +0000 Subject: [PATCH] Minor updates for Ruby 3.x. FossilOrigin-Name: 792a95e73dbfb858dbbd56b1140c2ddf6bc3afb558e65cc665f30fd6db6833e1 --- .ruby-version | 2 +- ext/mdbx_ext/database.c | 2 +- lib/mdbx/database.rb | 4 +--- spec/mdbx/database_spec.rb | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.ruby-version b/.ruby-version index 1effb00..8c50098 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7 +3.1 diff --git a/ext/mdbx_ext/database.c b/ext/mdbx_ext/database.c index 66ae796..8fc20b4 100644 --- a/ext/mdbx_ext/database.c +++ b/ext/mdbx_ext/database.c @@ -860,7 +860,7 @@ static VALUE rmdbx_init_copy( VALUE copy, VALUE orig ) void rmdbx_init_database() { - rmdbx_cDatabase = rb_define_class_under( rmdbx_mMDBX, "Database", rb_cData ); + rmdbx_cDatabase = rb_define_class_under( rmdbx_mMDBX, "Database", rb_cObject ); #ifdef FOR_RDOC rmdbx_mMDBX = rb_define_module( "MDBX" ); diff --git a/lib/mdbx/database.rb b/lib/mdbx/database.rb index 43ae417..71541e0 100644 --- a/lib/mdbx/database.rb +++ b/lib/mdbx/database.rb @@ -85,7 +85,7 @@ class MDBX::Database ### ### [:no_threadlocal] ### Parallelize read-only transactions across threads. Writes are - ### always thread local. (See MDBX documentatoin for details.) + ### always thread local. (See MDBX documentation for details.) ### ### [:readonly] ### Reject any write attempts while using this database handle. @@ -364,7 +364,6 @@ class MDBX::Database protected ######### - ### Safely serialize a value, closing any open transaction and re-raising ### if necessary. ### @@ -391,7 +390,6 @@ class MDBX::Database end - ### Yield and return the block, opening a snapshot first if ### there isn't already a transaction in progress. Closes ### the snapshot if this method opened it. diff --git a/spec/mdbx/database_spec.rb b/spec/mdbx/database_spec.rb index e228937..1129942 100644 --- a/spec/mdbx/database_spec.rb +++ b/spec/mdbx/database_spec.rb @@ -71,8 +71,7 @@ RSpec.describe( MDBX::Database ) do # here for behavior. expect { described_class.open( TEST_DATABASE.to_s ) - }. - to raise_exception( MDBX::DatabaseError, /environment is already used/ ) + }.to raise_exception( MDBX::DatabaseError, /resource \w+ unavailable/i ) end end