Module: Softcover::Commands::EpubValidator

Extended by:
EpubValidator, Utils
Included in:
EpubValidator
Defined in:
lib/softcover/commands/epub_validator.rb

Constant Summary

Constants included from Utils

Utils::UNITS

Instance Method Summary collapse

Methods included from Utils

add_highlight_class!, article?, as_size, book_file_lines, chapter_label, commands, current_book, dependency_filename, digest, executable, execute, filename_or_default, first_path, get_filename, html_extension, in_book_directory?, language_labels, linux?, logged_in?, master_content, master_filename, master_latex_header, mkdir, non_comment_lines, os_x?, path, polytexnic_html, raw_lines, reset_current_book!, rm, rm_r, silence, silence_stream, source, template_dir, tmpify, unpublish_slug, write_master_latex_file, write_pygments_file

Instance Method Details

#validate!Object

Validates a book according to the EPUB standard.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/softcover/commands/epub_validator.rb', line 8

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