zip-container 5.0.0.rc2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d56e4e0c34e786a2c40592c5162bd45ca4cb642e43a78af15d06a8ce0c6aa827
4
- data.tar.gz: 67fe6c6ad79a1d462ad54496c27f80607d0eb5e92f31a8468a01129ced633d58
3
+ metadata.gz: 8e69fb9eb9080e5005ca5fc86fdc0e0b969c8e8133202052f8c611d6aa464fb7
4
+ data.tar.gz: e8a0304bbb0a37b40db0723711d2273fee038a911a5e1e9807b6ea2fb6a3346a
5
5
  SHA512:
6
- metadata.gz: 64bd83f999efa1b885b99d3a29f01aea5cf078cf4d5ce3d232cf0dbe342e61602c5fb8339af87e9f57d41c4e7e13bf64359889389cbc38a87d3d242f67079f28
7
- data.tar.gz: e70fb9bfb934c24148b3ec88b1c6a9665ed760e2f5bfc6325c6231704e4538ce4214f9fa85ceb32515b6f9ddbb0e40a787cdda7f2a127c123d11b1ace3d55376
6
+ metadata.gz: 102ab9d00ed83fb7fb2117c72995b047fbc3325a494e2b9b6887fd4138a9513e43a7e770efd46b990344a43034df9fc4e9390834e26f58aa879dfece54ee1a93
7
+ data.tar.gz: 88192ce0b2a3c915e936ac3b0f165c91f968edf9e343829f4ad45852d9731a46c067acda5ae034775be2655fb026f101b50934a006668ee562df4692e9a59e60
data/CHANGES.md CHANGED
@@ -7,14 +7,17 @@
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 2.7.
11
- * Update RubyZip version to v2.4.
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.
15
+ * Update OCF references in README and gemspec.
16
+ * Add a CITATION.cff file.
15
17
 
16
18
  ### Internal/tooling:
17
19
 
20
+ * Add Ruby 3.4 to the CI tests.
18
21
  * Update Rake version.
19
22
  * Update and add metadata in the gemspec.
20
23
  * Just use a constant for the gem version string.
@@ -26,6 +29,8 @@
26
29
  * Skip certain tests in non-POSIX environments.
27
30
  * Fix managed directory test on Windows.
28
31
  * Ensure simplecov is required first with MiniTest.
32
+ * Add an Action to build the latest documentation.
33
+ * Set Rubocop output to use GitHub format.
29
34
 
30
35
  ## Version 4.0.2
31
36
 
data/CITATION.cff ADDED
@@ -0,0 +1,54 @@
1
+ # This CITATION.cff file was created by ruby-cff (v 1.3.0).
2
+ # Gem: https://rubygems.org/gems/cff
3
+ # CFF: https://citation-file-format.github.io/
4
+
5
+ cff-version: 1.2.0
6
+ title: Ruby Zip Container
7
+ message: If you use Ruby Zip Container in your work, please cite it using the following metadata
8
+ type: software
9
+ authors:
10
+ - given-names: Robert
11
+ family-names: Haines
12
+ affiliation: The University of Manchester
13
+ orcid: https://orcid.org/0000-0002-9538-7919
14
+ - given-names: Finn
15
+ family-names: Bacall
16
+ affiliation: The University of Manchester
17
+ repository-code: https://github.com/hainesr/ruby-zip-container
18
+ url: https://hainesr.github.io/ruby-zip-container/
19
+ repository-artifact: https://rubygems.org/gems/zip-container
20
+ abstract: A Ruby library for working with ZIP Container Format files.
21
+ keywords:
22
+ - ruby
23
+ - zip
24
+ - EPUB
25
+ - OCF
26
+ - zip-container
27
+ license: BSD-3-Clause
28
+ references:
29
+ - title: EPUB Open Container Format (OCF) 3.0
30
+ authors:
31
+ - name: International Digital Publishing Forum (IDPF)
32
+ editors:
33
+ - given-names: James
34
+ family-names: Pritchett
35
+ - given-names: Markus
36
+ family-names: Gylling
37
+ affiliation: DAISY Consortium
38
+ type: standard
39
+ url: https://idpf.org/epub/30/spec/epub30-ocf.html
40
+ - title: EPUB 3.3 - Open Container Format (OCF)
41
+ authors:
42
+ - name: W3C
43
+ editors:
44
+ - given-names: Matt
45
+ family-names: Garrish
46
+ affiliation: DAISY Consortium
47
+ - given-names: Ivan
48
+ family-names: Herman
49
+ affiliation: W3C
50
+ orcid: https://orcid.org/0000-0003-0782-2704
51
+ - given-names: Dave
52
+ family-names: Cramer
53
+ type: standard
54
+ url: https://www.w3.org/TR/epub-33/#sec-ocf
data/README.md CHANGED
@@ -12,7 +12,7 @@ A Ruby library for creating, editing and validating ZIP Container files.
12
12
 
13
13
  ### Synopsis
14
14
 
15
- This is a Ruby library for working with ZIP Container files. See the [ODF](http://www.idpf.org/epub/30/spec/epub30-ocf.html) and [UCF](https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format) specifications for more details.
15
+ This is a Ruby library for working with ZIP Container files. See the OCF [[1](http://www.idpf.org/epub/30/spec/epub30-ocf.html), [2](https://www.w3.org/TR/epub-33/#sec-ocf)] and UCF [[3](https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format)] specifications for more details.
16
16
 
17
17
  If you are wanting to work with UCF files in particular, there is a Ruby Gem that builds on this one specifically for that. Please see:
18
18
  * [GitHub](https://github.com/hainesr/ruby-ucf)
@@ -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/2.4.1/Zip/File) and [`Zip::FileSystem`](https://www.rubydoc.info/gems/rubyzip/2.4.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.
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](http://ruby-doc.org/core-1.9.3/Dir.html).
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 will be the last to support Ruby 2.7 and the last to support RubyZip 2.4. Version 6 will require at least Ruby 3.0 and RubyZip 3.0.
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
 
@@ -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::ZipFsDir.new(mapped_zip)
70
- @fs_file = ::Zip::FileSystem::ZipFsFile.new(mapped_zip)
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
- ::Zip::OutputStream.open(filename) do |stream|
83
- stream.put_next_entry(MIMETYPE_FILE, nil, nil, ::Zip::Entry::STORED)
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::ZipFsDir
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::ZipFsFile
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, permission = nil) -> stream
213
- # get_output_stream(entry, permission = nil) {|stream| ...}
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, permission = nil, &block)
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, permission, &block)
231
+ @container.get_output_stream(entry, permissions: permissions, &block)
227
232
  end
228
233
 
229
234
  # :call-seq:
@@ -32,7 +32,7 @@
32
32
  #
33
33
  # Author: Robert Haines
34
34
 
35
- require 'zip' # Remove this when we update to rubyzip 3.x.
35
+ require 'zip' # Remove this when rubyzip fixes its require tree.
36
36
  require 'zip/entry'
37
37
 
38
38
  ##
@@ -32,6 +32,8 @@
32
32
  #
33
33
  # Author: Robert Haines
34
34
 
35
+ ##
35
36
  module ZipContainer
36
- VERSION = '5.0.0.rc2' # :nodoc:
37
+ # The current version of the ZipContainer library.
38
+ VERSION = '6.0.0'
37
39
  end
data/lib/zip-container.rb CHANGED
@@ -32,6 +32,7 @@
32
32
  #
33
33
  # Author: Robert Haines
34
34
 
35
+ require_relative 'zip-container/version'
35
36
  require_relative 'zip-container/file'
36
37
  require_relative 'zip-container/dir'
37
38
  require_relative 'zip-container/managed_directory'
@@ -44,8 +44,8 @@ Gem::Specification.new do |s|
44
44
  s.summary = 'A ZIP Container for use by OCF and UCF implementations'
45
45
  s.description =
46
46
  'A Ruby library for working with ZIP Container ' \
47
- 'Format files. See http://www.idpf.org/epub/30/spec/epub30-ocf.html for ' \
48
- 'the OCF specification and ' \
47
+ 'Format files. See http://www.idpf.org/epub/30/spec/epub30-ocf.html and ' \
48
+ 'https://www.w3.org/TR/epub-33/#sec-ocf for the OCF specification and ' \
49
49
  'https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format ' \
50
50
  'for the UCF specification.'
51
51
  s.license = 'BSD'
@@ -63,9 +63,9 @@ Gem::Specification.new do |s|
63
63
  'rubygems_mfa_required' => 'true'
64
64
  }
65
65
 
66
- s.required_ruby_version = '>= 2.7'
66
+ s.required_ruby_version = '>= 3.0'
67
67
 
68
- s.add_runtime_dependency 'rubyzip', '~> 2.4'
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: 5.0.0.rc2
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-02-15 00:00:00.000000000 Z
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: '2.4'
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: '2.4'
27
+ version: '3.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: minitest
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -166,7 +166,7 @@ dependencies:
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0.8'
168
168
  description: A Ruby library for working with ZIP Container Format files. See http://www.idpf.org/epub/30/spec/epub30-ocf.html
169
- for the OCF specification and https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format
169
+ and https://www.w3.org/TR/epub-33/#sec-ocf for the OCF specification and https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format
170
170
  for the UCF specification.
171
171
  email:
172
172
  - robert.haines@manchester.ac.uk
@@ -175,6 +175,7 @@ extensions: []
175
175
  extra_rdoc_files: []
176
176
  files:
177
177
  - CHANGES.md
178
+ - CITATION.cff
178
179
  - CODE_OF_CONDUCT.md
179
180
  - CONTRIBUTING.md
180
181
  - Gemfile
@@ -204,9 +205,9 @@ licenses:
204
205
  - BSD
205
206
  metadata:
206
207
  bug_tracker_uri: https://github.com/hainesr/ruby-zip-container/issues
207
- changelog_uri: https://github.com/hainesr/ruby-zip-container/blob/v5.0.0.rc2/CHANGES.md
208
+ changelog_uri: https://github.com/hainesr/ruby-zip-container/blob/v6.0.0/CHANGES.md
208
209
  documentation_uri: https://hainesr.github.io/ruby-zip-container
209
- source_code_uri: https://github.com/hainesr/ruby-zip-container/tree/v5.0.0.rc2
210
+ source_code_uri: https://github.com/hainesr/ruby-zip-container/tree/v6.0.0
210
211
  rubygems_mfa_required: 'true'
211
212
  post_install_message:
212
213
  rdoc_options: []
@@ -216,12 +217,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
216
217
  requirements:
217
218
  - - ">="
218
219
  - !ruby/object:Gem::Version
219
- version: '2.7'
220
+ version: '3.0'
220
221
  required_rubygems_version: !ruby/object:Gem::Requirement
221
222
  requirements:
222
- - - ">"
223
+ - - ">="
223
224
  - !ruby/object:Gem::Version
224
- version: 1.3.1
225
+ version: '0'
225
226
  requirements: []
226
227
  rubygems_version: 3.4.1
227
228
  signing_key: