Sha256: 82aa4641f54ac32d734e8d056cd9db6b0c79b4cb19a708c0e2ee2415ef6e6636

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

#! /usr/bin/ruby

#--
# Special Thanks to Jeffrey Schwab for #root?
#++

# Is the specified directory the root directory?

def FileTest.root?(dir)
  pth = File.expand_path(dir)
  return true if pth == '/'
  return true if pth =~ /^(\w:)?\/$/
  false
end

name = ARGV[0]

if name
  Dir.chdir '..' until FileTest.executable?(name) or FileTest.root?(Dir.pwd)
  if FileTest.executable?( name )
    system name
  end
else
  puts "Script #{name} not found."
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ratch-0.3.0 work/scrap/ludo
ratch-0.2.1 dev/ludo
ratch-0.2.2 dev/ludo