Sha256: 52d3cc29186d3ac0f3c189a6d98760da1ed737c8f52e34e2410d2b4ec1da9f16
Contents?: true
Size: 511 Bytes
Versions: 21
Compression:
Stored size: 511 Bytes
Contents
require 'fileutils' def epub! out = _format(@_args[0]) src = @_args[1] @cover = @_args[2] if ::File.directory?(src) files = ::Dir["#{src}/*"].grep /\.html$/ cmd = "cat #{files.join(' ')} >TEMP.html" system(cmd) else raise "Not supported yet" end cmd = "ebook-convert " cmd << "TEMP.html #{out}.epub " cmd << "--cover #@cover " if @cover system(cmd) str = `links -dump TEMP.html | wc -w` nw = str.split[0] puts "Approx words: #{nw}" ::FileUtils.rm("TEMP.html") end
Version data entries
21 entries across 21 versions & 1 rubygems