Module: Softcover::Commands::Build
Instance Method Summary collapse
-
#all_formats(options = {}) ⇒ Object
Builds the book for all formats.
-
#builder_for(format) ⇒ Object
Returns the builder for the given format.
-
#for_format(format, options = {}) ⇒ Object
Builds the book for the given format.
-
#preview(options = {}) ⇒ Object
Builds the book preview.
Methods included from Output
should_output?, silence!, silent?, #system, unsilence!
Instance Method Details
#all_formats(options = {}) ⇒ Object
Builds the book for all formats.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/softcover/commands/build.rb', line 18 def all_formats(={}) ('all formats', ) Softcover::BUILD_ALL_FORMATS.each do |format| if format == 'mobi' ('EPUB & MOBI', ) else (format.upcase, ) end builder_for(format).build!() end end |
#builder_for(format) ⇒ Object
Returns the builder for the given format.
37 38 39 |
# File 'lib/softcover/commands/build.rb', line 37 def builder_for(format) "Softcover::Builders::#{format.titleize}".constantize.new end |
#for_format(format, options = {}) ⇒ Object
Builds the book for the given format.
8 9 10 11 12 13 14 15 |
# File 'lib/softcover/commands/build.rb', line 8 def for_format(format, ={}) raise 'Invalid format' unless Softcover::FORMATS.include?(format) (format.upcase, ) builder_for(format).build!() if format == 'html' && !([:silent] || [:quiet]) puts "LaTeX-to-XML debug information output to log/tralics.log" end end |
#preview(options = {}) ⇒ Object
Builds the book preview.
31 32 33 34 |
# File 'lib/softcover/commands/build.rb', line 31 def preview(={}) ('preview', ) builder_for('preview').build! end |