| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/stringio/commit/cf58a203eb
|
|
same bug as: https://github.com/jruby/jruby/issues/9035
https://github.com/ruby/stringio/commit/65b144b175
|
|
(https://github.com/ruby/stringio/pull/139)
https://github.com/ruby/stringio/commit/0edc8e22da
|
|
https://github.com/ruby/stringio/commit/29b9133332
|
|
https://github.com/ruby/stringio/commit/113dd5a55e
|
|
on null device
(https://github.com/ruby/stringio/pull/137)
Fixes segmentation fault when calling `seek` with `SEEK_END` on null
device StringIO created by
`StringIO.new(nil)`.
```bash
ruby -e "require 'stringio'; StringIO.new(nil).seek(0, IO::SEEK_END)"
```
I tested with below versions.
```bash
[koh@Kohs-MacBook-Pro] ~
% ruby -v;gem info stringio;sw_vers
ruby 3.4.5 (2025-07-16 revision https://github.com/ruby/stringio/commit/20cda200d3) +PRISM [arm64-darwin24]
*** LOCAL GEMS ***
stringio (3.1.2)
Authors: Nobu Nakada, Charles Oliver Nutter
Homepage: https://github.com/ruby/stringio
Licenses: Ruby, BSD-2-Clause
Installed at (default): /Users/koh/.local/share/mise/installs/ruby/3.4.5/lib/ruby/gems/3.4.0
Pseudo IO on String
ProductName: macOS
ProductVersion: 15.5
BuildVersion: 24F74
[koh@Kohs-MacBook-Pro] ~
%
```
https://github.com/ruby/stringio/commit/9399747bf9
|
|
(https://github.com/ruby/stringio/pull/134)
from https://bugs.ruby-lang.org/issues/21262
We need to alias `Ractor#value` to `Ractor#take` for old versions of
Ruby.
---------
https://github.com/ruby/stringio/commit/9954dabd80
Co-authored-by: Koichi Sasada <ko1@atdot.net>
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
|
|
* Added `Ractor::Port`
* `Ractor::Port#receive` (support multi-threads)
* `Rcator::Port#close`
* `Ractor::Port#closed?`
* Added some methods
* `Ractor#join`
* `Ractor#value`
* `Ractor#monitor`
* `Ractor#unmonitor`
* Removed some methods
* `Ractor#take`
* `Ractor.yield`
* Change the spec
* `Racotr.select`
You can wait for multiple sequences of messages with `Ractor::Port`.
```ruby
ports = 3.times.map{ Ractor::Port.new }
ports.map.with_index do |port, ri|
Ractor.new port,ri do |port, ri|
3.times{|i| port << "r#{ri}-#{i}"}
end
end
p ports.each{|port| pp 3.times.map{port.receive}}
```
In this example, we use 3 ports, and 3 Ractors send messages to them respectively.
We can receive a series of messages from each port.
You can use `Ractor#value` to get the last value of a Ractor's block:
```ruby
result = Ractor.new do
heavy_task()
end.value
```
You can wait for the termination of a Ractor with `Ractor#join` like this:
```ruby
Ractor.new do
some_task()
end.join
```
`#value` and `#join` are similar to `Thread#value` and `Thread#join`.
To implement `#join`, `Ractor#monitor` (and `Ractor#unmonitor`) is introduced.
This commit changes `Ractor.select()` method.
It now only accepts ports or Ractors, and returns when a port receives a message or a Ractor terminates.
We removes `Ractor.yield` and `Ractor#take` because:
* `Ractor::Port` supports most of similar use cases in a simpler manner.
* Removing them significantly simplifies the code.
We also change the internal thread scheduler code (thread_pthread.c):
* During barrier synchronization, we keep the `ractor_sched` lock to avoid deadlocks.
This lock is released by `rb_ractor_sched_barrier_end()`
which is called at the end of operations that require the barrier.
* fix potential deadlock issues by checking interrupts just before setting UBF.
https://bugs.ruby-lang.org/issues/21262
Notes:
Merged: https://github.com/ruby/ruby/pull/13445
|
|
chilled
StringIO does not warn for unchilled unfrozen string or for frozen
string, so it should not warn for chilled string.
https://github.com/ruby/stringio/commit/4ac33b8c70
|
|
https://github.com/ruby/stringio/commit/eb4ee49218
|
|
https://github.com/ruby/stringio/commit/4a35291ed3
|
|
(https://github.com/ruby/stringio/pull/121)
Fixes https://github.com/ruby/stringio/pull/119. Adds a test for this expectation.
https://github.com/ruby/stringio/commit/3f90fe44c6
|
|
(https://github.com/ruby/stringio/pull/117)
We need to ensure shared buffers are made independent on mutation.
Otherwise we could end up mutating unrelated string buffers.
---------
https://github.com/ruby/stringio/commit/5101cfb030
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
|
When ungetting the string same as the same buffer string, extending
the buffer can move the pointer in the argument. Reported by manun
Manu (manun) at https://hackerone.com/reports/2805165.
https://github.com/ruby/stringio/commit/95c1194832
|
|
[Feature #20205]
Followup: https://github.com/ruby/stringio/pull/94
They no longer need to be special cases. If StringIO end up
mutating a chilled string, a warning will be emitted.
https://github.com/ruby/stringio/commit/dc62d65449
|
|
reads
(https://github.com/ruby/stringio/pull/95)
[[Bug #20418]](https://bugs.ruby-lang.org/issues/20418)
Ruby IO#read preserves the encoding on partial read, but change it when
reading the whole IO
from commit https://github.com/ruby/ruby/commit/0ca7036682da:
> * io.c (read_all): should associate default external encoding.
> * io.c (io_read): should NOT associate default external encoding.
https://github.com/ruby/stringio/commit/073172da31
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
[Feature #20390]
https://github.com/ruby/stringio/commit/17ee957f34
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
|
|
https://github.com/ruby/stringio/commit/779f71359d
|
|
As preparation for https://bugs.ruby-lang.org/issues/20205
making sure the test suite is compatible with frozen string
literals is making things easier.
|
|
https://github.com/ruby/stringio/commit/0205bd1c86
|
|
(https://github.com/ruby/stringio/pull/85)
* Fix compile warnings on latest Java.
* Adjust one test for JRuby erroring on bad pos= value.
* Replace hard JVM synchronization with a spin lock.
* Avoid duplicate reads of state fields where possible.
* Remove long-deprecated codepoints, chars, bytes, lines methods.
* Mark fcntl as not implemented
* Split most of the remaining variable-arity methods.
https://github.com/ruby/stringio/commit/31a9d42e6c
|
|
(https://github.com/ruby/stringio/pull/77)
Followup of #79
`rb_str_resize()` was changed by https://github.com/ruby/ruby/commit/b0b9f7201acab05c2a3ad92c3043a1f01df3e17f .
```c
rb_str_resize(string, shorter) // clear ENC_CODERANGE in some case
rb_str_resize(string, longer) // does not clear ENC_CODERANGE anymore
```
```c
// rb_str_resize in string.c
if (slen > len && ENC_CODERANGE(str) != ENC_CODERANGE_7BIT) {
ENC_CODERANGE_CLEAR(str);
}
```
I think this change is based on an assumption that appending null bytes
will not change flag `ascii_only?`.
`strio_extend()` will make the string longer if needed, and update the
flags correctly for appending null bytes.
Before `memmove()`, we need to `rb_str_modify()` because updated flags are not
updated for `memmove()`.
https://github.com/ruby/stringio/commit/b31a538576
|
|
Fix https://bugs.ruby-lang.org/issues/20185
https://github.com/ruby/stringio/commit/8230552a46
|
|
(https://github.com/ruby/stringio/pull/69)
The conversion logic is borrowed from ruby/ruby's io.c:
https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079
Fix ruby/stringio#68
Reported by IWAMOTO Kouichi. Thanks!!!
https://github.com/ruby/stringio/commit/4b170c1a68
|
|
(https://github.com/ruby/stringio/pull/67)
Fix: https://github.com/ruby/stringio/issues/66
If length is 0, IO#pread don't even try to read the IO, it simply return
the buffer untouched if there is one or a new empty buffer otherwise.
It also doesn't validate the offset when length is 0.
cc @jdelStrother @kou
https://github.com/ruby/stringio/commit/37e9279337
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
Fixes GH-57
|
|
Both for being closer to real IOs and also because it's a convenient API
in multithreaded scenarios.
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/stringio/commit/eb322a9716
|
|
https://github.com/ruby/stringio/commit/16847fea32
|
|
Fix https://github.com/ruby/stringio/pull/16
https://github.com/ruby/stringio/commit/c8a69e80d2
|
|
Try to mirror IO behavior, where chomp takes out the entire paragraph
separators between entries, but does not chomp a single line separator
at the end of the string.
Partially Fixes [Bug #18768]
https://github.com/ruby/stringio/commit/a83ddbb7f0
|
|
nil separator means no separator at all, so nothing should be
chomped.
Partial fix for Ruby [Bug #18770]
https://github.com/ruby/stringio/commit/feaa2ec631
|
|
Previously, this could result in an infinite loop. Always update
the e pointer in this case, setting w when chomping so the chomped
data is not included in the output.
Fixes [Bug #18769]
https://github.com/ruby/stringio/commit/4bf64d5130
|
|
https://github.com/ruby/stringio/commit/a35268a3ac
|
|
[Bug #17675] https://bugs.ruby-lang.org/issues/17675
https://github.com/ruby/stringio/commit/1ed61d0cbc
|
|
|
|
https://github.com/ruby/stringio/commit/ee3fec7512
https://github.com/ruby/stringio/commit/18dcd045ef
https://github.com/ruby/stringio/commit/18dcd045ef
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3460
|
|
https://github.com/ruby/stringio/commit/59df1c8293
Notes:
Merged: https://github.com/ruby/ruby/pull/3334
|
|
https://github.com/ruby/stringio/commit/1d28e5c969
Notes:
Merged: https://github.com/ruby/ruby/pull/3334
|
|
As `rb_str_conv_enc()` returns the argument string object itself
unchanged when any conversion failed, check the incompatibility in
that case.
Fixes https://github.com/ruby/stringio/issues/13
https://github.com/ruby/stringio/commit/ede6bdcc71
Notes:
Merged: https://github.com/ruby/ruby/pull/3334
|
|
[Bug #16497]
https://github.com/ruby/stringio/commit/4958a5ccab
|
|
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.
https://github.com/ruby/stringio/commit/60ee9ccd95
|
|
`8 * RbConfig::SIZEOF` ... is not straight.
|
|
https://github.com/ruby/stringio/commit/b249631c43
|
|
https://github.com/ruby/stringio/commit/7b20075ab0
|
|
|
|
* string.c: String#setbyte to accept arbitrary integers [Bug #15460]
* io.c: ditto for IO#ungetbyte
* ext/strringio/stringio.c: ditto for StringIO#ungetbyte
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
see r65802 and [Bug #14359]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
They should work separatedly from Ruby core repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|