Report abuse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
@@ -1,5 +1,4 @@
SUPPORT = ENV['TM_SUPPORT_PATH']
-DIALOG = SUPPORT + '/bin/tm_dialog'
require SUPPORT + '/lib/exit_codes'
require SUPPORT + '/lib/escape'
@@ -31,6 +30,8 @@
def search_docs (query)
DOCSETS.each do |docset|
+ next unless File.exists? docset
+
cmd = DOCSET_CMD + query + ' ' + docset
response = `#{cmd}`
case response # elaborate for doc purposes
@@ -71,8 +72,8 @@
end
def man_page (query)
- if `man -w #{query}` !~ /No manual entry/
- page = `#{SUPPORT}/bin/html_man.sh -a #{query}`
+ if `man 2>&1 -w #{query}` !~ /No manual entry/
+ page = `#{e_sh SUPPORT}/bin/html_man.sh -a #{query}`
TextMate.exit_show_html "<meta http-equiv='Refresh' content='0;URL=tm-file://#{page}'>"
else
TextMate.exit_show_tool_tip "Cannot find documentation for: #{query}"
@@ -81,7 +82,7 @@
def get_user_selected_reference (class_names)
plist = {'menuItems' => class_names}.to_plist
- res = OSX::PropertyList::load(%x{#{e_sh DIALOG} -up #{e_sh plist} })
+ res = OSX::PropertyList::load(%x{"$DIALOG" -up #{e_sh plist} })
res['selectedMenuItem'] ? res['selectedMenuItem']['path'] : nil
end
|