| 35 | | found_extractor=all.find{|extractor| extractor.exts.include?(ext)} || raise(ArgumentError, "no convertor for #{filename}") |
|---|
| 36 | | found_extractor.source=filename |
|---|
| 37 | | found_extractor |
|---|
| | 35 | returning find_by_extension(ext) do |found_extractor| |
|---|
| | 36 | found_extractor.source=filename |
|---|
| | 37 | end |
|---|
| | 38 | end |
|---|
| | 39 | |
|---|
| | 40 | # Finds which extractor should be used for a given file, according to its extension |
|---|
| | 41 | # Raises if the file is unsupported. |
|---|
| | 42 | def find_by_extension(ext) |
|---|
| | 43 | all.find{|extractor| extractor.exts.include?(ext)} || raise(ArgumentError, "no convertor for #{filename}") |
|---|