module Demo

Public Class Methods

find_file(basename) click to toggle source
# File gtk2/sample/gtk-demo/common.rb, line 13
def self.find_file(basename)
  file_load_paths = [
    File.dirname(__FILE__),
    "/usr/share/gtk-2.0/demo",
    "/usr/local/share/gtk-2.0/demo",
  ]
  file_load_paths.each do |dirname|
    path = File.join(dirname, basename)
    if File.exist?(path)
      return path
    end
  end

  raise "#{basename}: No such file or directory"
end