Class: Libis::Format::IdentificationTool
- Inherits:
-
Object
- Object
- Libis::Format::IdentificationTool
show all
- Includes:
- Tools::Logger, Singleton
- Defined in:
- lib/libis/format/identification_tool.rb
Class Method Summary
collapse
Class Method Details
.bad_mimetype(mimetype) ⇒ Object
19
20
21
|
# File 'lib/libis/format/identification_tool.rb', line 19
def self.bad_mimetype(mimetype)
self.instance.bad_mimetype(mimetype)
end
|
.run(file, recursive = false) ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/libis/format/identification_tool.rb', line 23
def self.run(file, recursive = false)
if file.is_a?(Array)
return run_list file
elsif file.is_a?(String) && File.exists?(file) && File.readable?(file)
if File.directory?(file)
return run_dir(file, recursive)
elsif File.file?(file)
return self.instance.run(file)
end
end
raise ArgumentError,
'IdentificationTool: file argument should be a path to an existing file or directory or a list of those'
end
|
.run_dir(file, recursive = true) ⇒ Object
37
38
39
|
# File 'lib/libis/format/identification_tool.rb', line 37
def self.run_dir(file, recursive = true)
self.instance.run_dir file, recursive
end
|
.run_list(filelist) ⇒ Object
41
42
43
|
# File 'lib/libis/format/identification_tool.rb', line 41
def self.run_list(filelist)
self.instance.run_list filelist
end
|