Class: Softcover::Builders::Mobi
- Inherits:
-
Softcover::Builder
- Object
- Softcover::Builder
- Softcover::Builders::Mobi
- Defined in:
- lib/softcover/builders/mobi.rb
Constant Summary
Constants included from Utils
Instance Attribute Summary
Attributes inherited from Softcover::Builder
Instance Method Summary collapse
- #build!(options = {}) ⇒ Object
-
#mobi_command(filename, options = {}) ⇒ Object
Returns the command for making a MOBI, based on the options.
-
#mobi_filename(options = {}) ⇒ Object
Returns the filename of the MOBI (preview if necessary).
Methods included from EpubUtils
#content_opf_template, #cover?, #cover_filename, #cover_img, #cover_img_path, #escape, #images_dir, #nav_filename, #nav_html_template, #toc_ncx_template, #xhtml
Methods included from Utils
#add_highlight_class!, #article?, #as_size, #book_file_lines, #chapter_label, #commands, #current_book, #dependency_filename, #digest, #executable, #execute, #filename_or_default, #first_path, #get_filename, #html_extension, #in_book_directory?, #language_labels, #linux?, #logged_in?, #master_content, #master_filename, #master_latex_header, #mkdir, #non_comment_lines, #os_x?, #path, #polytexnic_html, #raw_lines, #reset_current_book!, #rm, #rm_r, #silence, #silence_stream, #source, #template_dir, #tmpify, #unpublish_slug, #write_master_latex_file, #write_pygments_file
Methods inherited from Softcover::Builder
Constructor Details
This class inherits a constructor from Softcover::Builder
Instance Method Details
#build!(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/softcover/builders/mobi.rb', line 7 def build!(={}) Softcover::Builders::Epub.new.build!() filename = mobi_filename() command = mobi_command(filename, ) silent = [:silent] || Softcover.test? if [:quiet] || silent silence { system(command) } else system(command) end end |
#mobi_command(filename, options = {}) ⇒ Object
Returns the command for making a MOBI, based on the options.
25 26 27 28 29 30 31 |
# File 'lib/softcover/builders/mobi.rb', line 25 def mobi_command(filename, ={}) silent = [:silent] || Softcover.test? cmd = "#{calibre} ebooks/#{filename}.epub ebooks/#{filename}.mobi" + " #{}" puts cmd unless ([:quiet] || silent) cmd end |
#mobi_filename(options = {}) ⇒ Object
Returns the filename of the MOBI (preview if necessary).
20 21 22 |
# File 'lib/softcover/builders/mobi.rb', line 20 def mobi_filename(={}) [:preview] ? manifest.filename + '-preview' : manifest.filename end |