Class: Libis::Format::Tool::Fido

Inherits:
IdentificationTool show all
Defined in:
lib/libis/format/tool/fido.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IdentificationTool

bad_mimetype, run, run_dir, run_list

Instance Attribute Details

#formatsObject

Returns the value of attribute formats.



23
24
25
# File 'lib/libis/format/tool/fido.rb', line 23

def formats
  @formats
end

Class Method Details

.add_formats(formats_file) ⇒ Object



15
16
17
# File 'lib/libis/format/tool/fido.rb', line 15

def self.add_formats(formats_file)
  self.instance.formats << formats_file unless self.instance.formats.include?(formats_file)
end

.del_formats(formats_file) ⇒ Object



19
20
21
# File 'lib/libis/format/tool/fido.rb', line 19

def self.del_formats(formats_file)
  self.instance.formats.delete(formats_file)
end

Instance Method Details

#run(file, options = {}) ⇒ Object



40
41
42
43
# File 'lib/libis/format/tool/fido.rb', line 40

def run(file, options = {})
  output = runner(file, options)
  process_output(output)
end

#run_dir(dir, recursive = true, options = {}) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/libis/format/tool/fido.rb', line 32

def run_dir(dir, recursive = true, options = {})
  args = []
  args << '-recurse' if recursive
  args << options
  output = runner(dir, *args)
  process_output(output)
end

#run_list(filelist, options = {}) ⇒ Object



25
26
27
28
29
30
# File 'lib/libis/format/tool/fido.rb', line 25

def run_list(filelist, options = {})
  create_list_file(filelist) do |list_file|
    output = runner(nil, '-input', list_file.escape_for_string, options)
    process_output(output)
  end
end