zip-container 5.0.0 → 6.0.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/CHANGES.md +3 -2
- data/README.md +3 -3
- data/lib/zip-container/file.rb +15 -10
- data/lib/zip-container/util.rb +1 -1
- data/lib/zip-container/version.rb +3 -1
- data/lib/zip-container.rb +1 -0
- data/zip-container.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e69fb9eb9080e5005ca5fc86fdc0e0b969c8e8133202052f8c611d6aa464fb7
|
4
|
+
data.tar.gz: e8a0304bbb0a37b40db0723711d2273fee038a911a5e1e9807b6ea2fb6a3346a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 102ab9d00ed83fb7fb2117c72995b047fbc3325a494e2b9b6887fd4138a9513e43a7e770efd46b990344a43034df9fc4e9390834e26f58aa879dfece54ee1a93
|
7
|
+
data.tar.gz: 88192ce0b2a3c915e936ac3b0f165c91f968edf9e343829f4ad45852d9731a46c067acda5ae034775be2655fb026f101b50934a006668ee562df4692e9a59e60
|
data/CHANGES.md
CHANGED
@@ -7,8 +7,8 @@
|
|
7
7
|
* Add a code of conduct.
|
8
8
|
* Add contributing guidelines.
|
9
9
|
* Move to README.md (and update).
|
10
|
-
* Update minimum ruby version required to
|
11
|
-
* Update RubyZip version to
|
10
|
+
* Update minimum ruby version required to 3.0.
|
11
|
+
* Update RubyZip version to v3.0.
|
12
12
|
* Ensure 'managed_directory' is required at the top-level.
|
13
13
|
* Add note README about ruby and RubyZip versions.
|
14
14
|
* Apply frozen_string_literal magic comment to all files.
|
@@ -17,6 +17,7 @@
|
|
17
17
|
|
18
18
|
### Internal/tooling:
|
19
19
|
|
20
|
+
* Add Ruby 3.4 to the CI tests.
|
20
21
|
* Update Rake version.
|
21
22
|
* Update and add metadata in the gemspec.
|
22
23
|
* Just use a constant for the gem version string.
|
data/README.md
CHANGED
@@ -22,15 +22,15 @@ If you are wanting to work with UCF files in particular, there is a Ruby Gem tha
|
|
22
22
|
|
23
23
|
This library has two entry points.
|
24
24
|
|
25
|
-
The main `ZipContainer::File` class largely mimics the rubyzip [`Zip::File`](https://www.rubydoc.info/gems/rubyzip/
|
25
|
+
The main `ZipContainer::File` class largely mimics the rubyzip [`Zip::File`](https://www.rubydoc.info/gems/rubyzip/3.0.1/Zip/File) and [`Zip::FileSystem`](https://www.rubydoc.info/gems/rubyzip/3.0.1/Zip/FileSystem) APIs so much of what you can do with them are supported for ZIP Containers. There is also [API documentation](http://hainesr.github.io/ruby-zip-container/) with much more detail and any differences explained.
|
26
26
|
|
27
|
-
The `ZipContainer::Dir` class mimics, where possible, the core ruby [`Dir` API](
|
27
|
+
The `ZipContainer::Dir` class mimics, where possible, the core ruby [`Dir` API](https://rubyapi.org/3.0/o/dir).
|
28
28
|
|
29
29
|
There are some examples of how to use the library provided in the examples directory. See the contents of the tests directory for even more.
|
30
30
|
|
31
31
|
#### Versions
|
32
32
|
|
33
|
-
Version 5 of this library
|
33
|
+
Version 5 of this library was the last to support Ruby 2.7 and the last to support RubyZip 2.4. Version 6 requires at least Ruby 3.0 and RubyZip 3.0.
|
34
34
|
|
35
35
|
### What this library can not do yet
|
36
36
|
|
data/lib/zip-container/file.rb
CHANGED
@@ -66,8 +66,8 @@ module ZipContainer
|
|
66
66
|
# Here we fake up the connection to the rubyzip filesystem classes so
|
67
67
|
# that they also respect the reserved names that we define.
|
68
68
|
mapped_zip = ::Zip::FileSystem::ZipFileNameMapper.new(self)
|
69
|
-
@fs_dir = ::Zip::FileSystem::
|
70
|
-
@fs_file = ::Zip::FileSystem::
|
69
|
+
@fs_dir = ::Zip::FileSystem::Dir.new(mapped_zip)
|
70
|
+
@fs_file = ::Zip::FileSystem::File.new(mapped_zip)
|
71
71
|
@fs_dir.file = @fs_file
|
72
72
|
@fs_file.dir = @fs_dir
|
73
73
|
end
|
@@ -79,8 +79,13 @@ module ZipContainer
|
|
79
79
|
#
|
80
80
|
# Create a new ZipContainer file on disk with the specified mimetype.
|
81
81
|
def self.create(filename, mimetype)
|
82
|
-
|
83
|
-
|
82
|
+
# The mimetype file must be first in the archive, and uncompressed.
|
83
|
+
mimetype_entry = Zip::Entry.new(
|
84
|
+
nil, MIMETYPE_FILE, compression_method: Zip::Entry::STORED
|
85
|
+
)
|
86
|
+
|
87
|
+
Zip::OutputStream.open(filename) do |stream|
|
88
|
+
stream.put_next_entry(mimetype_entry)
|
84
89
|
stream.write mimetype
|
85
90
|
end
|
86
91
|
|
@@ -155,7 +160,7 @@ module ZipContainer
|
|
155
160
|
alias close commit
|
156
161
|
|
157
162
|
# :call-seq:
|
158
|
-
# dir -> Zip::
|
163
|
+
# dir -> Zip::FileSystem::Dir
|
159
164
|
#
|
160
165
|
# Returns an object which can be used like ruby's built in +Dir+ (class)
|
161
166
|
# object, except that it works on the ZipContainer file on which this
|
@@ -167,7 +172,7 @@ module ZipContainer
|
|
167
172
|
end
|
168
173
|
|
169
174
|
# :call-seq:
|
170
|
-
# file -> Zip::
|
175
|
+
# file -> Zip::FileSystem::File
|
171
176
|
#
|
172
177
|
# Returns an object which can be used like ruby's built in +File+ (class)
|
173
178
|
# object, except that it works on the ZipContainer file on which this
|
@@ -209,8 +214,8 @@ module ZipContainer
|
|
209
214
|
end
|
210
215
|
|
211
216
|
# :call-seq:
|
212
|
-
# get_output_stream(entry,
|
213
|
-
# get_output_stream(entry,
|
217
|
+
# get_output_stream(entry, permissions: nil) -> stream
|
218
|
+
# get_output_stream(entry, permissions: nil) {|stream| ...}
|
214
219
|
#
|
215
220
|
# Returns an output stream to the specified entry. If a block is passed
|
216
221
|
# the stream object is passed to the block and the stream is automatically
|
@@ -218,12 +223,12 @@ module ZipContainer
|
|
218
223
|
#
|
219
224
|
# See the rubyzip documentation for details of the +permission_int+
|
220
225
|
# parameter.
|
221
|
-
def get_output_stream(entry,
|
226
|
+
def get_output_stream(entry, permissions: nil, &block)
|
222
227
|
if reserved_entry?(entry) || managed_directory?(entry)
|
223
228
|
raise ReservedNameClashError, entry.to_s
|
224
229
|
end
|
225
230
|
|
226
|
-
@container.get_output_stream(entry,
|
231
|
+
@container.get_output_stream(entry, permissions: permissions, &block)
|
227
232
|
end
|
228
233
|
|
229
234
|
# :call-seq:
|
data/lib/zip-container/util.rb
CHANGED
data/lib/zip-container.rb
CHANGED
data/zip-container.gemspec
CHANGED
@@ -63,9 +63,9 @@ Gem::Specification.new do |s|
|
|
63
63
|
'rubygems_mfa_required' => 'true'
|
64
64
|
}
|
65
65
|
|
66
|
-
s.required_ruby_version = '>=
|
66
|
+
s.required_ruby_version = '>= 3.0'
|
67
67
|
|
68
|
-
s.add_runtime_dependency 'rubyzip', '~>
|
68
|
+
s.add_runtime_dependency 'rubyzip', '~> 3.0'
|
69
69
|
|
70
70
|
s.add_development_dependency 'minitest', '~> 5.25'
|
71
71
|
s.add_development_dependency 'os', '~> 1.1.4'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zip-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Haines
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-08-
|
12
|
+
date: 2025-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyzip
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '3.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '3.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: minitest
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,9 +205,9 @@ licenses:
|
|
205
205
|
- BSD
|
206
206
|
metadata:
|
207
207
|
bug_tracker_uri: https://github.com/hainesr/ruby-zip-container/issues
|
208
|
-
changelog_uri: https://github.com/hainesr/ruby-zip-container/blob/
|
208
|
+
changelog_uri: https://github.com/hainesr/ruby-zip-container/blob/v6.0.0/CHANGES.md
|
209
209
|
documentation_uri: https://hainesr.github.io/ruby-zip-container
|
210
|
-
source_code_uri: https://github.com/hainesr/ruby-zip-container/tree/
|
210
|
+
source_code_uri: https://github.com/hainesr/ruby-zip-container/tree/v6.0.0
|
211
211
|
rubygems_mfa_required: 'true'
|
212
212
|
post_install_message:
|
213
213
|
rdoc_options: []
|
@@ -217,7 +217,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
requirements:
|
218
218
|
- - ">="
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version: '
|
220
|
+
version: '3.0'
|
221
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
222
|
requirements:
|
223
223
|
- - ">="
|