Sha256: 89e8659cd054fbf9d726c8c2969edcdcf38b06251348e07b235142a8b6b2d763
Contents?: true
Size: 812 Bytes
Versions: 20
Compression:
Stored size: 812 Bytes
Contents
module Softcover module Commands module EpubValidator extend Softcover::Utils extend self # Validates a book according to the EPUB standard. def validate! manifest = BookManifest.new(source: source) epub = path("ebooks/#{manifest.filename}.epub") if File.exist?(epub) puts "Validating EPUB..." system("#{java} -jar #{epubcheck} --locale en -w #{epub}") else puts "File '#{epub}' not found" puts "Run 'softcover build:epub' to generate" exit 1 end end private def java @java ||= executable(dependency_filename(:java)) end def epubcheck @epubcheck ||= executable(dependency_filename(:epubcheck)).inspect end end end end
Version data entries
20 entries across 20 versions & 1 rubygems