Issue #11199 has been reported by Yuki Kurihara.

----------------------------------------
Bug #11199: IO.copy_stream degrade that can't call pathname to pathname
https://bugs.ruby-lang.org/issues/11199

* Author: Yuki Kurihara
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0dev (2015-05-30 trunk 50686) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
IO.copy_stream について、2.2.2〜2.3.0dev間で動作に差異がありました。

再現スクリプトを添付します。

~~~ruby
#! /usr/bin/env ruby

require 'pathname'

IO.write "src", "ok"
src = Pathname.new("src")
dst = Pathname.new("dst")
IO.copy_stream src, dst
puts IO.read("dst")
~~~

~~~
$ ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
$ ruby copy_stream.rb
ok
~~~

~~~
$ ruby --version
ruby 2.3.0dev (2015-05-30 trunk 50686) [x86_64-darwin14]
$ ruby copy_stream.rb
copy_stream.rb:8:in `read': no implicit conversion from string (TypeError)
	from copy_stream.rb:8:in `read'
	from copy_stream.rb:8:in `copy_stream'
	from copy_stream.rb:8:in `<main>'
~~~

仕様変更でなければ、互換性を壊さないために2.2.2の動作を期待します。

---Files--------------------------------
copy_stream.rb (160 Bytes)


-- 
https://bugs.ruby-lang.org/