Class: Bookbinder::Package::MP3Audiobook
- Inherits:
-
Bookbinder::Package
- Object
- Bookbinder::Package
- Bookbinder::Package::MP3Audiobook
- Defined in:
- lib/bookbinder/package/mp3_audiobook.rb
Constant Summary collapse
- DEFAULT_TRANSFORMS =
[ Bookbinder::Transform::MP3Audiobook_Rendition, Bookbinder::Transform::MP3Audiobook_Title, Bookbinder::Transform::MP3Audiobook_Creator, Bookbinder::Transform::MP3Audiobook_Description, Bookbinder::Transform::MP3Audiobook_Publisher, Bookbinder::Transform::MP3Audiobook_Subject, Bookbinder::Transform::MP3Audiobook_CoverImage, Bookbinder::Transform::MP3Audiobook_Spine, Bookbinder::Transform::MP3Audiobook_NavToc, Bookbinder::Transform::Organizer, Bookbinder::Transform::Generator ]
- MP3_EXT_RE =
/.mp3$/i
Instance Attribute Summary
Attributes inherited from Bookbinder::Package
#content_root, #file_aliases, #file_system, #map, #options, #warnings
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Bookbinder::Package
#all_book_content, #apply_transform, build, #build, #copy_to, #export, #file, #file_path, #from_map, #if_file, #import, #initialize, #read, read, require_transforms, #reset_transforms, #save_open_files, #to_map, #transforms, #warn, #write
Constructor Details
This class inherits a constructor from Bookbinder::Package
Class Method Details
.recognize(path) ⇒ Object
22 23 24 25 26 |
# File 'lib/bookbinder/package/mp3_audiobook.rb', line 22 def self.recognize(path) File.directory?(path) && Dir.glob(File.join(path, '*')).all? { |path| path.match(MP3_EXT_RE) } end |
.transforms ⇒ Object
29 30 31 |
# File 'lib/bookbinder/package/mp3_audiobook.rb', line 29 def self.transforms @transforms ||= DEFAULT_TRANSFORMS end |
Instance Method Details
#audio_paths ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/bookbinder/package/mp3_audiobook.rb', line 34 def audio_paths [].tap { |aud_paths| file_system.each { |path| aud_paths << path if path.match(MP3_EXT_RE) } aud_paths.sort! } end |