*** empty log message ***
This commit is contained in:
parent
b14651ce64
commit
f51a2c6b46
|
@ -1,5 +1,13 @@
|
||||||
module IOExtras #:nodoc:
|
module IOExtras #:nodoc:
|
||||||
|
|
||||||
|
CHUNK_SIZE = 32768
|
||||||
|
|
||||||
|
def copy_stream(ostream, istream)
|
||||||
|
s = ''
|
||||||
|
ostream.write(istream.read(CHUNK_SIZE, s)) until istream.eof?
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# Implements kind_of? in order to pretend to be an IO object
|
# Implements kind_of? in order to pretend to be an IO object
|
||||||
module FakeIO
|
module FakeIO
|
||||||
def kind_of?(object)
|
def kind_of?(object)
|
||||||
|
|
|
@ -19,12 +19,12 @@ end
|
||||||
|
|
||||||
module Zip
|
module Zip
|
||||||
|
|
||||||
CHUNK_SIZE=32768
|
|
||||||
|
|
||||||
VERSION = '0.5.8'
|
VERSION = '0.5.8'
|
||||||
|
|
||||||
RUBY_MINOR_VERSION = RUBY_VERSION.split(".")[1].to_i
|
RUBY_MINOR_VERSION = RUBY_VERSION.split(".")[1].to_i
|
||||||
|
|
||||||
|
CHUNK_SIZE=32768
|
||||||
|
|
||||||
# Ruby 1.7.x compatibility
|
# Ruby 1.7.x compatibility
|
||||||
# In ruby 1.6.x and 1.8.0 reading from an empty stream returns
|
# In ruby 1.6.x and 1.8.0 reading from an empty stream returns
|
||||||
# an empty string the first time and then nil.
|
# an empty string the first time and then nil.
|
||||||
|
@ -1279,10 +1279,7 @@ module Zip
|
||||||
|
|
||||||
def write_to_zip_output_stream(aZipOutputStream)
|
def write_to_zip_output_stream(aZipOutputStream)
|
||||||
aZipOutputStream.put_next_entry(self)
|
aZipOutputStream.put_next_entry(self)
|
||||||
get_input_stream {
|
get_input_stream { |is| copy_stream(aZipOutputStream, is) }
|
||||||
|is|
|
|
||||||
aZipOutputStream.write(is.read(CHUNK_SIZE)) until is.eof?
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def == (other)
|
def == (other)
|
||||||
|
@ -1346,10 +1343,7 @@ module Zip
|
||||||
|
|
||||||
def write_to_zip_output_stream(aZipOutputStream)
|
def write_to_zip_output_stream(aZipOutputStream)
|
||||||
aZipOutputStream.put_next_entry(self)
|
aZipOutputStream.put_next_entry(self)
|
||||||
get_input_stream {
|
get_input_stream { |is| copy_stream(aZipOutputStream, is) }
|
||||||
|is|
|
|
||||||
aZipOutputStream.write(is.read(CHUNK_SIZE)) until is.eof?
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue