Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ee17203bf661
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 98918e40a5ca
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Oct 6, 2016

  1. Flush destination IO in IO.copy_stream

    Previously, any buffered IO was ignored when copying to the destination stream.
    
    Untagged a couple of specs that are no longer failing with the additional flush.
    grddev committed Oct 6, 2016
    Copy the full SHA
    b7fab70 View commit details
  2. Merge pull request #4207 from grddev/flush-dst-in-copy-stream

    Flush destination IO in IO.copy_stream
    headius authored Oct 6, 2016
    Copy the full SHA
    98918e4 View commit details
Showing with 2 additions and 4 deletions.
  1. +2 −0 core/src/main/java/org/jruby/RubyIO.java
  2. +0 −3 spec/tags/ruby/core/io/copy_stream_tags.txt
  3. +0 −1 test/mri/excludes/TestIO.rb
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -4096,6 +4096,8 @@ public static IRubyObject copy_stream(ThreadContext context, IRubyObject recv, I
if (!io1.openFile.isReadable()) throw runtime.newIOError("from IO is not readable");
if (!io2.openFile.isWritable()) throw runtime.newIOError("to IO is not writable");

io2.flush(context);

// attempt to preserve position of original
OpenFile fptr = io1.getOpenFileChecked();

3 changes: 0 additions & 3 deletions spec/tags/ruby/core/io/copy_stream_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
fails:IO.copy_stream from an IO to an IO starts writing at the destination IO's current position
fails:IO.copy_stream from a file name to an IO starts writing at the destination IO's current position
fails:IO.copy_stream from a pipe IO raises an error when an offset is specified
fails:IO.copy_stream from a pipe IO to an IO starts writing at the destination IO's current position
fails:IO.copy_stream with non-IO Objects calls #readpartial on the source Object if defined
windows:IO.copy_stream from an IO does change the IO offset when an offset is not specified
windows:IO.copy_stream from an IO to a file name copies the entire IO contents to the file
1 change: 0 additions & 1 deletion test/mri/excludes/TestIO.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
exclude :test_copy_stream_bigcontent_chop, "needs investigation"
exclude :test_copy_stream_bigcontent_fpos, "needs investigation"
exclude :test_copy_stream_broken_src_read_eof, "needs investigation"
exclude :test_copy_stream_dst_rbuf, "needs investigation"
exclude :test_copy_stream_megacontent_nonblock, "copy_stream does not block against a nonblocking stream (#2439)"
exclude :test_copy_stream_pipe_nonblock, "copy_stream does not block against a nonblocking stream (#2439)"
exclude :test_copy_stream_read_pipe, "needs investigation"