0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
EPUB Validator is a Ruby wrapper for the Java epubcheck tool; validating EPUB files against the IDPF standard.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.14.1, ~> 2.14
 Project Readme

[INACTIVE] epubValidator

Check if your EPUB eBooks are valid

Later releases of epubCheck are much more friendly to use, which means the usefulness of this GEM has diminished and so is no longer maintained. I recommend you now use the official epubCheck tool.

====

This library will check that your .epub files are valid IDPF EPUB documents (version 2.x and 3.0) and return a successful or error message. It can be called as a Ruby library, or invoked from the command line.

For more about the IDPF see http://idpf.org

For more about the epubcheck tool see http://code.google.com/p/epubcheck/

Setup

gem install epub_validator

Basic Usage

Sample usage and output:

require 'epub_validator'

epub = EpubValidator.check('/path/to/sample.epub')

puts "Invalid!" unless epub.valid?
epub.messages.each do |m|
  puts m
end
=> Invalid!
=> ERROR: OPS/toc.ncx(21): 'OPS/': referenced resource exists, but not declared in the OPF file

Now from the command line:

$ epub_validator /path/to/sample.epub

Checking....FAILED!

This is not a valid EPUB 3.0 ebook.

ERROR: OPS/toc.ncx(21): 'OPS/': referenced resource exists, but not declared in the OPF file

Requirements

Java must be installed and set in your PATH.

Future Features

  • Command line: accept directory containing many .epub files for processing.
  • Command line: have switch for writing results to log file
  • Format "ERROR" and "WARNING" output for more intuitive instructions.