Sha256: 9a026a41cc4486ce70beeff05c174bde8e6262d194c83c5178acdcfb8fbcb824
Contents?: true
Size: 521 Bytes
Versions: 15
Compression:
Stored size: 521 Bytes
Contents
require 'fileutils' def epub! out = _var_substitution(@_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
15 entries across 15 versions & 1 rubygems