Class: FileSystem

Inherits:
Object
  • Object
show all
Extended by:
SubclassTracking
Defined in:
lib/FileSystem.rb

Constant Summary collapse

@@code_for_tests =
{}

Class Method Summary collapse

Methods included from SubclassTracking

extended

Class Method Details

.all_file_systemsObject



12
13
14
# File 'lib/FileSystem.rb', line 12

def FileSystem.all_file_systems
  FileSystem.subclasses
end

.code_for_testsObject



36
37
38
# File 'lib/FileSystem.rb', line 36

def self.code_for_tests
  @@code_for_tests[self] || []
end

.compatability_score(file_system_image) ⇒ Object

each subclass needs to overide this function to calculate how good a match the specified combination of FileSystem and ImageFormat is for the bytestream in question



25
26
27
# File 'lib/FileSystem.rb', line 25

def FileSystem.compatability_score(filesystem_image)
  FileSystem.matching_score
end

.files(file_system_image) ⇒ Object

each subclass needs to overide this function to extract files from a file_system_image



30
31
32
# File 'lib/FileSystem.rb', line 30

def FileSystem.files(file_system_image)
  []
end

.is_valid_file_system_if(code_for_test) ⇒ Object



40
41
42
43
44
# File 'lib/FileSystem.rb', line 40

def self.is_valid_file_system_if(code_for_test)
  #puts "adding test for #{self}: #{code_for_test.source}"
  @@code_for_tests[self] ||=[]
  @@code_for_tests[self]<<code_for_test.source
end

.matching_scoreObject



16
17
18
# File 'lib/FileSystem.rb', line 16

def FileSystem.matching_score
  0
end

.non_matching_scoreObject



20
21
22
# File 'lib/FileSystem.rb', line 20

def FileSystem.non_matching_score
  -1
end