Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
--- docset_query.rb (original) +++ docset_query.rb @@ -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
This paste will be private.
From the Design Piracy series on my blog: