Class: ComicBook::CB
- Defined in:
- lib/comic_book/cb.rb,
lib/comic_book/cb/archiver.rb,
lib/comic_book/cb/extractor.rb
Defined Under Namespace
Instance Method Summary collapse
- #archive(options = {}) ⇒ Object
-
#entries ⇒ Object
Every file in the folder, as Entries with folder-relative paths.
- #extract(_options = {}) ⇒ Object
- #info ⇒ Object
Methods inherited from Adapter
#images, #images_and_info, #initialize, #pages
Constructor Details
This class inherits a constructor from ComicBook::Adapter
Instance Method Details
#archive(options = {}) ⇒ Object
8 9 10 |
# File 'lib/comic_book/cb.rb', line 8 def archive = {} Archiver.new(path).archive end |
#entries ⇒ Object
Every file in the folder, as Entries with folder-relative paths
17 18 19 20 21 22 |
# File 'lib/comic_book/cb.rb', line 17 def entries Dir.glob(File.join(path, '**', '*')).reject { File.directory? it }.map do |file| relative = Pathname.new(file).relative_path_from(Pathname.new(path)).to_s ComicBook::Entry.new relative end end |
#extract(_options = {}) ⇒ Object
12 13 14 |
# File 'lib/comic_book/cb.rb', line 12 def extract = {} Extractor.new(path).extract end |
#info ⇒ Object
24 25 26 27 28 29 |
# File 'lib/comic_book/cb.rb', line 24 def info xml_path = File.join path, 'ComicInfo.xml' return nil unless File.exist? xml_path ComicInfo.load xml_path end |