Project

ucf

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby library for working with Universal Container Format files - a type of EPUB document. See the UCF specification (https://learn.adobe.com/wiki/display/PDFNAV/Universal+Container+Format) for details. They are very similar, although not as restrictive, as the EPUB Open Container Format (OCF) (http://www.idpf.org/epub/30/spec/epub30-ocf.html).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
 Dependencies

Development

~> 1.5
~> 1.6
~> 10.4
~> 4.1
~> 3.0

Runtime

 Project Readme

Universal Container Format (UCF) Ruby Library¶ ↑

Authors

Robert Haines

Contact

support@mygrid.org.uk

Homepage

mygrid.github.io/ruby-ucf

Source code

github.com/myGrid/ruby-ucf

Licence

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

Copyright

© 2013-2015 The University of Manchester, UK

Gem Version Build Status 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.

We follow the principles of Semantic Versioning for our releases.

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.

Backwards incompatibility warning!¶ ↑

The UCF::Container class is deprecated in favour of UCF::File. These classes are functionally identical; it is just a change of name. The new name brings this API into closer alignment with the underlying zip-container API (ZipContainer::File).

UCF::Container is not available from version 1.0.0 onwards.

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.

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.

  • Memory resident UCF documents. Presently all operations are performed on documents that are resident on disk as the underlying rubyzip library currently cannot do anything else.

  • 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).