Socket
Book a DemoInstallSign in
Socket

ucf

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ucf

3.0.0
bundlerRubygems
Version published
Maintainers
2
Created
Source

Universal Container Format (UCF) Ruby Library

Robert Haines

A Ruby library for creating, editing and validating UCF files.

Gem Version Tests Linter Ruby Style Guide Maintainability Coverage Status

Synopsis

This is a Ruby library for working with UCF documents. See the specification for more details. UCF is a type of EPUB and very similar to the EPUB Open Container Format (OCF).

Most of this library's API is provided by the underlying zip-container gem so you will need to consult that documentation as well in addition to this.

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.

Usage

This library has two entry points.

The main UCF::File class is a specialization of ZipContainer::File which largely mimics the rubyzip Zip::File and Zip::FileSystem APIs.

The UCF::Dir class is a based upon the ZipContainer::Dir class which mimics, where possible, the core ruby Dir API.

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.

Files in the META-INF directory

The UCF specification requires that files in the META-INF directory are validated against a schema if they are present. If the nokogiri gem is available then this library will use it to validate the contents of the container.xml and manifest.xml files. This functionality is not enforced on the user in case they are not using the META-INF directory and so would not need the extra dependency on nokogiri.

Ruby version requirements and nokogiri

When used on its own the UCF library requires Ruby version >=3.0, however, if you are using nokogiri for schema validation then you need to use Ruby version >=3.1 to satisfy its version constraints.

What this library can not do yet

The basic requirements of a UCF document are all implemented but there are a number of optional features that are not yet provided.

  • Validation of all file contents in the META-INF directory. The container.xml and manifest.xml files are validated but others are not yet.
  • Digital signatures (this feature has been deferred until a future revision of the UCF specification. It will be supported by this gem when it is added to the specification).
  • Encryption (this feature has been deferred until a future revision of the UCF specification. It will be supported by this gem when it is added to the specification).

Library versions

From version 1.0.0 onwards, the principles of semantic versioning are applied when numbering releases with new features or breaking changes.

Developing Ruby UCF

Please see our Code of Conduct and our contributor guidelines.

Licence

BSD (See LICENCE file or http://www.opensource.org/licenses/bsd-license.php).

FAQs

Package last updated on 10 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.