Permalink
Browse files

The require completion would fail if there was an entry in $LOAD_PATH…

… which did not exist

git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/Ruby.tmbundle@8979 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 01f194d commit d526060cd90c30ba688a8acff8608b33fbf6b49d ciaran committed Feb 22, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 Preferences/Completion: require strings.tmPreferences
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
@@ -12,7 +12,8 @@
<string>#!/usr/bin/env ruby
ptrn = /^#{Regexp.escape ENV["TM_CURRENT_WORD"].to_s}[^.]+\..+/
puts( $LOAD_PATH.inject([]) do |res, path|
- res + Dir.new(path).grep(ptrn) { |file| file[/^[^.]+/] }
+ res &lt;&lt; Dir.new(path).grep(ptrn) { |file| file[/^[^.]+/] } if File.exists?(path)
+ res
end.sort.uniq )</string>
</dict>
<key>uuid</key>

0 comments on commit d526060

Please sign in to comment.