Method: Libis::Format::Tool::IdentificationTool.run

Defined in:
lib/libis/format/tool/identification_tool.rb

.run(file, recursive = false, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/libis/format/tool/identification_tool.rb', line 24

def self.run(file, recursive = false, options = {})
  options ||= {}
  if file.is_a?(Array)
    return run_list file, options
  elsif file.is_a?(String) && File.exists?(file) && File.readable?(file)
    if File.directory?(file)
      return run_dir(file, recursive, options)
    elsif File.file?(file)
      return self.instance.run(file, options)
    end
  end
  raise ArgumentError,
        'IdentificationTool: file argument should be a path to an existing file or directory or a list of those'
end