ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Resolve Ruby 3.2 "undefining the allocator of T_DATA class GPGME::Ctx" warnings #158

Closed lildude closed 2 years ago

lildude commented 2 years ago

When running ruby-gpgme (and the tests in this repo) on Ruby 3.2.0-preview1 you get several warnings:

/workspaces/ruby-gpgme/lib/gpgme/ctx.rb:47: warning: undefining the allocator of T_DATA class GPGME::Ctx
/workspaces/ruby-gpgme/lib/gpgme/data.rb:71: warning: undefining the allocator of T_DATA class GPGME::Data
/workspaces/ruby-gpgme/lib/gpgme/ctx.rb:283: warning: undefining the allocator of T_DATA class GPGME::Key

See https://bugs.ruby-lang.org/issues/18007 for details on why this warning has been implemented and https://ruby-doc.org/core-3.1.1/doc/extension_rdoc.html#label-C+struct+to+Ruby+object

This PR addresses these warnings as suggested in the docs and issue above.

This PR needs https://github.com/ueno/ruby-gpgme/pull/153 in order to dev with Ruby 3.x.

Fixes https://github.com/ueno/ruby-gpgme/issues/157

ueno commented 2 years ago

@lildude could you rebase this so the CI will run?

lildude commented 2 years ago

@ueno Done.