ruby-changes:53927
From: nobu <ko1@a...>
Date: Mon, 3 Dec 2018 12:15:47 +0900 (JST)
Subject: [ruby-changes:53927] nobu:r66147 (trunk): Cherry-picked spec/mspec/lib/mspec/helpers/fs.rb
nobu 2018-12-03 12:15:42 +0900 (Mon, 03 Dec 2018) New Revision: 66147 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66147 Log: Cherry-picked spec/mspec/lib/mspec/helpers/fs.rb From https://github.com/MSP-Greg/ruby/commit/316f60e3befa312320b2cc600d7b59ba64f12329 Modified files: trunk/spec/mspec/lib/mspec/helpers/fs.rb Index: spec/mspec/lib/mspec/helpers/fs.rb =================================================================== --- spec/mspec/lib/mspec/helpers/fs.rb (revision 66146) +++ spec/mspec/lib/mspec/helpers/fs.rb (revision 66147) @@ -1,12 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers/fs.rb#L1 # Copies a file def cp(source, dest) - File.open(dest, "wb") do |d| - File.open(source, "rb") do |s| - while data = s.read(1024) - d.write data - end - end - end + IO.copy_stream source, dest end # Creates each directory in path that does not exist. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/