zipline 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/zipline.rb +1 -1
- data/lib/zipline/output_stream.rb +5 -1
- data/lib/zipline/version.rb +1 -1
- metadata +21 -13
- checksums.yaml +0 -7
data/lib/zipline.rb
CHANGED
@@ -18,7 +18,7 @@ require "zipline/zip_generator"
|
|
18
18
|
module Zipline
|
19
19
|
def zipline(files, zipname = 'zipline.zip')
|
20
20
|
zip_generator = ZipGenerator.new(files)
|
21
|
-
headers['Content-Disposition'] = "attachment; filename
|
21
|
+
headers['Content-Disposition'] = "attachment; filename=\"#{zipname.gsub '"', '\"'}\""
|
22
22
|
headers['Content-Type'] = Mime::Type.lookup_by_extension('zip').to_s
|
23
23
|
response.sending_file = true
|
24
24
|
response.cache_control[:public] ||= false
|
@@ -17,12 +17,16 @@ module Zipline
|
|
17
17
|
|
18
18
|
def put_next_entry(entry_name, size)
|
19
19
|
new_entry = Zip::Entry.new(@file_name, entry_name)
|
20
|
-
new_entry.size = size
|
21
20
|
|
22
21
|
#THIS IS THE MAGIC, tells zip to look after data for size, crc
|
23
22
|
new_entry.gp_flags = new_entry.gp_flags | 0x0008
|
24
23
|
|
25
24
|
super(new_entry)
|
25
|
+
|
26
|
+
# Uncompressed size in the local file header must be zero when bit 3
|
27
|
+
# of the general purpose flags is set, so set the size after the header
|
28
|
+
# has been written.
|
29
|
+
new_entry.size = size
|
26
30
|
end
|
27
31
|
|
28
32
|
# just reset state, no rewinding required
|
data/lib/zipline/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Ram Dobson
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rubyzip
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '1.0'
|
20
22
|
- - <=
|
@@ -23,8 +25,9 @@ dependencies:
|
|
23
25
|
type: :runtime
|
24
26
|
prerelease: false
|
25
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
26
29
|
requirements:
|
27
|
-
- - '>='
|
30
|
+
- - ! '>='
|
28
31
|
- !ruby/object:Gem::Version
|
29
32
|
version: '1.0'
|
30
33
|
- - <=
|
@@ -33,8 +36,9 @@ dependencies:
|
|
33
36
|
- !ruby/object:Gem::Dependency
|
34
37
|
name: rails
|
35
38
|
requirement: !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
|
-
- - '>='
|
41
|
+
- - ! '>='
|
38
42
|
- !ruby/object:Gem::Version
|
39
43
|
version: 3.2.1
|
40
44
|
- - <
|
@@ -43,8 +47,9 @@ dependencies:
|
|
43
47
|
type: :runtime
|
44
48
|
prerelease: false
|
45
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
46
51
|
requirements:
|
47
|
-
- - '>='
|
52
|
+
- - ! '>='
|
48
53
|
- !ruby/object:Gem::Version
|
49
54
|
version: 3.2.1
|
50
55
|
- - <
|
@@ -53,15 +58,17 @@ dependencies:
|
|
53
58
|
- !ruby/object:Gem::Dependency
|
54
59
|
name: curb
|
55
60
|
requirement: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
56
62
|
requirements:
|
57
|
-
- - '>='
|
63
|
+
- - ! '>='
|
58
64
|
- !ruby/object:Gem::Version
|
59
65
|
version: '0'
|
60
66
|
type: :runtime
|
61
67
|
prerelease: false
|
62
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
63
70
|
requirements:
|
64
|
-
- - '>='
|
71
|
+
- - ! '>='
|
65
72
|
- !ruby/object:Gem::Version
|
66
73
|
version: '0'
|
67
74
|
description: this is a giant pile of hax that may let you stream dynamically generated
|
@@ -86,26 +93,27 @@ files:
|
|
86
93
|
- zipline.gemspec
|
87
94
|
homepage: http://github.com/fringd/zipline
|
88
95
|
licenses: []
|
89
|
-
metadata: {}
|
90
96
|
post_install_message:
|
91
97
|
rdoc_options: []
|
92
98
|
require_paths:
|
93
99
|
- lib
|
94
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
95
102
|
requirements:
|
96
|
-
- - '>='
|
103
|
+
- - ! '>='
|
97
104
|
- !ruby/object:Gem::Version
|
98
105
|
version: '0'
|
99
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
100
108
|
requirements:
|
101
|
-
- - '>='
|
109
|
+
- - ! '>='
|
102
110
|
- !ruby/object:Gem::Version
|
103
111
|
version: '0'
|
104
112
|
requirements: []
|
105
113
|
rubyforge_project:
|
106
|
-
rubygems_version:
|
114
|
+
rubygems_version: 1.8.23
|
107
115
|
signing_key:
|
108
|
-
specification_version:
|
116
|
+
specification_version: 3
|
109
117
|
summary: stream zip files from rails
|
110
118
|
test_files:
|
111
119
|
- spec/lib/zipline/zip_generator_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 9b48fbf7198d9030ccdc2e84f3641244ec2356e9
|
4
|
-
data.tar.gz: 2ff49a3cafd6035fef3ac4c3bec01a35aa11bb38
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 3497595098265d777bfd5e534694ee16f3c8c5dc4335cc329c920f02d089ffef98e5dc2cdcfdcbc8c6ba762c095fe5257fcff6cef462152cbbb2a9ef0bbe75c4
|
7
|
-
data.tar.gz: 97f69f5834d1b177c4ca9f3023293bb9453094d36fd3c5b049e0986f05b1af9823f35393b715837f2fd9158376cf31456b5bd2aa9198f8c7991a024a11d952a7
|