Class: BitClust::Generators::EPUB

Inherits:
Object
  • Object
show all
Defined in:
lib/bitclust/generators/epub.rb

Constant Summary collapse

CONTENTS_DIR_NAME =
'OEBPS'

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ EPUB

Returns a new instance of EPUB.


10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bitclust/generators/epub.rb', line 10

def initialize(options = {})
  @options = options.dup
  @prefix           = options[:prefix]
  @capi             = options[:capi]
  @outputdir        = options[:outputdir]
  @filename         = options[:filename]
  @templatedir      = options[:templatedir]
  @catalog          = options[:catalog]
  @themedir         = options[:themedir]
  @fs_casesensitive = options[:fs_casesensitive]
  @keep             = options[:keep]
  @verbose          = options[:verbose]
end

Instance Method Details

#generateObject


26
27
28
29
30
31
32
33
34
# File 'lib/bitclust/generators/epub.rb', line 26

def generate
  make_epub_directory do |epub_directory|
    contents_directory = epub_directory + CONTENTS_DIR_NAME
    copy_static_files(epub_directory)
    generate_xhtml_files(contents_directory)
    generate_contents_opf(epub_directory)
    pack_epub(epub_directory)
  end
end