module NPGRT::Find

Public Instance Methods

binary(name) click to toggle source
# File lib/npgrt/find.rb, line 12
def binary(name)
        each_path do |path|
                v = File.join(path, name)
                return NPGRT.normalize_pathsep_os(v) if FileTest.file?(v)
        end
        Gem.find_files(name).each do |v|
                return NPGRT.normalize_pathsep_os(v) if FileTest.file?(v)
        end

        nil
end
hostruby() click to toggle source
# File lib/npgrt/find.rb, line 23
def hostruby
        binary("ruby.exe")
end

Private Instance Methods

each_path() { |x| ... } click to toggle source
# File lib/npgrt/find.rb, line 5
def each_path
        ENV['path'].split(";").each{|x|
                yield x
        }
end