digest-blake3 1.5.1.0 → 1.5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bf10e44aaa74a31f9a334b67ecfadfeda7f31a4d3055bd48c5f1a8609e53661
4
- data.tar.gz: 53072abb4749ecdfd6748360fc33d39789078413078858953bffcd1ae1cfcdaf
3
+ metadata.gz: 1be5125a020dcddb9fb6a17404faa25416b64ada7cc9f3583ad7fb2c87e5d786
4
+ data.tar.gz: da4f177d0d43219a32eeed394c8486c841197f505bdd89f3e5e3ddcf8fc21ab0
5
5
  SHA512:
6
- metadata.gz: b93a9bdf8b7f2fa4986090e466dfe6c0661d6e9e2de7864cb83846f314a07f198ce16bb6289edb50cf1a7333463136049d61c5ee6fa3db9c8c4855e229fd93a7
7
- data.tar.gz: df226266cb38882b121c401d074ad84559265751c897fccda004a8f3d230c2e67215ee6086cfac13fc7043316955511179de4c024dd9d4b5f9048a948ea52080
6
+ metadata.gz: 49f2c23d359bf51ddf82bbf6894cc2fa665029dbc1ebc632e001209e75959a41ca6cfb92243f4da36e1dcbbc657a7fba4480c8eef585808a75c94ecfd253767d
7
+ data.tar.gz: bb3ee33e6717d8adc4e3deeadb40a8c5607a8214a4f89207a2ee44ff2ce107ec24dcd53583219de803e305f504d1e6d52c935593b3e165fa4816bab6cf1f29fb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- digest-blake3 (1.4.1.0)
4
+ digest-blake3 (1.5.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -60,6 +60,11 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
60
60
 
61
61
  Bug reports and pull requests are welcome on GitHub at https://github.com/willbryant/digest-blake3.
62
62
 
63
+ ## Thanks
64
+
65
+ * Scott Phillips (@fundthmcalculus)
66
+ * Facundo Farias (@facundofarias)
67
+
63
68
  ## License
64
69
 
65
70
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -31,8 +31,24 @@ void Init_blake3(void) {
31
31
  cDigest_Base = rb_path2class("Digest::Base");
32
32
  cDigest_BLAKE3 = rb_define_class_under(mDigest, "BLAKE3", cDigest_Base);
33
33
 
34
+ /* Register the metadata.
35
+ *
36
+ * Ruby 3.4's digest framework (digest 3.2+) validates that the "metadata"
37
+ * ivar is a TypedData object and raises
38
+ * TypeError: Digest::BLAKE3::metadata is not initialized properly
39
+ * from Digest::Base#initialize when it is not. The legacy untyped
40
+ * Data_Wrap_Struct fails that check.
41
+ *
42
+ * rb_digest_make_metadata is the supported API but is absent from older
43
+ * ruby/digest.h, so extconf.rb feature-detects it and the old path is kept
44
+ * for Rubies that predate it. */
45
+ #ifdef HAVE_RB_DIGEST_MAKE_METADATA
46
+ rb_iv_set(cDigest_BLAKE3, "metadata",
47
+ rb_digest_make_metadata(&blake3));
48
+ #else
34
49
  #undef RUBY_UNTYPED_DATA_WARNING
35
50
  #define RUBY_UNTYPED_DATA_WARNING 0
36
51
  rb_iv_set(cDigest_BLAKE3, "metadata",
37
52
  Data_Wrap_Struct(0, 0, 0, (void *)&blake3));
53
+ #endif
38
54
  }
@@ -8,6 +8,22 @@ CONFIG["optflags"] = "-O3"
8
8
  $warnflags.sub!("-Wdeclaration-after-statement", "") # eg. RVM compiles Ruby with this set on some platforms, so it ends up in RbConfig::MAKEFILE_CONFIG
9
9
  append_cflags("-std=c99")
10
10
 
11
+ # Ruby 3.4's digest framework (digest 3.2+) validates that the "metadata" ivar is
12
+ # a TypedData object; the legacy untyped Data_Wrap_Struct fails that check with
13
+ # "TypeError: Digest::BLAKE3::metadata is not initialized properly".
14
+ # rb_digest_make_metadata is the supported replacement, but it does not exist in
15
+ # older ruby/digest.h (Ruby 2.7 reports RUBY_DIGEST_API_VERSION 3 without
16
+ # providing it), so it has to be feature-detected rather than version-gated.
17
+ #
18
+ # have_func links rather than only compiling. That matters: a compile-only probe
19
+ # relies on an implicit function declaration being an error, which is true for
20
+ # clang >= 16 and gcc >= 14 but only a WARNING on gcc 7 -- the compiler on our
21
+ # Ubuntu 18.04 hosts. There the probe would false-positive, the fallback would be
22
+ # skipped, and the extension would build with an unresolved symbol that only
23
+ # fails at require time. The probe deliberately runs after the flag setup above
24
+ # so it is tested under the same flags as the real build.
25
+ have_func("rb_digest_make_metadata", "ruby/digest.h")
26
+
11
27
  # we can't let create_makefile default to compiling all source files in the directory, because then
12
28
  # it won't set the appropriate flags for the different versions. start by explicitly resetting the
13
29
  # list to the files that we always want. blake3_ruby.o is the only one we've implemented ourselves
@@ -2,6 +2,6 @@ require 'digest'
2
2
 
3
3
  module Digest
4
4
  class BLAKE3 < Base
5
- VERSION = "1.5.1.0"
5
+ VERSION = "1.5.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digest-blake3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1.0
4
+ version: 1.5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Bryant
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-10 00:00:00.000000000 Z
11
+ date: 2026-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler