Browse files

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

… which did not exist

git-svn-id: http://svn.textmate.org/trunk/Bundles/Ruby.tmbundle@8979 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 8c4b359 commit 22ff9937f0f830403086f347070263dd489d8603 @ciaran ciaran committed Feb 22, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 Preferences/Completion: require strings.tmPreferences
View
5 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 22ff993

Please sign in to comment.