Class: Softcover::Builders::Mobi

Inherits:
Softcover::Builder show all
Defined in:
lib/softcover/builders/mobi.rb

Constant Summary

Constants included from Utils

Utils::UNITS

Instance Attribute Summary

Attributes inherited from Softcover::Builder

#built_files, #manifest

Instance Method Summary collapse

Methods inherited from Softcover::Builder

#clean!, #initialize

Methods included from Utils

#add_highlight_class!, #as_size, #current_book, #digest, #executable, #execute, #in_book_directory?, #logged_in?, #mkdir, #path, #reset_current_book!, #rm, #silence, #source, #tmpify, #write_pygments_file

Constructor Details

This class inherits a constructor from Softcover::Builder

Instance Method Details

#build!(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/softcover/builders/mobi.rb', line 5

def build!(options={})
  Softcover::Builders::Epub.new.build!(options)
  filename  = manifest.filename
  filename += '-preview' if options[:preview]
  command = "#{kindlegen} ebooks/#{filename}.epub"
  # Because of the way kindlegen uses tempfiles, testing for the
  # actual generation of the MOBI causes an error, so in tests
  # we just return the command.
  if options[:quiet] || options[:silent]
    silence { Softcover.test? ? command : system(command) }
  else
    Softcover.test? ? command : system(command)
  end
end