Class: ComicBook::CBR
- Inherits:
-
Adapter
show all
- Defined in:
- lib/comic_book/cbr.rb,
lib/comic_book/cbr/extractor.rb
Defined Under Namespace
Classes: Extractor
Instance Method Summary
collapse
Methods inherited from Adapter
#initialize
Instance Method Details
#archive(_options = {}) ⇒ Object
8
9
10
|
# File 'lib/comic_book/cbr.rb', line 8
def archive _options = {}
raise Error, 'CBR archiving not supported (RAR is proprietary)'
end
|
12
13
14
|
# File 'lib/comic_book/cbr.rb', line 12
def options = {}
Extractor.new(path). options
end
|
#info ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/comic_book/cbr.rb', line 16
def info
entries = CLIHelpers.lsar_list path
return nil unless entries.include? 'ComicInfo.xml'
Dir.mktmpdir do |temp_dir|
CLIHelpers. path, temp_dir
xml_path = File.join temp_dir, 'ComicInfo.xml'
return nil unless File.exist? xml_path
ComicInfo.load xml_path
end
end
|
#pages ⇒ Object
29
30
31
32
33
34
|
# File 'lib/comic_book/cbr.rb', line 29
def pages
CLIHelpers.lsar_list(path)
.select { image_file? it }
.map { create_page_from_entry it }
.sort_by(&:name)
end
|