Sha256: da33bad77891f759a429628a2f32cfd22c4bd38e4954df3d484384f2a9e4b4c1
Contents?: true
Size: 797 Bytes
Versions: 97
Compression:
Stored size: 797 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} #{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
97 entries across 97 versions & 2 rubygems