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.2.4 lib/softcover/commands/epub_validator.rb
softcover-1.2.3 lib/softcover/commands/epub_validator.rb
softcover-1.2.2 lib/softcover/commands/epub_validator.rb
softcover-1.2.1 lib/softcover/commands/epub_validator.rb
softcover-1.2.0 lib/softcover/commands/epub_validator.rb
softcover-1.1.28 lib/softcover/commands/epub_validator.rb
softcover-1.1.27 lib/softcover/commands/epub_validator.rb
softcover-1.1.23 lib/softcover/commands/epub_validator.rb
softcover-1.1.22 lib/softcover/commands/epub_validator.rb
softcover-1.1.21 lib/softcover/commands/epub_validator.rb
softcover-1.1.20 lib/softcover/commands/epub_validator.rb
softcover-1.1.19 lib/softcover/commands/epub_validator.rb
softcover-1.1.18 lib/softcover/commands/epub_validator.rb
softcover-1.1.17 lib/softcover/commands/epub_validator.rb
softcover-1.1.16 lib/softcover/commands/epub_validator.rb
softcover-1.1.15 lib/softcover/commands/epub_validator.rb
softcover-1.1.14 lib/softcover/commands/epub_validator.rb
softcover-1.1.13 lib/softcover/commands/epub_validator.rb
softcover-1.1.12 lib/softcover/commands/epub_validator.rb
softcover-1.1.11 lib/softcover/commands/epub_validator.rb