Class: ChupaText::Decomposers::Tar
Instance Method Summary
collapse
#initialize, registry
Instance Method Details
#decompose(data) ⇒ Object
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/chupa-text/decomposers/tar.rb', line 30
def decompose(data)
Gem::Package::TarReader.new(StringIO.new(data.body)) do |reader|
reader.each do |entry|
next unless entry.file?
= VirtualFileData.new(entry.full_name, entry)
.source = data
yield()
end
end
end
|
#target?(data) ⇒ Boolean
25
26
27
28
|
# File 'lib/chupa-text/decomposers/tar.rb', line 25
def target?(data)
data.extension == "tar" or
data.mime_type == "application/x-tar"
end
|