lib/npy.rb in npy-0.3.0 vs lib/npy.rb in npy-0.4.0
- old
+ new
@@ -5,12 +5,12 @@
# stdlib
require "stringio"
require "tempfile"
# modules
-require "npy/file"
-require "npy/version"
+require_relative "npy/file"
+require_relative "npy/version"
module Npy
class Error < StandardError; end
MAGIC_STR = "\x93NUMPY".b
@@ -180,10 +180,11 @@
save_npz_io(f, arrs)
end
end
def save_npz_io(f, arrs)
- Zip::File.open(f, Zip::File::CREATE) do |zipfile|
+ # TODO change to create: true for rubyzip 3
+ Zip::File.open(f, true) do |zipfile|
arrs.each do |k, v|
zipfile.get_output_stream("#{k}.npy") do |f2|
save_io(f2, v)
end
end