archive-zip 0.11.0 → 0.13.0.pre1
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 +5 -5
- data/LICENSE +1 -1
- data/NEWS.md +12 -0
- data/README.md +2 -1
- data/lib/archive/support/ioextensions.rb +5 -7
- data/lib/archive/support/iowindow.rb +34 -87
- data/lib/archive/support/stringio.rb +27 -0
- data/lib/archive/support/zlib.rb +0 -435
- data/lib/archive/zip/codec/deflate/reader.rb +187 -0
- data/lib/archive/zip/codec/deflate/writer.rb +209 -0
- data/lib/archive/zip/codec/deflate.rb +92 -244
- data/lib/archive/zip/codec/null_encryption.rb +4 -184
- data/lib/archive/zip/codec/store/reader.rb +97 -0
- data/lib/archive/zip/codec/store/writer.rb +78 -0
- data/lib/archive/zip/codec/store.rb +6 -231
- data/lib/archive/zip/codec/traditional_encryption/base.rb +85 -0
- data/lib/archive/zip/codec/traditional_encryption/reader.rb +65 -0
- data/lib/archive/zip/codec/traditional_encryption/writer.rb +71 -0
- data/lib/archive/zip/codec/traditional_encryption.rb +6 -360
- data/lib/archive/zip/codec.rb +2 -2
- data/lib/archive/zip/dos_time.rb +103 -0
- data/lib/archive/zip/entry.rb +86 -70
- data/lib/archive/zip.rb +2 -5
- metadata +37 -227
- data/.yardopts +0 -1
- data/Rakefile +0 -247
- data/lib/archive/support/binary_stringio.rb +0 -30
- data/lib/archive/support/integer.rb +0 -13
- data/lib/archive/support/io-like.rb +0 -14
- data/lib/archive/support/time.rb +0 -119
- data/lib/archive/zip/version.rb +0 -6
- data/spec/archive/dos_time_spec.rb +0 -113
- data/spec/archive/zip/archive_spec.rb +0 -54
- data/spec/archive/zip/codec/deflate/compress/checksum_spec.rb +0 -44
- data/spec/archive/zip/codec/deflate/compress/close_spec.rb +0 -45
- data/spec/archive/zip/codec/deflate/compress/crc32_spec.rb +0 -23
- data/spec/archive/zip/codec/deflate/compress/data_descriptor_spec.rb +0 -74
- data/spec/archive/zip/codec/deflate/compress/new_spec.rb +0 -39
- data/spec/archive/zip/codec/deflate/compress/open_spec.rb +0 -48
- data/spec/archive/zip/codec/deflate/compress/write_spec.rb +0 -111
- data/spec/archive/zip/codec/deflate/decompress/checksum_spec.rb +0 -20
- data/spec/archive/zip/codec/deflate/decompress/close_spec.rb +0 -34
- data/spec/archive/zip/codec/deflate/decompress/crc32_spec.rb +0 -20
- data/spec/archive/zip/codec/deflate/decompress/data_descriptor_spec.rb +0 -74
- data/spec/archive/zip/codec/deflate/decompress/new_spec.rb +0 -16
- data/spec/archive/zip/codec/deflate/decompress/open_spec.rb +0 -29
- data/spec/archive/zip/codec/deflate/fixtures/classes.rb +0 -25
- data/spec/archive/zip/codec/deflate/fixtures/compressed_file.bin +0 -1
- data/spec/archive/zip/codec/deflate/fixtures/compressed_file_nocomp.bin +0 -0
- data/spec/archive/zip/codec/deflate/fixtures/raw_file.txt +0 -10
- data/spec/archive/zip/codec/null_encryption/decrypt/close_spec.rb +0 -34
- data/spec/archive/zip/codec/null_encryption/decrypt/new_spec.rb +0 -16
- data/spec/archive/zip/codec/null_encryption/decrypt/open_spec.rb +0 -29
- data/spec/archive/zip/codec/null_encryption/decrypt/read_spec.rb +0 -26
- data/spec/archive/zip/codec/null_encryption/decrypt/rewind_spec.rb +0 -27
- data/spec/archive/zip/codec/null_encryption/decrypt/seek_spec.rb +0 -59
- data/spec/archive/zip/codec/null_encryption/decrypt/tell_spec.rb +0 -23
- data/spec/archive/zip/codec/null_encryption/encrypt/close_spec.rb +0 -34
- data/spec/archive/zip/codec/null_encryption/encrypt/new_spec.rb +0 -16
- data/spec/archive/zip/codec/null_encryption/encrypt/open_spec.rb +0 -31
- data/spec/archive/zip/codec/null_encryption/encrypt/rewind_spec.rb +0 -28
- data/spec/archive/zip/codec/null_encryption/encrypt/seek_spec.rb +0 -52
- data/spec/archive/zip/codec/null_encryption/encrypt/tell_spec.rb +0 -31
- data/spec/archive/zip/codec/null_encryption/encrypt/write_spec.rb +0 -31
- data/spec/archive/zip/codec/null_encryption/fixtures/classes.rb +0 -12
- data/spec/archive/zip/codec/null_encryption/fixtures/raw_file.txt +0 -10
- data/spec/archive/zip/codec/store/compress/close_spec.rb +0 -34
- data/spec/archive/zip/codec/store/compress/data_descriptor_spec.rb +0 -77
- data/spec/archive/zip/codec/store/compress/new_spec.rb +0 -16
- data/spec/archive/zip/codec/store/compress/open_spec.rb +0 -29
- data/spec/archive/zip/codec/store/compress/rewind_spec.rb +0 -28
- data/spec/archive/zip/codec/store/compress/seek_spec.rb +0 -52
- data/spec/archive/zip/codec/store/compress/tell_spec.rb +0 -31
- data/spec/archive/zip/codec/store/compress/write_spec.rb +0 -29
- data/spec/archive/zip/codec/store/decompress/close_spec.rb +0 -34
- data/spec/archive/zip/codec/store/decompress/data_descriptor_spec.rb +0 -75
- data/spec/archive/zip/codec/store/decompress/new_spec.rb +0 -16
- data/spec/archive/zip/codec/store/decompress/open_spec.rb +0 -29
- data/spec/archive/zip/codec/store/decompress/read_spec.rb +0 -26
- data/spec/archive/zip/codec/store/decompress/rewind_spec.rb +0 -27
- data/spec/archive/zip/codec/store/decompress/seek_spec.rb +0 -59
- data/spec/archive/zip/codec/store/decompress/tell_spec.rb +0 -23
- data/spec/archive/zip/codec/store/fixtures/classes.rb +0 -12
- data/spec/archive/zip/codec/store/fixtures/raw_file.txt +0 -10
- data/spec/archive/zip/codec/traditional_encryption/decrypt/close_spec.rb +0 -53
- data/spec/archive/zip/codec/traditional_encryption/decrypt/new_spec.rb +0 -20
- data/spec/archive/zip/codec/traditional_encryption/decrypt/open_spec.rb +0 -43
- data/spec/archive/zip/codec/traditional_encryption/decrypt/read_spec.rb +0 -127
- data/spec/archive/zip/codec/traditional_encryption/decrypt/rewind_spec.rb +0 -36
- data/spec/archive/zip/codec/traditional_encryption/decrypt/seek_spec.rb +0 -80
- data/spec/archive/zip/codec/traditional_encryption/decrypt/tell_spec.rb +0 -27
- data/spec/archive/zip/codec/traditional_encryption/encrypt/close_spec.rb +0 -53
- data/spec/archive/zip/codec/traditional_encryption/encrypt/new_spec.rb +0 -20
- data/spec/archive/zip/codec/traditional_encryption/encrypt/open_spec.rb +0 -41
- data/spec/archive/zip/codec/traditional_encryption/encrypt/rewind_spec.rb +0 -39
- data/spec/archive/zip/codec/traditional_encryption/encrypt/seek_spec.rb +0 -73
- data/spec/archive/zip/codec/traditional_encryption/encrypt/tell_spec.rb +0 -40
- data/spec/archive/zip/codec/traditional_encryption/encrypt/write_spec.rb +0 -114
- data/spec/archive/zip/codec/traditional_encryption/fixtures/classes.rb +0 -27
- data/spec/archive/zip/codec/traditional_encryption/fixtures/encrypted_file.bin +0 -0
- data/spec/archive/zip/codec/traditional_encryption/fixtures/raw_file.txt +0 -10
- data/spec/binary_stringio/new_spec.rb +0 -40
- data/spec/binary_stringio/set_encoding_spec.rb +0 -17
- data/spec/ioextensions/read_exactly_spec.rb +0 -52
- data/spec/zlib/fixtures/classes.rb +0 -65
- data/spec/zlib/fixtures/compressed_file.bin +0 -1
- data/spec/zlib/fixtures/compressed_file_gzip.bin +0 -0
- data/spec/zlib/fixtures/compressed_file_huffman.bin +0 -2
- data/spec/zlib/fixtures/compressed_file_minmem.bin +0 -0
- data/spec/zlib/fixtures/compressed_file_minwin.bin +0 -1
- data/spec/zlib/fixtures/compressed_file_nocomp.bin +0 -0
- data/spec/zlib/fixtures/compressed_file_raw.bin +0 -1
- data/spec/zlib/fixtures/raw_file.txt +0 -10
- data/spec/zlib/zreader/checksum_spec.rb +0 -42
- data/spec/zlib/zreader/close_spec.rb +0 -16
- data/spec/zlib/zreader/compressed_size_spec.rb +0 -20
- data/spec/zlib/zreader/new_spec.rb +0 -43
- data/spec/zlib/zreader/open_spec.rb +0 -51
- data/spec/zlib/zreader/read_spec.rb +0 -58
- data/spec/zlib/zreader/rewind_spec.rb +0 -25
- data/spec/zlib/zreader/seek_spec.rb +0 -57
- data/spec/zlib/zreader/tell_spec.rb +0 -23
- data/spec/zlib/zreader/uncompressed_size_spec.rb +0 -20
- data/spec/zlib/zwriter/checksum_spec.rb +0 -43
- data/spec/zlib/zwriter/close_spec.rb +0 -16
- data/spec/zlib/zwriter/compressed_size_spec.rb +0 -21
- data/spec/zlib/zwriter/new_spec.rb +0 -66
- data/spec/zlib/zwriter/open_spec.rb +0 -70
- data/spec/zlib/zwriter/rewind_spec.rb +0 -28
- data/spec/zlib/zwriter/seek_spec.rb +0 -52
- data/spec/zlib/zwriter/tell_spec.rb +0 -31
- data/spec/zlib/zwriter/uncompressed_size_spec.rb +0 -21
- data/spec/zlib/zwriter/write_spec.rb +0 -28
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: archive-zip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Bopp
|
8
8
|
- Akira Matsuda
|
9
9
|
- Tatsuya Sato
|
10
|
-
|
10
|
+
- Kouhei Sutou
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-05-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: io-like
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.4.0.pre1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.
|
28
|
+
version: 0.4.0.pre1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
35
|
+
version: '13.0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '13.0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: minitest
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,28 +60,28 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.9
|
63
|
+
version: '0.9'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.9
|
70
|
+
version: '0.9'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: github-markup
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
75
|
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
77
|
+
version: '3.0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - "~>"
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: '
|
84
|
+
version: '3.0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: redcarpet
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,6 +96,20 @@ dependencies:
|
|
96
96
|
- - "~>"
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '3.4'
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: simplecov
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 0.20.0
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 0.20.0
|
99
113
|
description: |
|
100
114
|
Archive::Zip provides a simple Ruby-esque interface to creating, extracting, and
|
101
115
|
updating ZIP archives. This implementation is 100% Ruby and loosely modeled on
|
@@ -105,143 +119,43 @@ email:
|
|
105
119
|
- jeremy@bopp.net
|
106
120
|
- ronnie@dio.jp
|
107
121
|
- tatsuya.b.sato@rakuten.com
|
122
|
+
- kou@clear-code.com
|
108
123
|
executables: []
|
109
124
|
extensions: []
|
110
125
|
extra_rdoc_files: []
|
111
126
|
files:
|
112
|
-
- ".yardopts"
|
113
127
|
- LICENSE
|
114
128
|
- NEWS.md
|
115
129
|
- README.md
|
116
|
-
- Rakefile
|
117
|
-
- lib/archive/support/binary_stringio.rb
|
118
|
-
- lib/archive/support/integer.rb
|
119
|
-
- lib/archive/support/io-like.rb
|
120
130
|
- lib/archive/support/ioextensions.rb
|
121
131
|
- lib/archive/support/iowindow.rb
|
122
|
-
- lib/archive/support/
|
132
|
+
- lib/archive/support/stringio.rb
|
123
133
|
- lib/archive/support/zlib.rb
|
124
134
|
- lib/archive/zip.rb
|
125
135
|
- lib/archive/zip/codec.rb
|
126
136
|
- lib/archive/zip/codec/deflate.rb
|
137
|
+
- lib/archive/zip/codec/deflate/reader.rb
|
138
|
+
- lib/archive/zip/codec/deflate/writer.rb
|
127
139
|
- lib/archive/zip/codec/null_encryption.rb
|
128
140
|
- lib/archive/zip/codec/store.rb
|
141
|
+
- lib/archive/zip/codec/store/reader.rb
|
142
|
+
- lib/archive/zip/codec/store/writer.rb
|
129
143
|
- lib/archive/zip/codec/traditional_encryption.rb
|
144
|
+
- lib/archive/zip/codec/traditional_encryption/base.rb
|
145
|
+
- lib/archive/zip/codec/traditional_encryption/reader.rb
|
146
|
+
- lib/archive/zip/codec/traditional_encryption/writer.rb
|
130
147
|
- lib/archive/zip/data_descriptor.rb
|
148
|
+
- lib/archive/zip/dos_time.rb
|
131
149
|
- lib/archive/zip/entry.rb
|
132
150
|
- lib/archive/zip/error.rb
|
133
151
|
- lib/archive/zip/extra_field.rb
|
134
152
|
- lib/archive/zip/extra_field/extended_timestamp.rb
|
135
153
|
- lib/archive/zip/extra_field/raw.rb
|
136
154
|
- lib/archive/zip/extra_field/unix.rb
|
137
|
-
- lib/archive/zip/version.rb
|
138
|
-
- spec/archive/dos_time_spec.rb
|
139
|
-
- spec/archive/zip/archive_spec.rb
|
140
|
-
- spec/archive/zip/codec/deflate/compress/checksum_spec.rb
|
141
|
-
- spec/archive/zip/codec/deflate/compress/close_spec.rb
|
142
|
-
- spec/archive/zip/codec/deflate/compress/crc32_spec.rb
|
143
|
-
- spec/archive/zip/codec/deflate/compress/data_descriptor_spec.rb
|
144
|
-
- spec/archive/zip/codec/deflate/compress/new_spec.rb
|
145
|
-
- spec/archive/zip/codec/deflate/compress/open_spec.rb
|
146
|
-
- spec/archive/zip/codec/deflate/compress/write_spec.rb
|
147
|
-
- spec/archive/zip/codec/deflate/decompress/checksum_spec.rb
|
148
|
-
- spec/archive/zip/codec/deflate/decompress/close_spec.rb
|
149
|
-
- spec/archive/zip/codec/deflate/decompress/crc32_spec.rb
|
150
|
-
- spec/archive/zip/codec/deflate/decompress/data_descriptor_spec.rb
|
151
|
-
- spec/archive/zip/codec/deflate/decompress/new_spec.rb
|
152
|
-
- spec/archive/zip/codec/deflate/decompress/open_spec.rb
|
153
|
-
- spec/archive/zip/codec/deflate/fixtures/classes.rb
|
154
|
-
- spec/archive/zip/codec/deflate/fixtures/compressed_file.bin
|
155
|
-
- spec/archive/zip/codec/deflate/fixtures/compressed_file_nocomp.bin
|
156
|
-
- spec/archive/zip/codec/deflate/fixtures/raw_file.txt
|
157
|
-
- spec/archive/zip/codec/null_encryption/decrypt/close_spec.rb
|
158
|
-
- spec/archive/zip/codec/null_encryption/decrypt/new_spec.rb
|
159
|
-
- spec/archive/zip/codec/null_encryption/decrypt/open_spec.rb
|
160
|
-
- spec/archive/zip/codec/null_encryption/decrypt/read_spec.rb
|
161
|
-
- spec/archive/zip/codec/null_encryption/decrypt/rewind_spec.rb
|
162
|
-
- spec/archive/zip/codec/null_encryption/decrypt/seek_spec.rb
|
163
|
-
- spec/archive/zip/codec/null_encryption/decrypt/tell_spec.rb
|
164
|
-
- spec/archive/zip/codec/null_encryption/encrypt/close_spec.rb
|
165
|
-
- spec/archive/zip/codec/null_encryption/encrypt/new_spec.rb
|
166
|
-
- spec/archive/zip/codec/null_encryption/encrypt/open_spec.rb
|
167
|
-
- spec/archive/zip/codec/null_encryption/encrypt/rewind_spec.rb
|
168
|
-
- spec/archive/zip/codec/null_encryption/encrypt/seek_spec.rb
|
169
|
-
- spec/archive/zip/codec/null_encryption/encrypt/tell_spec.rb
|
170
|
-
- spec/archive/zip/codec/null_encryption/encrypt/write_spec.rb
|
171
|
-
- spec/archive/zip/codec/null_encryption/fixtures/classes.rb
|
172
|
-
- spec/archive/zip/codec/null_encryption/fixtures/raw_file.txt
|
173
|
-
- spec/archive/zip/codec/store/compress/close_spec.rb
|
174
|
-
- spec/archive/zip/codec/store/compress/data_descriptor_spec.rb
|
175
|
-
- spec/archive/zip/codec/store/compress/new_spec.rb
|
176
|
-
- spec/archive/zip/codec/store/compress/open_spec.rb
|
177
|
-
- spec/archive/zip/codec/store/compress/rewind_spec.rb
|
178
|
-
- spec/archive/zip/codec/store/compress/seek_spec.rb
|
179
|
-
- spec/archive/zip/codec/store/compress/tell_spec.rb
|
180
|
-
- spec/archive/zip/codec/store/compress/write_spec.rb
|
181
|
-
- spec/archive/zip/codec/store/decompress/close_spec.rb
|
182
|
-
- spec/archive/zip/codec/store/decompress/data_descriptor_spec.rb
|
183
|
-
- spec/archive/zip/codec/store/decompress/new_spec.rb
|
184
|
-
- spec/archive/zip/codec/store/decompress/open_spec.rb
|
185
|
-
- spec/archive/zip/codec/store/decompress/read_spec.rb
|
186
|
-
- spec/archive/zip/codec/store/decompress/rewind_spec.rb
|
187
|
-
- spec/archive/zip/codec/store/decompress/seek_spec.rb
|
188
|
-
- spec/archive/zip/codec/store/decompress/tell_spec.rb
|
189
|
-
- spec/archive/zip/codec/store/fixtures/classes.rb
|
190
|
-
- spec/archive/zip/codec/store/fixtures/raw_file.txt
|
191
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/close_spec.rb
|
192
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/new_spec.rb
|
193
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/open_spec.rb
|
194
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/read_spec.rb
|
195
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/rewind_spec.rb
|
196
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/seek_spec.rb
|
197
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/tell_spec.rb
|
198
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/close_spec.rb
|
199
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/new_spec.rb
|
200
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/open_spec.rb
|
201
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/rewind_spec.rb
|
202
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/seek_spec.rb
|
203
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/tell_spec.rb
|
204
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/write_spec.rb
|
205
|
-
- spec/archive/zip/codec/traditional_encryption/fixtures/classes.rb
|
206
|
-
- spec/archive/zip/codec/traditional_encryption/fixtures/encrypted_file.bin
|
207
|
-
- spec/archive/zip/codec/traditional_encryption/fixtures/raw_file.txt
|
208
|
-
- spec/binary_stringio/new_spec.rb
|
209
|
-
- spec/binary_stringio/set_encoding_spec.rb
|
210
|
-
- spec/ioextensions/read_exactly_spec.rb
|
211
|
-
- spec/zlib/fixtures/classes.rb
|
212
|
-
- spec/zlib/fixtures/compressed_file.bin
|
213
|
-
- spec/zlib/fixtures/compressed_file_gzip.bin
|
214
|
-
- spec/zlib/fixtures/compressed_file_huffman.bin
|
215
|
-
- spec/zlib/fixtures/compressed_file_minmem.bin
|
216
|
-
- spec/zlib/fixtures/compressed_file_minwin.bin
|
217
|
-
- spec/zlib/fixtures/compressed_file_nocomp.bin
|
218
|
-
- spec/zlib/fixtures/compressed_file_raw.bin
|
219
|
-
- spec/zlib/fixtures/raw_file.txt
|
220
|
-
- spec/zlib/zreader/checksum_spec.rb
|
221
|
-
- spec/zlib/zreader/close_spec.rb
|
222
|
-
- spec/zlib/zreader/compressed_size_spec.rb
|
223
|
-
- spec/zlib/zreader/new_spec.rb
|
224
|
-
- spec/zlib/zreader/open_spec.rb
|
225
|
-
- spec/zlib/zreader/read_spec.rb
|
226
|
-
- spec/zlib/zreader/rewind_spec.rb
|
227
|
-
- spec/zlib/zreader/seek_spec.rb
|
228
|
-
- spec/zlib/zreader/tell_spec.rb
|
229
|
-
- spec/zlib/zreader/uncompressed_size_spec.rb
|
230
|
-
- spec/zlib/zwriter/checksum_spec.rb
|
231
|
-
- spec/zlib/zwriter/close_spec.rb
|
232
|
-
- spec/zlib/zwriter/compressed_size_spec.rb
|
233
|
-
- spec/zlib/zwriter/new_spec.rb
|
234
|
-
- spec/zlib/zwriter/open_spec.rb
|
235
|
-
- spec/zlib/zwriter/rewind_spec.rb
|
236
|
-
- spec/zlib/zwriter/seek_spec.rb
|
237
|
-
- spec/zlib/zwriter/tell_spec.rb
|
238
|
-
- spec/zlib/zwriter/uncompressed_size_spec.rb
|
239
|
-
- spec/zlib/zwriter/write_spec.rb
|
240
155
|
homepage: http://github.com/javanthropus/archive-zip
|
241
156
|
licenses:
|
242
157
|
- MIT
|
243
158
|
metadata: {}
|
244
|
-
post_install_message:
|
245
159
|
rdoc_options: []
|
246
160
|
require_paths:
|
247
161
|
- lib
|
@@ -256,111 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
170
|
- !ruby/object:Gem::Version
|
257
171
|
version: '0'
|
258
172
|
requirements: []
|
259
|
-
|
260
|
-
rubygems_version: 2.6.11
|
261
|
-
signing_key:
|
173
|
+
rubygems_version: 3.6.2
|
262
174
|
specification_version: 4
|
263
175
|
summary: Simple, extensible, pure Ruby ZIP archive support.
|
264
|
-
test_files:
|
265
|
-
- spec/archive/dos_time_spec.rb
|
266
|
-
- spec/archive/zip/archive_spec.rb
|
267
|
-
- spec/archive/zip/codec/deflate/compress/checksum_spec.rb
|
268
|
-
- spec/archive/zip/codec/deflate/compress/close_spec.rb
|
269
|
-
- spec/archive/zip/codec/deflate/compress/crc32_spec.rb
|
270
|
-
- spec/archive/zip/codec/deflate/compress/data_descriptor_spec.rb
|
271
|
-
- spec/archive/zip/codec/deflate/compress/new_spec.rb
|
272
|
-
- spec/archive/zip/codec/deflate/compress/open_spec.rb
|
273
|
-
- spec/archive/zip/codec/deflate/compress/write_spec.rb
|
274
|
-
- spec/archive/zip/codec/deflate/decompress/checksum_spec.rb
|
275
|
-
- spec/archive/zip/codec/deflate/decompress/close_spec.rb
|
276
|
-
- spec/archive/zip/codec/deflate/decompress/crc32_spec.rb
|
277
|
-
- spec/archive/zip/codec/deflate/decompress/data_descriptor_spec.rb
|
278
|
-
- spec/archive/zip/codec/deflate/decompress/new_spec.rb
|
279
|
-
- spec/archive/zip/codec/deflate/decompress/open_spec.rb
|
280
|
-
- spec/archive/zip/codec/deflate/fixtures/classes.rb
|
281
|
-
- spec/archive/zip/codec/deflate/fixtures/compressed_file.bin
|
282
|
-
- spec/archive/zip/codec/deflate/fixtures/compressed_file_nocomp.bin
|
283
|
-
- spec/archive/zip/codec/deflate/fixtures/raw_file.txt
|
284
|
-
- spec/archive/zip/codec/null_encryption/decrypt/close_spec.rb
|
285
|
-
- spec/archive/zip/codec/null_encryption/decrypt/new_spec.rb
|
286
|
-
- spec/archive/zip/codec/null_encryption/decrypt/open_spec.rb
|
287
|
-
- spec/archive/zip/codec/null_encryption/decrypt/read_spec.rb
|
288
|
-
- spec/archive/zip/codec/null_encryption/decrypt/rewind_spec.rb
|
289
|
-
- spec/archive/zip/codec/null_encryption/decrypt/seek_spec.rb
|
290
|
-
- spec/archive/zip/codec/null_encryption/decrypt/tell_spec.rb
|
291
|
-
- spec/archive/zip/codec/null_encryption/encrypt/close_spec.rb
|
292
|
-
- spec/archive/zip/codec/null_encryption/encrypt/new_spec.rb
|
293
|
-
- spec/archive/zip/codec/null_encryption/encrypt/open_spec.rb
|
294
|
-
- spec/archive/zip/codec/null_encryption/encrypt/rewind_spec.rb
|
295
|
-
- spec/archive/zip/codec/null_encryption/encrypt/seek_spec.rb
|
296
|
-
- spec/archive/zip/codec/null_encryption/encrypt/tell_spec.rb
|
297
|
-
- spec/archive/zip/codec/null_encryption/encrypt/write_spec.rb
|
298
|
-
- spec/archive/zip/codec/null_encryption/fixtures/classes.rb
|
299
|
-
- spec/archive/zip/codec/null_encryption/fixtures/raw_file.txt
|
300
|
-
- spec/archive/zip/codec/store/compress/close_spec.rb
|
301
|
-
- spec/archive/zip/codec/store/compress/data_descriptor_spec.rb
|
302
|
-
- spec/archive/zip/codec/store/compress/new_spec.rb
|
303
|
-
- spec/archive/zip/codec/store/compress/open_spec.rb
|
304
|
-
- spec/archive/zip/codec/store/compress/rewind_spec.rb
|
305
|
-
- spec/archive/zip/codec/store/compress/seek_spec.rb
|
306
|
-
- spec/archive/zip/codec/store/compress/tell_spec.rb
|
307
|
-
- spec/archive/zip/codec/store/compress/write_spec.rb
|
308
|
-
- spec/archive/zip/codec/store/decompress/close_spec.rb
|
309
|
-
- spec/archive/zip/codec/store/decompress/data_descriptor_spec.rb
|
310
|
-
- spec/archive/zip/codec/store/decompress/new_spec.rb
|
311
|
-
- spec/archive/zip/codec/store/decompress/open_spec.rb
|
312
|
-
- spec/archive/zip/codec/store/decompress/read_spec.rb
|
313
|
-
- spec/archive/zip/codec/store/decompress/rewind_spec.rb
|
314
|
-
- spec/archive/zip/codec/store/decompress/seek_spec.rb
|
315
|
-
- spec/archive/zip/codec/store/decompress/tell_spec.rb
|
316
|
-
- spec/archive/zip/codec/store/fixtures/classes.rb
|
317
|
-
- spec/archive/zip/codec/store/fixtures/raw_file.txt
|
318
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/close_spec.rb
|
319
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/new_spec.rb
|
320
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/open_spec.rb
|
321
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/read_spec.rb
|
322
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/rewind_spec.rb
|
323
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/seek_spec.rb
|
324
|
-
- spec/archive/zip/codec/traditional_encryption/decrypt/tell_spec.rb
|
325
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/close_spec.rb
|
326
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/new_spec.rb
|
327
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/open_spec.rb
|
328
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/rewind_spec.rb
|
329
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/seek_spec.rb
|
330
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/tell_spec.rb
|
331
|
-
- spec/archive/zip/codec/traditional_encryption/encrypt/write_spec.rb
|
332
|
-
- spec/archive/zip/codec/traditional_encryption/fixtures/classes.rb
|
333
|
-
- spec/archive/zip/codec/traditional_encryption/fixtures/encrypted_file.bin
|
334
|
-
- spec/archive/zip/codec/traditional_encryption/fixtures/raw_file.txt
|
335
|
-
- spec/binary_stringio/new_spec.rb
|
336
|
-
- spec/binary_stringio/set_encoding_spec.rb
|
337
|
-
- spec/ioextensions/read_exactly_spec.rb
|
338
|
-
- spec/zlib/fixtures/classes.rb
|
339
|
-
- spec/zlib/fixtures/compressed_file.bin
|
340
|
-
- spec/zlib/fixtures/compressed_file_gzip.bin
|
341
|
-
- spec/zlib/fixtures/compressed_file_huffman.bin
|
342
|
-
- spec/zlib/fixtures/compressed_file_minmem.bin
|
343
|
-
- spec/zlib/fixtures/compressed_file_minwin.bin
|
344
|
-
- spec/zlib/fixtures/compressed_file_nocomp.bin
|
345
|
-
- spec/zlib/fixtures/compressed_file_raw.bin
|
346
|
-
- spec/zlib/fixtures/raw_file.txt
|
347
|
-
- spec/zlib/zreader/checksum_spec.rb
|
348
|
-
- spec/zlib/zreader/close_spec.rb
|
349
|
-
- spec/zlib/zreader/compressed_size_spec.rb
|
350
|
-
- spec/zlib/zreader/new_spec.rb
|
351
|
-
- spec/zlib/zreader/open_spec.rb
|
352
|
-
- spec/zlib/zreader/read_spec.rb
|
353
|
-
- spec/zlib/zreader/rewind_spec.rb
|
354
|
-
- spec/zlib/zreader/seek_spec.rb
|
355
|
-
- spec/zlib/zreader/tell_spec.rb
|
356
|
-
- spec/zlib/zreader/uncompressed_size_spec.rb
|
357
|
-
- spec/zlib/zwriter/checksum_spec.rb
|
358
|
-
- spec/zlib/zwriter/close_spec.rb
|
359
|
-
- spec/zlib/zwriter/compressed_size_spec.rb
|
360
|
-
- spec/zlib/zwriter/new_spec.rb
|
361
|
-
- spec/zlib/zwriter/open_spec.rb
|
362
|
-
- spec/zlib/zwriter/rewind_spec.rb
|
363
|
-
- spec/zlib/zwriter/seek_spec.rb
|
364
|
-
- spec/zlib/zwriter/tell_spec.rb
|
365
|
-
- spec/zlib/zwriter/uncompressed_size_spec.rb
|
366
|
-
- spec/zlib/zwriter/write_spec.rb
|
176
|
+
test_files: []
|
data/.yardopts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--protected --private --main README.md lib/**/*.rb - NEWS.md LICENSE
|
data/Rakefile
DELETED
@@ -1,247 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# -*- ruby -*-
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
|
6
|
-
require 'erb'
|
7
|
-
require 'rake/testtask'
|
8
|
-
require 'rubygems/package_task'
|
9
|
-
require 'rake/clean'
|
10
|
-
require 'yard'
|
11
|
-
|
12
|
-
# Load the gemspec file for this project.
|
13
|
-
GEMSPEC = Dir['*.gemspec'].first
|
14
|
-
SPEC = eval(File.read(GEMSPEC), nil, GEMSPEC)
|
15
|
-
|
16
|
-
# The path to the version.rb file and a string to eval to find the version.
|
17
|
-
VERSION_RB = "lib/#{SPEC.name.gsub('-', '/')}/version.rb"
|
18
|
-
VERSION_REF =
|
19
|
-
SPEC.name.split('-').map do |subname|
|
20
|
-
subname.split('_').map(&:capitalize).join
|
21
|
-
end.join('::') + "::VERSION"
|
22
|
-
|
23
|
-
# A dynamically generated list of files that should match the manifest (the
|
24
|
-
# combined contents of SPEC.files and SPEC.test_files). The idea is for this
|
25
|
-
# list to contain all project files except for those that have been explicitly
|
26
|
-
# excluded. This list will be compared with the manifest from the SPEC in order
|
27
|
-
# to help catch the addition or removal of files to or from the project that
|
28
|
-
# have not been accounted for either by an exclusion here or an inclusion in the
|
29
|
-
# SPEC manifest.
|
30
|
-
#
|
31
|
-
# NOTE:
|
32
|
-
# It is critical that the manifest is *not* automatically generated via globbing
|
33
|
-
# and the like; otherwise, this will yield a simple comparison between
|
34
|
-
# redundantly generated lists of files that probably will not protect the
|
35
|
-
# project from the unintentional inclusion or exclusion of files in the
|
36
|
-
# distribution.
|
37
|
-
PKG_FILES = FileList.new(Dir.glob('**/*', File::FNM_DOTMATCH)) do |files|
|
38
|
-
# Exclude anything that doesn't exist as well as directories.
|
39
|
-
files.exclude {|file| ! File.exist?(file) || File.directory?(file)}
|
40
|
-
# Exclude Git administrative files.
|
41
|
-
files.exclude(%r{(^|[/\\])\.git(ignore|modules|keep)?([/\\]|$)})
|
42
|
-
# Exclude editor swap/temporary files.
|
43
|
-
files.exclude('**/.*.sw?')
|
44
|
-
# Exclude gemspec files.
|
45
|
-
files.exclude('*.gemspec')
|
46
|
-
# Exclude the README template file.
|
47
|
-
files.exclude('README.md.erb')
|
48
|
-
# Exclude resources for bundler.
|
49
|
-
files.exclude('Gemfile', 'Gemfile.lock')
|
50
|
-
files.exclude(%r{^.bundle([/\\]|$)})
|
51
|
-
files.exclude(%r{^vendor/bundle([/\\]|$)})
|
52
|
-
# Exclude generated content, except for the README file.
|
53
|
-
files.exclude(%r{^(pkg|doc|.yardoc)([/\\]|$)})
|
54
|
-
# Exclude Rubinius compiled Ruby files.
|
55
|
-
files.exclude('**/*.rbc')
|
56
|
-
files.exclude('.rbx/**/*')
|
57
|
-
end
|
58
|
-
|
59
|
-
# Make sure that :clean and :clobber will not whack the repository files.
|
60
|
-
CLEAN.exclude('.git/**')
|
61
|
-
# Vim swap files are fair game for clean up.
|
62
|
-
CLEAN.include('**/.*.sw?')
|
63
|
-
|
64
|
-
# Returns the value of the VERSION environment variable as a Gem::Version object
|
65
|
-
# assuming it is set and a valid Gem version string. Otherwise, raises an
|
66
|
-
# exception.
|
67
|
-
def get_version_argument
|
68
|
-
version = ENV['VERSION']
|
69
|
-
if version.to_s.empty?
|
70
|
-
raise "No version specified: Add VERSION=X.Y.Z to the command line"
|
71
|
-
end
|
72
|
-
begin
|
73
|
-
Gem::Version.create(version.dup)
|
74
|
-
rescue ArgumentError
|
75
|
-
raise "Invalid version specified in `VERSION=#{version}'"
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# Performs an in place, per line edit of the file indicated by _path_ by calling
|
80
|
-
# the sub method on each line and passing _pattern_, _replacement_, and _b_ as
|
81
|
-
# arguments.
|
82
|
-
def file_sub(path, pattern, replacement = nil, &b)
|
83
|
-
tmp_path = "#{path}.tmp"
|
84
|
-
File.open(path) do |infile|
|
85
|
-
File.open(tmp_path, 'w') do |outfile|
|
86
|
-
infile.each do |line|
|
87
|
-
outfile.write(line.sub(pattern, replacement, &b))
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
File.rename(tmp_path, path)
|
92
|
-
end
|
93
|
-
|
94
|
-
# Updates the version string in the gemspec file and a version.rb file it to the
|
95
|
-
# string in _version_.
|
96
|
-
def set_version(version)
|
97
|
-
file_sub(GEMSPEC, /(\.version\s*=\s*).*/, "\\1'#{version}'")
|
98
|
-
file_sub(VERSION_RB, /^(\s*VERSION\s*=\s*).*/, "\\1'#{version}'")
|
99
|
-
end
|
100
|
-
|
101
|
-
# Returns a string that is line wrapped at word boundaries, where each line is
|
102
|
-
# no longer than _line_width_ characters.
|
103
|
-
#
|
104
|
-
# This is mostly lifted directly from ActionView::Helpers::TextHelper.
|
105
|
-
def word_wrap(text, line_width = 80)
|
106
|
-
text.split("\n").collect do |line|
|
107
|
-
line.length > line_width ?
|
108
|
-
line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip :
|
109
|
-
line
|
110
|
-
end * "\n"
|
111
|
-
end
|
112
|
-
|
113
|
-
desc 'Alias for build:gem'
|
114
|
-
task :build => 'build:gem'
|
115
|
-
|
116
|
-
# Build related tasks.
|
117
|
-
namespace :build do
|
118
|
-
# Ensure that the manifest is consulted when building the gem. Any
|
119
|
-
# generated/compiled files should be available at that time.
|
120
|
-
task :gem => :check_manifest
|
121
|
-
|
122
|
-
# Create the gem and package tasks.
|
123
|
-
Gem::PackageTask.new(SPEC).define
|
124
|
-
|
125
|
-
desc 'Verify the manifest'
|
126
|
-
task :check_manifest do
|
127
|
-
manifest_files = (SPEC.files + SPEC.test_files).sort.uniq
|
128
|
-
pkg_files = PKG_FILES.sort.uniq
|
129
|
-
if manifest_files != pkg_files then
|
130
|
-
common_files = manifest_files & pkg_files
|
131
|
-
manifest_files -= common_files
|
132
|
-
pkg_files -= common_files
|
133
|
-
message = ["The manifest does not match the automatic file list."]
|
134
|
-
unless manifest_files.empty? then
|
135
|
-
message << " Extraneous files:\n " + manifest_files.join("\n ")
|
136
|
-
end
|
137
|
-
unless pkg_files.empty?
|
138
|
-
message << " Missing files:\n " + pkg_files.join("\n ")
|
139
|
-
end
|
140
|
-
raise message.join("\n")
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
# Creates the README.md file from a template, the license file and the gemspec
|
145
|
-
# contents.
|
146
|
-
file 'README.md' => ['README.md.erb', 'LICENSE', GEMSPEC] do
|
147
|
-
spec = SPEC
|
148
|
-
File.open('README.md', 'w') do |readme|
|
149
|
-
readme.write(
|
150
|
-
ERB.new(File.read('README.md.erb'), nil, '-').result(binding)
|
151
|
-
)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
# Ensure that the clobber task also clobbers package files.
|
157
|
-
task :clobber => 'build:clobber_package'
|
158
|
-
|
159
|
-
# Create the documentation task.
|
160
|
-
YARD::Rake::YardocTask.new
|
161
|
-
# Ensure that the README file is (re)generated first.
|
162
|
-
task :yard => 'README.md'
|
163
|
-
|
164
|
-
# Gem related tasks.
|
165
|
-
namespace :gem do
|
166
|
-
desc 'Alias for build:gem'
|
167
|
-
task :build => 'build:gem'
|
168
|
-
|
169
|
-
desc 'Publish the gemfile'
|
170
|
-
task :publish => ['version:check', :test, 'repo:tag', :build] do
|
171
|
-
sh "gem push pkg/#{SPEC.name}-#{SPEC.version}*.gem"
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
Rake::TestTask.new do |t|
|
176
|
-
t.pattern = 'spec/**/*_spec.rb'
|
177
|
-
end
|
178
|
-
|
179
|
-
# Version string management tasks.
|
180
|
-
namespace :version do
|
181
|
-
desc 'Set the version for the project to a specified version'
|
182
|
-
task :set do
|
183
|
-
set_version(get_version_argument)
|
184
|
-
end
|
185
|
-
|
186
|
-
desc 'Set the version for the project back to 0.0.0'
|
187
|
-
task :reset do
|
188
|
-
set_version('0.0.0')
|
189
|
-
end
|
190
|
-
|
191
|
-
desc 'Check that all version strings are correctly set'
|
192
|
-
task :check => ['version:check:spec', 'version:check:version_rb', 'version:check:news']
|
193
|
-
|
194
|
-
namespace :check do
|
195
|
-
desc 'Check that the version in the gemspec is correctly set'
|
196
|
-
task :spec do
|
197
|
-
version = get_version_argument
|
198
|
-
if version != SPEC.version
|
199
|
-
raise "The given version `#{version}' does not match the gemspec version `#{SPEC.version}'"
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
|
-
desc 'Check that the version in the version.rb file is correctly set'
|
204
|
-
task :version_rb do
|
205
|
-
version = get_version_argument
|
206
|
-
begin
|
207
|
-
load VERSION_RB
|
208
|
-
internal_version = Gem::Version.create(eval(VERSION_REF))
|
209
|
-
if version != internal_version
|
210
|
-
raise "The given version `#{version}' does not match the version.rb version `#{internal_version}'"
|
211
|
-
end
|
212
|
-
rescue ArgumentError
|
213
|
-
raise "Invalid version specified in `#{VERSION_RB}'"
|
214
|
-
end
|
215
|
-
end
|
216
|
-
|
217
|
-
desc 'Check that the NEWS.md file mentions the version'
|
218
|
-
task :news do
|
219
|
-
version = get_version_argument
|
220
|
-
begin
|
221
|
-
File.open('NEWS.md') do |news|
|
222
|
-
unless news.each_line.any? {|l| l =~ /^## v#{Regexp.escape(version.to_s)} /}
|
223
|
-
raise "The NEWS.md file does not mention version `#{version}'"
|
224
|
-
end
|
225
|
-
end
|
226
|
-
rescue Errno::ENOENT
|
227
|
-
raise 'No NEWS.md file found'
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
# Repository and workspace management tasks.
|
234
|
-
namespace :repo do
|
235
|
-
desc 'Tag the current HEAD with the version string'
|
236
|
-
task :tag => :check_workspace do
|
237
|
-
version = get_version_argument
|
238
|
-
sh "git tag -s -m 'Release v#{version}' v#{version}"
|
239
|
-
end
|
240
|
-
|
241
|
-
desc 'Ensure the workspace is fully committed and clean'
|
242
|
-
task :check_workspace => ['README.md'] do
|
243
|
-
unless `git status --untracked-files=all --porcelain`.empty?
|
244
|
-
raise 'Workspace has been modified. Commit pending changes and try again.'
|
245
|
-
end
|
246
|
-
end
|
247
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require 'stringio'
|
4
|
-
|
5
|
-
# This class is a version of StringIO that always uses the binary encoding on
|
6
|
-
# any Ruby platform that has a notion of encodings. On Ruby platforms without
|
7
|
-
# encoding support, this class is equivalent to StringIO.
|
8
|
-
class BinaryStringIO < StringIO
|
9
|
-
# Creates a new instance of this class.
|
10
|
-
#
|
11
|
-
# This takes all the arguments of StringIO.new.
|
12
|
-
def initialize(*args)
|
13
|
-
super
|
14
|
-
|
15
|
-
# Force a binary encoding when possible.
|
16
|
-
if respond_to?(:set_encoding, true)
|
17
|
-
@encoding_locked = false
|
18
|
-
set_encoding('binary')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
if instance_methods.include?(:set_encoding)
|
23
|
-
# Raise an exception on attempts to change the encoding.
|
24
|
-
def set_encoding(*args)
|
25
|
-
raise 'Changing encoding is not allowed' if @encoding_locked
|
26
|
-
@encoding_locked = true
|
27
|
-
super
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
class Integer
|
4
|
-
unless public_method_defined?('ord') then
|
5
|
-
# Returns the int itself.
|
6
|
-
#
|
7
|
-
# This method is defined here only if not already defined elsewhere, such as
|
8
|
-
# versions of Ruby prior to 1.8.7.
|
9
|
-
def ord
|
10
|
-
self
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|