Class: EpubTools::AddChaptersToEpub
- Inherits:
-
Object
- Object
- EpubTools::AddChaptersToEpub
- Defined in:
- lib/epub_tools/add_chapters_to_epub.rb
Instance Method Summary collapse
-
#initialize(chapters_dir = './chapters', epub_dir = './epub/OEBPS', verbose = false) ⇒ AddChaptersToEpub
constructor
A new instance of AddChaptersToEpub.
- #run ⇒ Object
Constructor Details
#initialize(chapters_dir = './chapters', epub_dir = './epub/OEBPS', verbose = false) ⇒ AddChaptersToEpub
Returns a new instance of AddChaptersToEpub.
7 8 9 10 11 12 13 |
# File 'lib/epub_tools/add_chapters_to_epub.rb', line 7 def initialize(chapters_dir = './chapters', epub_dir = './epub/OEBPS', verbose = false) @chapters_dir = chapters_dir @epub_dir = epub_dir @opf_file = File.join(@epub_dir, 'package.opf') @nav_file = File.join(@epub_dir, 'nav.xhtml') @verbose = verbose end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 |
# File 'lib/epub_tools/add_chapters_to_epub.rb', line 15 def run moved_files = move_chapters update_package_opf(moved_files) update_nav_xhtml(moved_files) @verbose ? moved_files.each {|f| puts "Moved: #{f}"} : moved_files end |