class Object

Public Instance Methods

load_relative(path) click to toggle source
# File lib/mysql_backup/extensions.rb, line 25
def load_relative(path)
        load File.expand_path path, this_dir()
end
this_dir() click to toggle source
# File lib/mysql_backup/extensions.rb, line 20
def this_dir
        file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
        File.expand_path File.dirname(file)
end
try_load(paths) click to toggle source
# File lib/mysql_backup/extensions.rb, line 11
def try_load(paths)
        Array.from(paths).each do |path|
                result = try_load_file path
                return result if !result.nil?
        end

        return nil
end
try_load_file(path) click to toggle source
# File lib/mysql_backup/extensions.rb, line 2
def try_load_file(path)
        begin
                load_relative path
                return path
        rescue LoadError => e
                return nil
        end
end