Skip to content

Commit

Permalink
The require completion would fail if there was an entry in $LOAD_PATH…
Browse files Browse the repository at this point in the history
… 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
ciaran committed Feb 22, 2008
1 parent 01f194d commit d526060
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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>
Expand All @@ -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>
Expand Down

0 comments on commit d526060

Please sign in to comment.