Rename DetectShellScript() to DetectLangByShebang()
If rake in shebang, recognize such file as a ruby
Replace :set with :setlocal in filetype switching menu
Match most frequently used filetypes first
Try to speed up ruby.vim when it has trouble finding the right ruby