Class: FileStalker

Inherits:
Object
  • Object
show all
Defined in:
lib/feed_updater.rb

Class Method Summary collapse

Class Method Details

.hunt(paths) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/feed_updater.rb', line 32

def self.hunt(paths)
  for path in paths
    if File.exists?(File.expand_path(path))
      return File.expand_path(path)
    elsif File.exists?(File.expand_path(
        File.dirname(__FILE__) + path))
      return File.expand_path(File.dirname(__FILE__) + path)
    elsif File.exists?(File.expand_path(
        File.dirname(__FILE__) + "/" + path))
      return File.expand_path(File.dirname(__FILE__) + "/" + path)
    end
  end
  return nil
end