On Ruby 3.1, `URI::Generic#host` would return `nil` for `unix:///` URLs, but on Ruby 3.2 it now returns an empty string: ```rb uri = URI.parse("unix:///var/run/docker.sock") uri.host #=> # Ruby 3.1: nil # Ruby 3.2: "" ``` Thi...janko (Janko Marohnić)
There seems to be a bug in Ruby 3.0 regarding keyword arguments and calling super without arguments, where the splatted variable changes its value after super is called. The following self-contained example reproduces the issue: ``` r...janko (Janko Marohnić)
The patch got outdated in the latest trunk, so I updated it again. It's a really small change with big impact on memory usage when uploading files.janko (Janko Marohnić)
When executing `String#byteslice` with a range, I noticed that sometimes the original string is allocated again. When I run the following script: ~~~ ruby require "objspace" string = "a" * 100_000 GC.start GC.disable generati...janko (Janko Marohnić)
I support adding `String#byteslice!`. I've been using `String#byteslice` in custom IO-like objects that implement `IO#read` semantics, as the strings I work with don't necessarily have to be in binary encoding (otherwise I'd just use `St...janko (Janko Marohnić)
> it looks like @stream_cipher.update can take a second destination arg (like IO#read and friends) and maybe that helps... (that appears to be OpenSSL::Cipher#update) Cool, I didn't know that! Thanks, this allowed me to greatly simpli...janko (Janko Marohnić)
> Yes, this is an unfortunate side effect because of copy-on-write > ... That makes sense, thanks for the explanation. > The other part could be anything using IO#write could create > ... This is on Ruby 2.5.1, so I'm guessing it do...janko (Janko Marohnić)
I'm using custom IO-like objects that implement #read as the first argument to IO.copy_stream, and I noticed odd memory behaviour when using String#replace on the output buffer versus String#clear. Here is an example of a "fake IO" objec...janko (Janko Marohnić)
Any updates on this one? I think it would be nice to have this included in the next patch version. This will make memory usage during large file uploads consistent regardless of whether it's going to HTTP or HTTPS endpoint; currently upl...janko (Janko Marohnić)