Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- executables = ENV["PATH"].split(":").inject([]) { |execs, path_dir| execs += Dir[path_dir + '/*'] }
- mysql_executables = executables.select { |e| Pathname.new(e).basename.to_s =~ /^mysql/ && File.executable?(e) }.map { |p| File.expand_path(p) }
Add Comment
Please, Sign In to add comment