stringio 3.1.5 → 3.1.7

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: b9f7204dcb94ef40c0b88ca4b8687976b15343e5d1fd4061f6f950ed233d6559
4
- data.tar.gz: 2af6f911dcfba01b80c03a0de22ac90edf271f3f4904fc56abd635bb7eb14ee9
3
+ metadata.gz: d32a3b9eb5ecb12a5c78c7a79418ed351272fe49a2fc1bbde837880a8e6a2a53
4
+ data.tar.gz: 8f965cb4f731147e7d6da44db5acbeda3a08ac51df419445d8001f35b17a1dc9
5
5
  SHA512:
6
- metadata.gz: c7539db6bc763bb420aa5d0e669d91c4da3405bd78f2897af22eba0f10f22863b03dc5e7ba386d1abf7ef08e7af7a3f36880f55f394594f33ecace42166bbd14
7
- data.tar.gz: 23ad934633417cfb11780d9017a4e9a7446f07eae7cb1ff4cafb9a118301bbf315fc347fd889ea97ebdd2a67819d1ee07c4af7c53d11b4e060ec9eb095ab7925
6
+ metadata.gz: 6c3f11fa1dee2b8e00269cad5e99db7014ecdc7b1b7d99f5086d15fb3f04d17105dabd838887e5f87af817851e2a8a59260c7c7af26a5ea40f2ce103ad830775
7
+ data.tar.gz: c9e2afe1c8104c27591454cfeefdc71926c76196d3afc343f76052b9e465566f62df19ae25baaa1217839684910b0c94e4d05b7b08723f1960065f0c2d0844df
data/NEWS.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # News
2
2
 
3
+ ## 3.1.7 - 2025-04-21
4
+
5
+ ### Improvements
6
+
7
+ * CRuby: Added support for `rb_io_mode_t` that will be introduced in
8
+ Ruby 3.5 or later.
9
+ * GH-129
10
+ * Patch by Samuel Williams
11
+
12
+ ### Thanks
13
+
14
+ * Samuel Williams
15
+
16
+ ## 3.1.6 - 2025-03-25
17
+
18
+ ### Fixes
19
+
20
+ * CRuby: Fix SEGV at unget to a null device StringIO
21
+ * JRuby:
22
+ * Fix NullPointerException at unget to a null device StringIO
23
+ * Use proper checkEncoding signature
24
+ * Update strioWrite logic to match CRuby
25
+ * GH-124
26
+
3
27
  ## 3.1.5 - 2025-02-21
4
28
 
5
29
  ### Improvements
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: false
2
2
  require 'mkmf'
3
3
  if RUBY_ENGINE == 'ruby'
4
+ have_type("rb_io_mode_t", "ruby/io.h")
5
+
4
6
  create_makefile('stringio')
5
7
  else
6
8
  File.write('Makefile', dummy_makefile("").join)
@@ -13,7 +13,7 @@
13
13
  **********************************************************************/
14
14
 
15
15
  static const char *const
16
- STRINGIO_VERSION = "3.1.5";
16
+ STRINGIO_VERSION = "3.1.7";
17
17
 
18
18
  #include <stdbool.h>
19
19
 
@@ -35,12 +35,16 @@ STRINGIO_VERSION = "3.1.5";
35
35
  # define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
36
36
  #endif
37
37
 
38
+ #ifndef HAVE_TYPE_RB_IO_MODE_T
39
+ typedef int rb_io_mode_t;
40
+ #endif
41
+
38
42
  struct StringIO {
39
43
  VALUE string;
40
44
  rb_encoding *enc;
41
45
  long pos;
42
46
  long lineno;
43
- int flags;
47
+ rb_io_mode_t flags;
44
48
  int count;
45
49
  };
46
50
 
@@ -180,7 +184,9 @@ check_modifiable(struct StringIO *ptr)
180
184
  else if (OBJ_FROZEN_RAW(ptr->string)) {
181
185
  rb_raise(rb_eIOError, "not modifiable string");
182
186
  }
183
- rb_str_modify(ptr->string);
187
+ else {
188
+ rb_str_modify(ptr->string);
189
+ }
184
190
  }
185
191
 
186
192
  static VALUE
@@ -1850,7 +1856,8 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
1850
1856
  enc = rb_find_encoding(ext_enc);
1851
1857
  if (!enc) {
1852
1858
  rb_io_enc_t convconfig;
1853
- int oflags, fmode;
1859
+ int oflags;
1860
+ rb_io_mode_t fmode;
1854
1861
  VALUE vmode = rb_str_append(rb_str_new_cstr("r:"), ext_enc);
1855
1862
  rb_io_extract_modeenc(&vmode, 0, Qnil, &oflags, &fmode, &convconfig);
1856
1863
  enc = convconfig.enc2;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stringio
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  - Charles Oliver Nutter
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-21 00:00:00.000000000 Z
11
+ date: 2025-04-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Pseudo `IO` class from/to `String`.
14
14
  email:
@@ -42,7 +42,7 @@ licenses:
42
42
  - Ruby
43
43
  - BSD-2-Clause
44
44
  metadata:
45
- changelog_uri: https://github.com/ruby/stringio/releases/tag/v3.1.5
45
+ changelog_uri: https://github.com/ruby/stringio/releases/tag/v3.1.7
46
46
  rdoc_options: []
47
47
  require_paths:
48
48
  - lib
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
- rubygems_version: 3.6.2
60
+ rubygems_version: 3.6.7
61
61
  specification_version: 4
62
62
  summary: Pseudo IO on String
63
63
  test_files: []