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

Version Path
softcover-1.6.2 lib/softcover/commands/epub_validator.rb
softcover-1.6.1 lib/softcover/commands/epub_validator.rb
softcover-1.6.0 lib/softcover/commands/epub_validator.rb
softcover-1.5.11 lib/softcover/commands/epub_validator.rb
softcover-1.5.10 lib/softcover/commands/epub_validator.rb
softcover-1.5.9 lib/softcover/commands/epub_validator.rb
softcover-1.5.8 lib/softcover/commands/epub_validator.rb
softcover-1.5.7 lib/softcover/commands/epub_validator.rb
softcover-1.5.6 lib/softcover/commands/epub_validator.rb
softcover-1.5.5 lib/softcover/commands/epub_validator.rb
softcover-1.5.4 lib/softcover/commands/epub_validator.rb
softcover-1.5.3 lib/softcover/commands/epub_validator.rb
softcover-1.5.2 lib/softcover/commands/epub_validator.rb
softcover-1.5.1 lib/softcover/commands/epub_validator.rb
softcover-1.5.0 lib/softcover/commands/epub_validator.rb
softcover-1.4.9 lib/softcover/commands/epub_validator.rb
softcover-1.4.8 lib/softcover/commands/epub_validator.rb
softcover-1.4.7 lib/softcover/commands/epub_validator.rb
softcover-1.4.6 lib/softcover/commands/epub_validator.rb
softcover-1.4.5 lib/softcover/commands/epub_validator.rb