Sha256: f962f613534d0f59b99cdb9f29251a9dfe91a1f7bb8551c75b587657c2d8ff87
Contents?: true
Size: 962 Bytes
Versions: 24
Compression:
Stored size: 962 Bytes
Contents
module Softcover module Commands module EpubValidator extend Softcover::Utils extend self # Validates a book according to the EPUB standard. def validate! epub = Dir.glob('ebooks/*.epub').first puts "Validating EPUB..." system("#{java} -jar #{epubcheck} #{epub}") end private def java filename = `which java`.chomp url = 'http://www.java.com/en/download/help/index_installing.xml' message = "Install Java (#{url})" @java ||= executable(filename, message) end def epubcheck filename = File.join(Dir.home, 'epubcheck-3.0', 'epubcheck-3.0.jar') url = 'https://github.com/IDPF/epubcheck/releases/download/v3.0/epubcheck-3.0.zip' message = "Download EpubCheck 3.0 (#{url}) and unzip it in your home directory" @epubcheck ||= executable(filename, message).inspect end end end end
Version data entries
24 entries across 24 versions & 1 rubygems