Module: Hydra
- Defined in:
- lib/hydra/file_characterization.rb,
lib/hydra/file_characterization/version.rb
Defined Under Namespace
Modules: FileCharacterization
Class Method Summary collapse
-
.characterize(content, filename, *tool_names) ⇒ String+
Run all of the specified tools against the given content and filename.
Class Method Details
.characterize(content, filename, *tool_names) ⇒ String+
Run all of the specified tools against the given content and filename.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/hydra/file_characterization.rb', line 25 def characterize(content, filename, *tool_names) tool_outputs = [] tool_names = Array(tool_names).flatten.compact FileCharacterization::ToTempFile.open(content, filename) do |f| tool_names.each do |tool_name| tool_outputs << FileCharacterization.characterize_with(tool_name, f.path) end end tool_names.size == 1 ? tool_outputs.first : tool_outputs end |