Class: EpubTools::XHTMLExtractor
- Inherits:
-
Object
- Object
- EpubTools::XHTMLExtractor
- Defined in:
- lib/epub_tools/xhtml_extractor.rb
Overview
Extracts .xhtml files from EPUB archives, excluding nav.xhtml
Instance Method Summary collapse
- #extract_all ⇒ Object
-
#initialize(source_dir:, target_dir:, verbose: false) ⇒ XHTMLExtractor
constructor
A new instance of XHTMLExtractor.
Constructor Details
#initialize(source_dir:, target_dir:, verbose: false) ⇒ XHTMLExtractor
Returns a new instance of XHTMLExtractor.
7 8 9 10 11 12 |
# File 'lib/epub_tools/xhtml_extractor.rb', line 7 def initialize(source_dir:, target_dir:, verbose: false) @source_dir = File.(source_dir) @target_dir = File.(target_dir) @verbose = verbose FileUtils.mkdir_p(@target_dir) end |
Instance Method Details
#extract_all ⇒ Object
14 15 16 17 18 |
# File 'lib/epub_tools/xhtml_extractor.rb', line 14 def extract_all epub_files.each do |epub_path| extract_xhtmls_from(epub_path) end end |