zip_tricks 2.6.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zip_tricks/streamer.rb +11 -0
- data/lib/zip_tricks.rb +1 -1
- data/spec/zip_tricks/streamer_spec.rb +1 -1
- data/zip_tricks.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cd89ab487709ccaf797ab39fa9507ee0ac793e1
|
4
|
+
data.tar.gz: 8c21a1106a9398dca0d4bb2e32bcb4a9f9b8b1ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1bf6cfe7579dc8d0e21c625b135b06dcc036acb148ed197a0f1657f673bf5a77ce826a6df445b902a6dd556287c68cce7ce9aca080fe735cb405ceb5ac8f2bc
|
7
|
+
data.tar.gz: 9717bf12a2559c743b2855ce9ab78279968ff12c1b6036df07fb7db0d1b052955f3bd7b6e9faec6d608a84cbbe08e26eb81fc817ea2090d516a3ea83f9632811
|
data/lib/zip_tricks/streamer.rb
CHANGED
@@ -62,6 +62,17 @@ class ZipTricks::Streamer
|
|
62
62
|
self
|
63
63
|
end
|
64
64
|
|
65
|
+
# Writes a part of a zip entry body (actual binary data of the entry) into the output stream,
|
66
|
+
# and returns the number of bytes written. Is implemented to make Streamer usable with
|
67
|
+
# `IO.copy_stream(from, to)`.
|
68
|
+
#
|
69
|
+
# @param binary_data [String] a String in binary encoding
|
70
|
+
# @return [Fixnum] the number of bytes written
|
71
|
+
def write(binary_data)
|
72
|
+
self << binary_data
|
73
|
+
binary_data.bytesize
|
74
|
+
end
|
75
|
+
|
65
76
|
# Advances the internal IO pointer to keep the offsets of the ZIP file in check. Use this if you are going
|
66
77
|
# to use accelerated writes to the socket (like the `sendfile()` call) after writing the headers, or if you
|
67
78
|
# just need to figure out the size of the archive.
|
data/lib/zip_tricks.rb
CHANGED
@@ -207,7 +207,7 @@ describe ZipTricks::Streamer do
|
|
207
207
|
zip.add_stored_entry("first-file.bin", raw_file_1.size, Zlib.crc32(raw_file_1))
|
208
208
|
zip << raw_file_1
|
209
209
|
zip.add_stored_entry("второй-файл.bin", raw_file_2.size, Zlib.crc32(raw_file_2))
|
210
|
-
zip
|
210
|
+
IO.copy_stream(StringIO.new(raw_file_2), zip)
|
211
211
|
zip.close
|
212
212
|
|
213
213
|
zip_buf.flush
|
data/zip_tricks.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: zip_tricks 2.
|
5
|
+
# stub: zip_tricks 2.7.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "zip_tricks"
|
9
|
-
s.version = "2.
|
9
|
+
s.version = "2.7.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Julik Tarkhanov"]
|
14
|
-
s.date = "2016-07-
|
14
|
+
s.date = "2016-07-15"
|
15
15
|
s.description = "Makes rubyzip stream, for real"
|
16
16
|
s.email = "me@julik.nl"
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zip_tricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|