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.1.10 lib/softcover/commands/epub_validator.rb
softcover-1.1.9 lib/softcover/commands/epub_validator.rb
softcover-1.1.8 lib/softcover/commands/epub_validator.rb
softcover-1.1.7 lib/softcover/commands/epub_validator.rb
softcover-1.1.6 lib/softcover/commands/epub_validator.rb
softcover-1.1.4 lib/softcover/commands/epub_validator.rb
softcover-1.1.3 lib/softcover/commands/epub_validator.rb
softcover-1.1.2 lib/softcover/commands/epub_validator.rb
softcover-1.1.1 lib/softcover/commands/epub_validator.rb
softcover-1.1.0 lib/softcover/commands/epub_validator.rb
softcover-1.1.beta2 lib/softcover/commands/epub_validator.rb
softcover-1.0.5 lib/softcover/commands/epub_validator.rb
softcover-1.1.beta1 lib/softcover/commands/epub_validator.rb
softcover-1.0.4 lib/softcover/commands/epub_validator.rb
softcover-1.0.3 lib/softcover/commands/epub_validator.rb
softcover-1.0.2 lib/softcover/commands/epub_validator.rb
softcover-1.0.1 lib/softcover/commands/epub_validator.rb
softcover-1.0.0 lib/softcover/commands/epub_validator.rb
softcover-1.0.beta17 lib/softcover/commands/epub_validator.rb
softcover-1.0.beta16 lib/softcover/commands/epub_validator.rb