roaring 0.4.0 → 0.4.1

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: dc33ef0434903a23cc016fc7b1d31250280c96efd5e94ddbff4b8fa4f0977b73
4
- data.tar.gz: 67b0b48a4b7dd2868977af10de721eba00e6c3aa08f222f1d3866a5003be5218
3
+ metadata.gz: 3f2956df800830dc45bb3b8e63fd1b7795c39a73ab52f5671e651ca1087e1572
4
+ data.tar.gz: 74b06f13df663851dd703b2888cd3b465fe788a794dcb0cadca5d1b534db023e
5
5
  SHA512:
6
- metadata.gz: 2159681201c2f83fadc8d01fd2ddc1bedb7bcbc7828d955f6bf2c9ea8168fdce066f3f653cc7cfe935342f1bf126c895d09fd1f28296395e5f08331bf71807b2
7
- data.tar.gz: 3d9bbdaecd48f645370d3bf116e00e457d878a6dce95be1b59c412088c969f4df09a4360897be8931eb2a94f44360c6cd3887abdffca56d6e784c71b0fa21307
6
+ metadata.gz: 18a68702d1d236e6817c542dcbb15d32515f76263b0e5f074837bdde8a5bc9ca5ff88976eba18d67b1cd041307b22a81a72e79f6d7b25124b80b2f14028e9ba0
7
+ data.tar.gz: 44ca8c98572f932a23d7488afd87bc05d3c0618062d912bc71b9f319497ba5ac3e824e046011b192198b8c90686ebeda972f1e15104428684cdb2dcc2761dd3d
@@ -229,10 +229,19 @@ static VALUE rb_roaring32_serialize(VALUE self)
229
229
  }
230
230
 
231
231
  // Loads a previously serialized bitmap
232
+ // @param str [String] a string previously returned from {#serialize}
233
+ // @raise [ArgumentError] if the string isn't a valid serialized bitmap
232
234
  // @return [Bitmap32]
233
235
  static VALUE rb_roaring32_deserialize(VALUE self, VALUE str)
234
236
  {
237
+ StringValue(str);
238
+
235
239
  roaring_bitmap_t *bitmap = roaring_bitmap_portable_deserialize_safe(RSTRING_PTR(str), RSTRING_LEN(str));
240
+ RB_GC_GUARD(str);
241
+
242
+ if (!bitmap) {
243
+ rb_raise(rb_eArgError, "invalid Roaring::Bitmap32 serialization");
244
+ }
236
245
 
237
246
  return TypedData_Wrap_Struct(cRoaringBitmap32, &roaring_type, bitmap);
238
247
  }
@@ -208,7 +208,14 @@ static VALUE rb_roaring64_serialize(VALUE self)
208
208
 
209
209
  static VALUE rb_roaring64_deserialize(VALUE self, VALUE str)
210
210
  {
211
+ StringValue(str);
212
+
211
213
  roaring64_bitmap_t *bitmap = roaring64_bitmap_portable_deserialize_safe(RSTRING_PTR(str), RSTRING_LEN(str));
214
+ RB_GC_GUARD(str);
215
+
216
+ if (!bitmap) {
217
+ rb_raise(rb_eArgError, "invalid Roaring::Bitmap64 serialization");
218
+ }
212
219
 
213
220
  return TypedData_Wrap_Struct(cRoaringBitmap64, &roaring64_type, bitmap);
214
221
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Roaring
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
data/lib/roaring.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "roaring/version"
4
- require_relative "roaring/roaring"
4
+ require "roaring/roaring"
5
5
  require "set"
6
6
 
7
7
  module Roaring
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roaring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-21 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: prime
@@ -35,7 +34,6 @@ files:
35
34
  - ".yardopts"
36
35
  - CODE_OF_CONDUCT.md
37
36
  - Gemfile
38
- - Gemfile.lock
39
37
  - LICENSE.txt
40
38
  - README.md
41
39
  - Rakefile
@@ -59,7 +57,6 @@ metadata:
59
57
  homepage_uri: https://github.com/jhawthorn/roaring-ruby
60
58
  changelog_uri: https://github.com/jhawthorn/roaring-ruby
61
59
  source_code_uri: https://github.com/jhawthorn/roaring-ruby
62
- post_install_message:
63
60
  rdoc_options: []
64
61
  require_paths:
65
62
  - lib
@@ -74,8 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
71
  - !ruby/object:Gem::Version
75
72
  version: '0'
76
73
  requirements: []
77
- rubygems_version: 3.5.16
78
- signing_key:
74
+ rubygems_version: 4.0.10
79
75
  specification_version: 4
80
76
  summary: Roaring bitmaps for Ruby
81
77
  test_files: []
data/Gemfile.lock DELETED
@@ -1,46 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- roaring (0.3.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- benchmark-ips (2.13.0)
10
- debug (1.6.2)
11
- irb (>= 1.3.6)
12
- reline (>= 0.3.1)
13
- forwardable (1.3.2)
14
- io-console (0.5.11)
15
- irb (1.4.1)
16
- reline (>= 0.3.0)
17
- minitest (5.16.3)
18
- prime (0.1.2)
19
- forwardable
20
- singleton
21
- rake (13.0.6)
22
- rake-compiler (1.2.0)
23
- rake
24
- reline (0.3.1)
25
- io-console (~> 0.5)
26
- singleton (0.1.1)
27
- yard (0.9.36)
28
-
29
- PLATFORMS
30
- arm64-darwin-23
31
- arm64-darwin-24
32
- ruby
33
- x86_64-linux
34
-
35
- DEPENDENCIES
36
- benchmark-ips
37
- debug
38
- minitest (~> 5.0)
39
- prime
40
- rake (~> 13.0)
41
- rake-compiler
42
- roaring!
43
- yard
44
-
45
- BUNDLED WITH
46
- 2.3.4