stringio 3.1.8 → 3.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS.md +52 -0
  3. data/ext/stringio/stringio.c +13 -175
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7955baf0f07b14461ca7f88b4c2f97383d9cf1114e07fd7408e1e332f974c139
4
- data.tar.gz: 4169d5e9055f8ce90725fc374030ff97b8473734741c3cb741527f7e0aefd865
3
+ metadata.gz: 7c1acfcaec0e05165de2f55e7519bc0c5a732d9e00787843daade47fb287726e
4
+ data.tar.gz: 02eda2070ab8b4a9bc125de803c68de0a01845227c5e4f15359931f9fece7bbd
5
5
  SHA512:
6
- metadata.gz: e91d6fa5462e3afec46f4e709dd746e8bb275198825eca723634b2837207270c05973f224884525da256fd1ad17b1da7659046f78135ba958651715c7a34b5f7
7
- data.tar.gz: 673e6b9e4e59a31b708963893bcc9ea80e01351b272b82992467b72e8c7a074eb9f2f8f854cbdc2767ca826c5d9351cfaa82ce721e8a32dca41ca6ad9a47f883
6
+ metadata.gz: f86b9853126abe79c1b801c2854cb606d532617218fa2a26dcc0c55c2c0ef457bee707e1d9ce08e6bfaf93c09411a175d244773b23ad0970c91ad3d068ba5718
7
+ data.tar.gz: 76083aecab40178e6c7296351c6cb66f128188000d925062d210cc938917ad8e8316074843e1fc7da295e67d391b1be2bded0409c076700a8e15a16f9dc8cd23
data/NEWS.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # News
2
2
 
3
+ ## 3.2.0 - 2025-12-17
4
+
5
+ ### Improvements
6
+
7
+ * Improved documents.
8
+ * GH-179
9
+ * GH-188
10
+ * GH-189
11
+ * GH-190
12
+ * GH-191
13
+ * GH-192
14
+ * GH-193
15
+ * GH-194
16
+ * Patch by Burdette Lamar
17
+
18
+ ### Thanks
19
+
20
+ * Burdette Lamar
21
+
22
+ ## 3.1.9 - 2025-12-01
23
+
24
+ ### Improvements
25
+
26
+ * [DOC] Tweaks for StringIO#each_line
27
+ * GH-165
28
+
29
+ * [DOC] Doc for StringIO.size
30
+ * GH-175
31
+
32
+ * [DOC] Tweaks for StringIO#fsync
33
+ * GH-173
34
+
35
+ * [DOC] Fix #seek link
36
+ * GH-174
37
+
38
+ * Add a note about chilled string support to 3.1.8 release note
39
+ * GH-180 fixes GH-179
40
+
41
+ ### Fixes
42
+
43
+ * JRuby: Removed use of RubyBasicObject.flags
44
+ * GH-182
45
+
46
+ ### Thanks
47
+
48
+ * Burdette Lamar
49
+
50
+ * Charles Oliver Nutter
51
+
3
52
  ## 3.1.8 - 2025-11-12
4
53
 
5
54
  ### Improvements
@@ -7,6 +56,9 @@
7
56
  * Improved documents
8
57
  * Patch by Burdette Lamar
9
58
 
59
+ * Improved chilled string support
60
+ * GH-128
61
+
10
62
  ### Fixes
11
63
 
12
64
  * Fixed SEGV in `StringIO#seek` with `SEEK_END` on `StringIO.new(nil)`
@@ -13,7 +13,7 @@
13
13
  **********************************************************************/
14
14
 
15
15
  static const char *const
16
- STRINGIO_VERSION = "3.1.8";
16
+ STRINGIO_VERSION = "3.2.0";
17
17
 
18
18
  #include <stdbool.h>
19
19
 
@@ -747,7 +747,7 @@ strio_copy(VALUE copy, VALUE orig)
747
747
  * lineno -> current_line_number
748
748
  *
749
749
  * Returns the current line number in +self+;
750
- * see {Line Number}[rdoc-ref:IO@Line+Number].
750
+ * see {Line Number}[rdoc-ref:StringIO@Line+Number].
751
751
  */
752
752
  static VALUE
753
753
  strio_get_lineno(VALUE self)
@@ -760,7 +760,7 @@ strio_get_lineno(VALUE self)
760
760
  * lineno = new_line_number -> new_line_number
761
761
  *
762
762
  * Sets the current line number in +self+ to the given +new_line_number+;
763
- * see {Line Number}[rdoc-ref:IO@Line+Number].
763
+ * see {Line Number}[rdoc-ref:StringIO@Line+Number].
764
764
  */
765
765
  static VALUE
766
766
  strio_set_lineno(VALUE self, VALUE lineno)
@@ -774,7 +774,7 @@ strio_set_lineno(VALUE self, VALUE lineno)
774
774
  * binmode -> self
775
775
  *
776
776
  * Sets the data mode in +self+ to binary mode;
777
- * see {Data Mode}[https://docs.ruby-lang.org/en/master/File.html#class-File-label-Data+Mode].
777
+ * see {Data Mode}[rdoc-ref:StringIO@Data+Mode].
778
778
  *
779
779
  */
780
780
  static VALUE
@@ -835,7 +835,7 @@ strio_reopen(int argc, VALUE *argv, VALUE self)
835
835
  * pos -> stream_position
836
836
  *
837
837
  * Returns the current position (in bytes);
838
- * see {Position}[rdoc-ref:IO@Position].
838
+ * see {Position}[rdoc-ref:StringIO@Position].
839
839
  */
840
840
  static VALUE
841
841
  strio_get_pos(VALUE self)
@@ -848,7 +848,7 @@ strio_get_pos(VALUE self)
848
848
  * pos = new_position -> new_position
849
849
  *
850
850
  * Sets the current position (in bytes);
851
- * see {Position}[rdoc-ref:IO@Position].
851
+ * see {Position}[rdoc-ref:StringIO@Position].
852
852
  */
853
853
  static VALUE
854
854
  strio_set_pos(VALUE self, VALUE pos)
@@ -883,9 +883,9 @@ strio_rewind(VALUE self)
883
883
  * call-seq:
884
884
  * seek(offset, whence = SEEK_SET) -> 0
885
885
  *
886
- * Sets the current position to the given integer +offset+ (in bytes),
886
+ * Sets the position to the given integer +offset+ (in bytes),
887
887
  * with respect to a given constant +whence+;
888
- * see {Position}[rdoc-ref:IO@Position].
888
+ * see {IO#seek}[https://docs.ruby-lang.org/en/master/IO.html#method-i-seek].
889
889
  */
890
890
  static VALUE
891
891
  strio_seek(int argc, VALUE *argv, VALUE self)
@@ -1473,170 +1473,8 @@ strio_readline(int argc, VALUE *argv, VALUE self)
1473
1473
  * each_line(limit, chomp: false) {|line| ... } -> self
1474
1474
  * each_line(sep, limit, chomp: false) {|line| ... } -> self
1475
1475
  *
1476
- * With a block given calls the block with each remaining line (see "Position" below) in the stream;
1477
- * returns `self`.
1476
+ * :include: stringio/each_line.md
1478
1477
  *
1479
- * Leaves stream position as end-of-stream.
1480
- *
1481
- * **No Arguments**
1482
- *
1483
- * With no arguments given,
1484
- * reads lines using the default record separator global variable `$/`, whose initial value is `"\n"`.
1485
- *
1486
- * ```
1487
- * strio = StringIO.new(TEXT)
1488
- * strio.each_line {|line| p line }
1489
- * strio.eof? # => true
1490
- * ```
1491
- *
1492
- * Output:
1493
- *
1494
- * ```
1495
- * "First line\n"
1496
- * "Second line\n"
1497
- * "\n"
1498
- * "Fourth line\n"
1499
- * "Fifth line\n"
1500
- * ```
1501
- *
1502
- * **Argument `sep`**
1503
- *
1504
- * With only string argument `sep` given,
1505
- * reads lines using that string as the record separator:
1506
- *
1507
- * ```
1508
- * strio = StringIO.new(TEXT)
1509
- * strio.each_line(' ') {|line| p line }
1510
- * ```
1511
- *
1512
- * Output:
1513
- *
1514
- * ```
1515
- * "First "
1516
- * "line\nSecond "
1517
- * "line\n\nFourth "
1518
- * "line\nFifth "
1519
- * "line\n"
1520
- * ```
1521
- *
1522
- * **Argument `limit`**
1523
- *
1524
- * With only integer argument `limit` given,
1525
- * reads lines using the default record separator global variable `$/`, whose initial value is `"\n"`;
1526
- * also limits the size (in characters) of each line to the given limit:
1527
- *
1528
- * ```
1529
- * strio = StringIO.new(TEXT)
1530
- * strio.each_line(10) {|line| p line }
1531
- * ```
1532
- *
1533
- * Output:
1534
- *
1535
- * ```
1536
- * "First line"
1537
- * "\n"
1538
- * "Second lin"
1539
- * "e\n"
1540
- * "\n"
1541
- * "Fourth lin"
1542
- * "e\n"
1543
- * "Fifth line"
1544
- * "\n"
1545
- * ```
1546
- * **Arguments `sep` and `limit`**
1547
- *
1548
- * With arguments `sep` and `limit` both given,
1549
- * honors both:
1550
- *
1551
- * ```
1552
- * strio = StringIO.new(TEXT)
1553
- * strio.each_line(' ', 10) {|line| p line }
1554
- * ```
1555
- *
1556
- * Output:
1557
- *
1558
- * ```
1559
- * "First "
1560
- * "line\nSecon"
1561
- * "d "
1562
- * "line\n\nFour"
1563
- * "th "
1564
- * "line\nFifth"
1565
- * " "
1566
- * "line\n"
1567
- * ```
1568
- *
1569
- * **Position**
1570
- *
1571
- * As stated above, method `each` _remaining_ line in the stream.
1572
- *
1573
- * In the examples above each `strio` object starts with its position at beginning-of-stream;
1574
- * but in other cases the position may be anywhere (see StringIO#pos):
1575
- *
1576
- * ```
1577
- * strio = StringIO.new(TEXT)
1578
- * strio.pos = 30 # Set stream position to character 30.
1579
- * strio.each_line {|line| p line }
1580
- * ```
1581
- *
1582
- * Output:
1583
- *
1584
- * ```
1585
- * " line\n"
1586
- * "Fifth line\n"
1587
- * ```
1588
- *
1589
- * **Special Record Separators**
1590
- *
1591
- * Like some methds in class `IO`, StringIO.each honors two special record separators;
1592
- * see {Special Line Separators}[https://docs.ruby-lang.org/en/master/IO.html#class-IO-label-Special+Line+Separator+Values].
1593
- *
1594
- * ```
1595
- * strio = StringIO.new(TEXT)
1596
- * strio.each_line('') {|line| p line } # Read as paragraphs (separated by blank lines).
1597
- * ```
1598
- *
1599
- * Output:
1600
- *
1601
- * ```
1602
- * "First line\nSecond line\n\n"
1603
- * "Fourth line\nFifth line\n"
1604
- * ```
1605
- *
1606
- * ```
1607
- * strio = StringIO.new(TEXT)
1608
- * strio.each_line(nil) {|line| p line } # "Slurp"; read it all.
1609
- * ```
1610
- *
1611
- * Output:
1612
- *
1613
- * ```
1614
- * "First line\nSecond line\n\nFourth line\nFifth line\n"
1615
- * ```
1616
- *
1617
- * **Keyword Argument `chomp`**
1618
- *
1619
- * With keyword argument `chomp` given as `true` (the default is `false`),
1620
- * removes trailing newline (if any) from each line:
1621
- *
1622
- * ```
1623
- * strio = StringIO.new(TEXT)
1624
- * strio.each_line(chomp: true) {|line| p line }
1625
- * ```
1626
- *
1627
- * Output:
1628
- *
1629
- * ```
1630
- * "First line"
1631
- * "Second line"
1632
- * ""
1633
- * "Fourth line"
1634
- * "Fifth line"
1635
- * ```
1636
- *
1637
- * With no block given, returns a new {Enumerator}[https://docs.ruby-lang.org/en/master/Enumerator.html].
1638
- *
1639
- * Related: StringIO.each_byte, StringIO.each_char, StringIO.each_codepoint.
1640
1478
  */
1641
1479
  static VALUE
1642
1480
  strio_each(int argc, VALUE *argv, VALUE self)
@@ -2005,10 +1843,10 @@ strio_syswrite_nonblock(int argc, VALUE *argv, VALUE self)
2005
1843
 
2006
1844
  /*
2007
1845
  * call-seq:
2008
- * strio.length -> integer
2009
- * strio.size -> integer
1846
+ * size -> integer
1847
+ *
1848
+ * :include: stringio/size.rdoc
2010
1849
  *
2011
- * Returns the size of the buffer string.
2012
1850
  */
2013
1851
  static VALUE
2014
1852
  strio_size(VALUE self)
@@ -2050,7 +1888,7 @@ strio_truncate(VALUE self, VALUE len)
2050
1888
  * external_encoding -> encoding or nil
2051
1889
  *
2052
1890
  * Returns an Encoding object that represents the encoding of the string;
2053
- * see {Encoding}[https://docs.ruby-lang.org/en/master/Encoding.html]:
1891
+ * see {Encodings}[rdoc-ref:StringIO@Encodings]:
2054
1892
  *
2055
1893
  * strio = StringIO.new('foo')
2056
1894
  * strio.external_encoding # => #<Encoding:UTF-8>
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.8
4
+ version: 3.2.0
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-11-12 00:00:00.000000000 Z
11
+ date: 2025-12-17 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.8
45
+ changelog_uri: https://github.com/ruby/stringio/releases/tag/v3.2.0
46
46
  rdoc_options: []
47
47
  require_paths:
48
48
  - lib