stringio 3.1.8 → 3.1.9
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 +4 -4
- data/NEWS.md +33 -0
- data/ext/stringio/stringio.c +7 -169
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 82c38ce8a492167984eccc4291f550ec4f16c82708e9a11412e6636b5d8c0f3a
|
|
4
|
+
data.tar.gz: 78853fef7518aafb4fbdec810923d4ba6c05149cf03e9e998a93c98e2de1a82e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3015bd4fa76347c286fc9da21ff751ebc17dcbf6980440c4247ad946901a435c4a31b63085ab5c74d9d55893e43f0e15d11acf34872cd2e16f49591961834cf5
|
|
7
|
+
data.tar.gz: 07a0567e7ef8e667c979cedcc6af3a26934100df077b8054b578b1632593a0a0f490c03c54c447844380bca39ec6fabbb4be837eb3961a9363078e41e38ff763
|
data/NEWS.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# News
|
|
2
2
|
|
|
3
|
+
## 3.1.9 - 2025-12-01
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
* [DOC] Tweaks for StringIO#each_line
|
|
8
|
+
* GH-165
|
|
9
|
+
|
|
10
|
+
* [DOC] Doc for StringIO.size
|
|
11
|
+
* GH-175
|
|
12
|
+
|
|
13
|
+
* [DOC] Tweaks for StringIO#fsync
|
|
14
|
+
* GH-173
|
|
15
|
+
|
|
16
|
+
* [DOC] Fix #seek link
|
|
17
|
+
* GH-174
|
|
18
|
+
|
|
19
|
+
* Add a note about chilled string support to 3.1.8 release note
|
|
20
|
+
* GH-180 fixes GH-179
|
|
21
|
+
|
|
22
|
+
### Fixes
|
|
23
|
+
|
|
24
|
+
* JRuby: Removed use of RubyBasicObject.flags
|
|
25
|
+
* GH-182
|
|
26
|
+
|
|
27
|
+
### Thanks
|
|
28
|
+
|
|
29
|
+
* Burdette Lamar
|
|
30
|
+
|
|
31
|
+
* Charles Oliver Nutter
|
|
32
|
+
|
|
3
33
|
## 3.1.8 - 2025-11-12
|
|
4
34
|
|
|
5
35
|
### Improvements
|
|
@@ -7,6 +37,9 @@
|
|
|
7
37
|
* Improved documents
|
|
8
38
|
* Patch by Burdette Lamar
|
|
9
39
|
|
|
40
|
+
* Improved chilled string support
|
|
41
|
+
* GH-128
|
|
42
|
+
|
|
10
43
|
### Fixes
|
|
11
44
|
|
|
12
45
|
* Fixed SEGV in `StringIO#seek` with `SEEK_END` on `StringIO.new(nil)`
|
data/ext/stringio/stringio.c
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
**********************************************************************/
|
|
14
14
|
|
|
15
15
|
static const char *const
|
|
16
|
-
STRINGIO_VERSION = "3.1.
|
|
16
|
+
STRINGIO_VERSION = "3.1.9";
|
|
17
17
|
|
|
18
18
|
#include <stdbool.h>
|
|
19
19
|
|
|
@@ -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
|
|
886
|
+
* Sets the position to the given integer +offset+ (in bytes),
|
|
887
887
|
* with respect to a given constant +whence+;
|
|
888
|
-
* see {
|
|
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
|
-
*
|
|
1477
|
-
* returns `self`.
|
|
1478
|
-
*
|
|
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**
|
|
1476
|
+
* :include: stringio/each_line.md
|
|
1570
1477
|
*
|
|
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
|
-
*
|
|
2009
|
-
*
|
|
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)
|
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.
|
|
4
|
+
version: 3.1.9
|
|
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
|
+
date: 2025-12-02 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.
|
|
45
|
+
changelog_uri: https://github.com/ruby/stringio/releases/tag/v3.1.9
|
|
46
46
|
rdoc_options: []
|
|
47
47
|
require_paths:
|
|
48
48
|
- lib
|