From 807c9a3caccc9e96d06c31d8d55c1817e4718c0d Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Tue, 3 Jul 2012 08:39:57 +0900 Subject: remote directory code as it was not the cause of #81 --- lib/axlsx/package.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index d03a1738..c98e3e89 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -156,18 +156,18 @@ module Axlsx # @return [Zip::ZipOutputStream] def write_parts(zip) p = parts - p.each do |part| - unless part[:doc].nil? - zip.put_next_entry(part[:entry]); - entry = ['1.9.2', '1.9.3'].include?(RUBY_VERSION) ? part[:doc].force_encoding('BINARY') : part[:doc] - zip.puts(entry) - end - unless part[:path].nil? - zip.put_next_entry(part[:entry]); - # binread for 1.9.3 - zip.write IO.respond_to?(:binread) ? IO.binread(part[:path]) : IO.read(part[:path]) - end + p.each do |part| + unless part[:doc].nil? + zip.put_next_entry(part[:entry]) + entry = ['1.9.2', '1.9.3'].include?(RUBY_VERSION) ? part[:doc].force_encoding('BINARY') : part[:doc] + zip.puts(entry) end + unless part[:path].nil? + zip.put_next_entry(part[:entry]); + # binread for 1.9.3 + zip.write IO.respond_to?(:binread) ? IO.binread(part[:path]) : IO.read(part[:path]) + end + end zip end -- cgit v1.2.3