Method: CLConfig#findInputFile
- Defined in:
- ext/lib/CompLearnLib/CLConfig.rb
#findInputFile(fname) ⇒ Object
Searches for a file or directory specified by fname if fname is relative, it will search for it in the following order: inputDir specified in this CLConfig object current working directory
If found, a string is returned with the absolute (full) pathname. If not, an exception is raised
179 180 181 182 183 184 185 186 |
# File 'ext/lib/CompLearnLib/CLConfig.rb', line 179 def findInputFile(fname) raise "fname can not be nil" if fname == nil maybe = File.(fname, self.inputDir) return maybe if File.exist?(maybe) maybe = File.(fname) return maybe if File.exist?(maybe) raise "Cannot find file to open: #{fname}" end |