stringio 3.1.2 → 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: 89f7a19f0a8689e3fa7ceae8a0139eab614a14f64f2d1f5831c0d012d3b49dac
4
- data.tar.gz: 71b2022cc337d594566c0dfcb215bc1f3d4949747c97ffb984ea0613f67d58aa
3
+ metadata.gz: d32a3b9eb5ecb12a5c78c7a79418ed351272fe49a2fc1bbde837880a8e6a2a53
4
+ data.tar.gz: 8f965cb4f731147e7d6da44db5acbeda3a08ac51df419445d8001f35b17a1dc9
5
5
  SHA512:
6
- metadata.gz: e6aa9ba1567fe2ea15f973a81ef8ae215be4ea7b88013dd9a4d9e8cbd8d1d0381dd70980ffb049d8b4283e0b1e6e586ef840618c8f129f1182c71bfa95847824
7
- data.tar.gz: ed2fd455cbe0f072ef020f2b6a114ae192a8a86509cebcb927fb4c7b9754551bdda8519ebc7aa21b6cbf2b3c0cab4170e5017c0468ad4431ea4b9eaf9c473825
6
+ metadata.gz: 6c3f11fa1dee2b8e00269cad5e99db7014ecdc7b1b7d99f5086d15fb3f04d17105dabd838887e5f87af817851e2a8a59260c7c7af26a5ea40f2ce103ad830775
7
+ data.tar.gz: c9e2afe1c8104c27591454cfeefdc71926c76196d3afc343f76052b9e465566f62df19ae25baaa1217839684910b0c94e4d05b7b08723f1960065f0c2d0844df
data/NEWS.md CHANGED
@@ -1,5 +1,63 @@
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
+
27
+ ## 3.1.5 - 2025-02-21
28
+
29
+ ### Improvements
30
+
31
+ * JRuby: Improved compatibility with CRuby for `StringIO#seek` with
32
+ frozen string.
33
+ * GH-119
34
+ * GH-121
35
+
36
+ ## 3.1.4 - 2025-02-20
37
+
38
+ ### Improvements
39
+
40
+ * JRuby: Improved compatibility with CRuby.
41
+ * GH-116
42
+
43
+ ### Fixes
44
+
45
+ * CRuby: Fixed a bug that `StringIO` may mutate a shared string.
46
+ * GH-117
47
+
48
+ ## 3.1.3 - 2025-02-14
49
+
50
+ ### Fixes
51
+
52
+ * JRuby: Fixed a bug that JRuby may not be able to be started
53
+ * GH-112
54
+ * GH-113
55
+ * Reported by Karol Bucek
56
+
57
+ ### Thanks
58
+
59
+ * Karol Bucek
60
+
3
61
  ## 3.1.2 - 2024-11-07
4
62
 
5
63
  ### 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.2";
16
+ STRINGIO_VERSION = "3.1.7";
17
17
 
18
18
  #include <stdbool.h>
19
19
 
@@ -35,12 +35,16 @@ STRINGIO_VERSION = "3.1.2";
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,6 +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
  }
187
+ else {
188
+ rb_str_modify(ptr->string);
189
+ }
183
190
  }
184
191
 
185
192
  static VALUE
@@ -1849,7 +1856,8 @@ strio_set_encoding(int argc, VALUE *argv, VALUE self)
1849
1856
  enc = rb_find_encoding(ext_enc);
1850
1857
  if (!enc) {
1851
1858
  rb_io_enc_t convconfig;
1852
- int oflags, fmode;
1859
+ int oflags;
1860
+ rb_io_mode_t fmode;
1853
1861
  VALUE vmode = rb_str_append(rb_str_new_cstr("r:"), ext_enc);
1854
1862
  rb_io_extract_modeenc(&vmode, 0, Qnil, &oflags, &fmode, &convconfig);
1855
1863
  enc = convconfig.enc2;
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stringio
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  - Charles Oliver Nutter
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-11-07 00:00:00.000000000 Z
11
+ date: 2025-04-21 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Pseudo `IO` class from/to `String`.
15
14
  email:
@@ -42,8 +41,8 @@ homepage: https://github.com/ruby/stringio
42
41
  licenses:
43
42
  - Ruby
44
43
  - BSD-2-Clause
45
- metadata: {}
46
- post_install_message:
44
+ metadata:
45
+ changelog_uri: https://github.com/ruby/stringio/releases/tag/v3.1.7
47
46
  rdoc_options: []
48
47
  require_paths:
49
48
  - lib
@@ -58,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
57
  - !ruby/object:Gem::Version
59
58
  version: '0'
60
59
  requirements: []
61
- rubygems_version: 3.5.22
62
- signing_key:
60
+ rubygems_version: 3.6.7
63
61
  specification_version: 4
64
62
  summary: Pseudo IO on String
65
63
  test_files: []