File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,11 @@ def save_to(fname)
80
80
f . close
81
81
end
82
82
83
+
84
+ #
83
85
# Compress this archive and return the resulting zip file as a String.
84
86
#
85
- # @param spoof [Hash{String => String}] The entries whose name need to be spoofed in the Central
86
- # Directory.
87
- # @return [String] The resulting zip file
88
- def pack ( spoof = { } )
87
+ def pack
89
88
ret = ''
90
89
91
90
# save the offests
@@ -105,7 +104,7 @@ def pack(spoof={})
105
104
idx = 0
106
105
@entries . each { |ent |
107
106
cfd = CentralDir . new ( ent , offsets [ idx ] )
108
- ret << cfd . pack ( spoof )
107
+ ret << cfd . pack
109
108
idx += 1
110
109
}
111
110
Original file line number Diff line number Diff line change @@ -115,16 +115,8 @@ def initialize(entry, offset)
115
115
@hdr_offset = offset
116
116
end
117
117
118
- # Creates the central directory information about the particular Zip Entry.
119
- #
120
- # @param spoof [Hash{String => String}] The entries whose name need to be spoofed in the Central
121
- # Directory.
122
- # @return [String] The resulting zip file
123
- def pack ( spoof = { } )
118
+ def pack
124
119
path = @entry . relative_path
125
- if spoof . key? ( path )
126
- path = spoof [ path ]
127
- end
128
120
129
121
ret = [ SIGNATURE , ZIP_VERSION ] . pack ( 'Vv' )
130
122
ret << [ ZIP_VERSION ] . pack ( 'v' )
You can’t perform that action at this time.
0 commit comments