├── Support └── shared │ ├── bin │ ├── CocoaDialog.app │ │ └── Contents │ │ │ ├── PkgInfo │ │ │ ├── Frameworks │ │ │ ├── Sparkle.framework │ │ │ │ ├── Resources │ │ │ │ │ ├── finish_installation.app │ │ │ │ │ │ └── Contents │ │ │ │ │ │ │ ├── PkgInfo │ │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ ├── SUStatus.nib │ │ │ │ │ │ │ ├── Sparkle.icns │ │ │ │ │ │ │ └── en.lproj │ │ │ │ │ │ │ │ └── Sparkle.strings │ │ │ │ │ │ │ ├── MacOS │ │ │ │ │ │ │ └── finish_installation │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ ├── License.txt │ │ │ │ │ ├── SUStatus.nib │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ ├── SUUpdateAlert.nib │ │ │ │ │ │ ├── Sparkle.strings │ │ │ │ │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ │ │ │ └── SUUpdatePermissionPrompt.nib │ │ │ │ │ ├── Info.plist │ │ │ │ │ └── SUModelTranslation.plist │ │ │ │ ├── Versions │ │ │ │ │ ├── A │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ ├── finish_installation.app │ │ │ │ │ │ │ │ └── Contents │ │ │ │ │ │ │ │ │ ├── PkgInfo │ │ │ │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ │ │ ├── SUStatus.nib │ │ │ │ │ │ │ │ │ ├── Sparkle.icns │ │ │ │ │ │ │ │ │ └── en.lproj │ │ │ │ │ │ │ │ │ │ └── Sparkle.strings │ │ │ │ │ │ │ │ │ ├── MacOS │ │ │ │ │ │ │ │ │ └── finish_installation │ │ │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ │ ├── License.txt │ │ │ │ │ │ │ ├── SUStatus.nib │ │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ │ ├── Sparkle.strings │ │ │ │ │ │ │ │ ├── SUUpdateAlert.nib │ │ │ │ │ │ │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ │ │ │ │ │ └── SUUpdatePermissionPrompt.nib │ │ │ │ │ │ │ ├── Info.plist │ │ │ │ │ │ │ └── SUModelTranslation.plist │ │ │ │ │ │ └── Sparkle │ │ │ │ │ └── Current │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ ├── finish_installation.app │ │ │ │ │ │ │ └── Contents │ │ │ │ │ │ │ │ ├── PkgInfo │ │ │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ │ ├── SUStatus.nib │ │ │ │ │ │ │ │ ├── Sparkle.icns │ │ │ │ │ │ │ │ └── en.lproj │ │ │ │ │ │ │ │ │ └── Sparkle.strings │ │ │ │ │ │ │ │ ├── MacOS │ │ │ │ │ │ │ │ └── finish_installation │ │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ ├── License.txt │ │ │ │ │ │ ├── SUStatus.nib │ │ │ │ │ │ ├── en.lproj │ │ │ │ │ │ │ ├── Sparkle.strings │ │ │ │ │ │ │ ├── SUUpdateAlert.nib │ │ │ │ │ │ │ ├── SUAutomaticUpdateAlert.nib │ │ │ │ │ │ │ └── SUUpdatePermissionPrompt.nib │ │ │ │ │ │ ├── Info.plist │ │ │ │ │ │ └── SUModelTranslation.plist │ │ │ │ │ │ └── Sparkle │ │ │ │ └── Sparkle │ │ │ └── Growl.framework │ │ │ │ ├── Growl │ │ │ │ ├── Versions │ │ │ │ ├── A │ │ │ │ │ ├── Growl │ │ │ │ │ ├── _CodeSignature │ │ │ │ │ │ └── CodeResources │ │ │ │ │ └── Resources │ │ │ │ │ │ └── Info.plist │ │ │ │ └── Current │ │ │ │ │ ├── Growl │ │ │ │ │ ├── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ │ └── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── Resources │ │ │ │ └── Info.plist │ │ │ ├── MacOS │ │ │ └── CocoaDialog │ │ │ ├── Resources │ │ │ ├── relaunch │ │ │ ├── cocoadialog.icns │ │ │ ├── en-US.lproj │ │ │ │ ├── tbc.nib │ │ │ │ ├── Msgbox.nib │ │ │ │ ├── popup.nib │ │ │ │ ├── MainMenu.nib │ │ │ │ ├── Textbox.nib │ │ │ │ ├── Progressbar.nib │ │ │ │ └── InfoPlist.strings │ │ │ ├── dsa_pub.pem │ │ │ └── Changelog │ │ │ └── Info.plist │ ├── mate │ ├── play │ ├── find_app │ ├── tm_dialog │ ├── html_man.sh │ ├── ruby20 │ ├── Markdown-license.txt │ ├── ruby18 │ ├── man2html │ └── checknest.rb │ ├── private │ ├── README.txt │ ├── plist.rb │ ├── ruby18_fix_loadpath.rb │ └── track_usage.rb │ ├── Sounds │ ├── Harp.wav │ └── Whistle.wav │ ├── images │ ├── arrow-up.gif │ ├── arrow-down.gif │ └── arrow-none.gif │ ├── lib │ ├── osx │ │ ├── plist.bundle │ │ └── keychain.bundle │ ├── README.txt │ ├── webpreview.py │ ├── web_preview.rb │ ├── tm_parser.rb │ ├── tm │ │ ├── require_cmd.rb │ │ ├── detach.rb │ │ ├── markdown.rb │ │ ├── tempfile.rb │ │ ├── save_current_document.rb │ │ ├── process.rb │ │ └── htmloutput.rb │ ├── exit_codes.rb │ ├── selected_files_tests.rb │ ├── escape.rb │ ├── webpreview.sh │ ├── ruby1.9 │ │ └── add_1.8_features.rb │ ├── password.rb │ ├── bash_init.sh │ ├── shelltokenize.rb │ ├── dialog.py │ ├── tm_helpers.py │ ├── io.rb │ ├── progress.rb │ ├── markdown_to_help.rb │ ├── html.sh │ ├── current_word.rb │ ├── textmate.rb │ └── scriptmate.rb │ ├── nibs │ ├── RequestItem.nib │ │ └── keyedobjects.nib │ ├── RequestString.nib │ │ ├── keyedobjects.nib │ │ └── designable.nib │ ├── ProgressDialog.nib │ │ ├── keyedobjects.nib │ │ └── designable.nib │ ├── RequestSecureString.nib │ │ ├── keyedobjects.nib │ │ └── designable.nib │ └── SimpleNotificationWindow.nib │ │ ├── keyedobjects.nib │ │ └── designable.nib │ ├── script │ ├── default.js │ └── webpreview.js │ └── css │ └── default.css ├── .gitmodules ├── info.plist ├── src ├── default.rave └── find_app.cc └── Preferences └── Shared Support Path.tmPreferences /Support/shared/bin/CocoaDialog.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Support/shared/bin/mate: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec "${TM_MATE}" "$@" 3 | -------------------------------------------------------------------------------- /Support/shared/bin/play: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec /usr/bin/afplay "$@" 3 | -------------------------------------------------------------------------------- /Support/shared/private/README.txt: -------------------------------------------------------------------------------- 1 | Bundle items should not rely on files contained in this directory. 2 | -------------------------------------------------------------------------------- /Support/shared/private/plist.rb: -------------------------------------------------------------------------------- 1 | $: << "#{ENV['TM_SUPPORT_PATH']}/private/vendor/plist/lib" 2 | require 'plist' 3 | -------------------------------------------------------------------------------- /Support/shared/bin/find_app: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/find_app -------------------------------------------------------------------------------- /Support/shared/Sounds/Harp.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/Sounds/Harp.wav -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Support/shared/Sounds/Whistle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/Sounds/Whistle.wav -------------------------------------------------------------------------------- /Support/shared/images/arrow-up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/images/arrow-up.gif -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Support/shared/images/arrow-down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/images/arrow-down.gif -------------------------------------------------------------------------------- /Support/shared/images/arrow-none.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/images/arrow-none.gif -------------------------------------------------------------------------------- /Support/shared/lib/osx/plist.bundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/lib/osx/plist.bundle -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /Support/shared/lib/osx/keychain.bundle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/lib/osx/keychain.bundle -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Support/shared/private/vendor/plist"] 2 | path = Support/shared/private/vendor/plist 3 | url = https://github.com/patsplat/plist.git 4 | -------------------------------------------------------------------------------- /Support/shared/nibs/RequestItem.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/nibs/RequestItem.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/shared/nibs/RequestString.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/nibs/RequestString.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/shared/nibs/ProgressDialog.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/nibs/ProgressDialog.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/MacOS/CocoaDialog -------------------------------------------------------------------------------- /Support/shared/nibs/RequestSecureString.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/nibs/RequestSecureString.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/relaunch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/relaunch -------------------------------------------------------------------------------- /Support/shared/nibs/SimpleNotificationWindow.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/nibs/SimpleNotificationWindow.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/cocoadialog.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/cocoadialog.icns -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/tbc.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/tbc.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Growl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Growl -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/Msgbox.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/Msgbox.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/popup.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/popup.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/MainMenu.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/Textbox.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/Textbox.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Sparkle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Sparkle -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/Progressbar.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/Progressbar.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Resources/en-US.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /Support/shared/private/ruby18_fix_loadpath.rb: -------------------------------------------------------------------------------- 1 | # This is used by bin/ruby18 to fix the hardcoded loadpath 2 | $:.each { |path| path.sub!(%r{^/Users/msheets/rubyinstalled}, "#{ENV['HOME']}/Library/Application Support/TextMate/Ruby/1.8.7") } 3 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/A/Growl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/A/Growl -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle -------------------------------------------------------------------------------- /Support/shared/bin/tm_dialog: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ -e "$DIALOG" ]] 4 | then "$DIALOG" "$@" 5 | else echo 1>&2 "ERROR: Please read the 2007-03-15 update at http://macromates.com/blog/archives/2006/10/28/new-dialog-system-for-commands/" 6 | fi 7 | -------------------------------------------------------------------------------- /Support/shared/lib/README.txt: -------------------------------------------------------------------------------- 1 | # Updated: 2005-05-20, Sune Foldager. 2 | 3 | This directory should contain object files that aren't supposed to be executed directly, 4 | such as shared libraries and bash source-files. Data files should not be here. 5 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/Current/Growl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/Current/Growl -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/License.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/License.txt -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Sparkle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Sparkle -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/SUUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/SUUpdateAlert.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/License.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/License.txt -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Support/shared/bin/html_man.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SECTION=$1 4 | WORD=$2 5 | 6 | DST=$(mktemp "${TMPDIR:-/tmp}/tm_man_XXXXXX").html 7 | "$TM_SUPPORT_PATH/bin/man2html" &>"$DST" "$SECTION" "$WORD" 8 | echo -n "$DST" 9 | 10 | { sleep 300; rm "$DST"; rm "${DST%.html}"; } &>/dev/null & 11 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/SUAutomaticUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/SUAutomaticUpdateAlert.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/SUUpdatePermissionPrompt.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/en.lproj/SUUpdatePermissionPrompt.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/SUUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/SUUpdateAlert.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/SUAutomaticUpdateAlert.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/SUAutomaticUpdateAlert.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Resources/Sparkle.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Resources/Sparkle.icns -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/SUUpdatePermissionPrompt.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/en.lproj/SUUpdatePermissionPrompt.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/MacOS/finish_installation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/MacOS/finish_installation -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Resources/Sparkle.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Resources/Sparkle.icns -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/MacOS/finish_installation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/MacOS/finish_installation -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Resources/SUStatus.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Resources/SUStatus.nib -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Resources/Sparkle.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Resources/Sparkle.icns -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/MacOS/finish_installation: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/MacOS/finish_installation -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Resources/en.lproj/Sparkle.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/bundle-support.tmbundle/master/Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Resources/en.lproj/Sparkle.strings -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | description 6 | Do not uninstall: Support files for other bundles. 7 | name 8 | Bundle Support 9 | uuid 10 | 0BB1F01A-4F0A-475A-ACDD-0F5578F2EFC3 11 | 12 | 13 | -------------------------------------------------------------------------------- /Support/shared/lib/webpreview.py: -------------------------------------------------------------------------------- 1 | 2 | # python bindings for soryu's web-preview 3 | from cgi import escape 4 | from os import path, environ 5 | from tm_helpers import sh, sh_escape 6 | 7 | webpreview = sh_escape(path.join(environ["TM_SUPPORT_PATH"], "lib/webpreview.sh")) 8 | 9 | def html_header(title, subtitle): 10 | return sh('source %s; html_header "%s" "%s"' % (webpreview, sh_escape(title), sh_escape(subtitle))) 11 | 12 | def html_footer(): 13 | return sh('source %s; html_footer' % webpreview) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Support/shared/bin/ruby20: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script ensures that scripts are run with the predictable system supplied 4 | # version of ruby rather than a user-installed future version. It also allows 5 | # future customization of the version of ruby or it's environment. 6 | 7 | for ruby in /System/Library/Frameworks/Ruby.framework/Versions/2.*/usr/bin/ruby; do 8 | [ -e $ruby ] && exec $ruby "$@" 9 | done 10 | 11 | "$DIALOG" alert --title "Unable to Run Command" --body "Unsupported system support files, please contact support." --button1 "OK" &>/dev/null 12 | exit 200 13 | -------------------------------------------------------------------------------- /Support/shared/lib/web_preview.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/htmloutput.rb" 3 | 4 | def html_head(options = { }) 5 | TextMate::HTMLOutput.header(options) 6 | end 7 | 8 | # compatibility function 9 | def html_header(tm_html_title, tm_html_lang = "", tm_extra_head = "", tm_window_title = nil, tm_fix_href = nil) 10 | puts html_head(:title => tm_html_title, :sub_title => tm_html_lang, :html_head => tm_extra_head, 11 | :window_title => tm_window_title, :fix_href => tm_fix_href) 12 | end 13 | 14 | def html_footer 15 | puts TextMate::HTMLOutput.footer() 16 | end 17 | 18 | if __FILE__ == $PROGRAM_NAME 19 | html_header("Test Title") 20 | puts "Test Body" 21 | html_footer 22 | end -------------------------------------------------------------------------------- /src/default.rave: -------------------------------------------------------------------------------- 1 | set APP_MIN_OS "10.9" 2 | set INSTALL_PATH "../Support/shared/bin" 3 | 4 | set FLAGS "-Wall -Os -DNDEBUG -flto=thin" 5 | add LN_FLAGS "-flto=thin -Wl,-cache_path_lto,'\\${builddir}/.cache'" 6 | add LN_FLAGS "-Wl,-dead_strip -Wl,-dead_strip_dylibs" 7 | set CS_FLAGS "--force --options runtime" 8 | 9 | target find_app { 10 | set CS_IDENTITY "${APPLE_DEVELOPER_ID}" 11 | notarize "${APPLE_NOTARIZE_USER}" "${APPLE_NOTARIZE_PASS}" "none" 12 | 13 | arch "arm64" "x86_64" { 14 | add FLAGS "-mmacosx-version-min=${APP_MIN_OS} -target macos-${arch}" 15 | add LN_FLAGS "-mmacosx-version-min=${APP_MIN_OS} -target macos-${arch}" 16 | } 17 | 18 | sources find_app.cc 19 | executable ${target} 20 | frameworks ApplicationServices 21 | 22 | define install "/bin/cp -Xp '${executable}' '${INSTALL_PATH}/${target}'" 23 | } 24 | -------------------------------------------------------------------------------- /Preferences/Shared Support Path.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Shared Support Path 7 | settings 8 | 9 | shellVariables 10 | 11 | 12 | name 13 | TM_SUPPORT_PATH 14 | value 15 | $TM_BUNDLE_SUPPORT/shared 16 | 17 | 18 | name 19 | PATH 20 | value 21 | $PATH:$TM_SUPPORT_PATH/bin 22 | 23 | 24 | 25 | uuid 26 | 65F25174-08DA-48A1-BD41-98C494972B97 27 | 28 | 29 | -------------------------------------------------------------------------------- /Support/shared/script/default.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Default JavaScript for HTML output. _UNDER CONSTRUCTION - PLEASE DON'T TINKER YET_ 4 | By Sune Foldager. 5 | 6 | */ 7 | 8 | function showElement(id) 9 | { 10 | var b = document.getElementById(id + "_b"); 11 | var s = document.getElementById(id + "_s"); 12 | var h = document.getElementById(id + "_h"); 13 | b.style.display = "block"; 14 | s.style.display = "none"; 15 | h.style.display = "inline"; 16 | } 17 | 18 | function hideElement(id) 19 | { 20 | var b = document.getElementById(id + "_b"); 21 | var s = document.getElementById(id + "_s"); 22 | var h = document.getElementById(id + "_h"); 23 | b.style.display = "none"; 24 | s.style.display = "inline"; 25 | h.style.display = "none"; 26 | } 27 | 28 | function clearElement(id) 29 | { 30 | document.getElementById(id).innerHTML = "" 31 | } 32 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | SwzGt9RQsuVafBBrfBalB75dCwU= 10 | 11 | 12 | rules 13 | 14 | ^Resources/ 15 | 16 | ^Resources/.*\.lproj/ 17 | 18 | optional 19 | 20 | weight 21 | 1000 22 | 23 | ^Resources/.*\.lproj/locversion.plist$ 24 | 25 | omit 26 | 27 | weight 28 | 1100 29 | 30 | ^version.plist$ 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | SwzGt9RQsuVafBBrfBalB75dCwU= 10 | 11 | 12 | rules 13 | 14 | ^Resources/ 15 | 16 | ^Resources/.*\.lproj/ 17 | 18 | optional 19 | 20 | weight 21 | 1000 22 | 23 | ^Resources/.*\.lproj/locversion.plist$ 24 | 25 | omit 26 | 27 | weight 28 | 1100 29 | 30 | ^version.plist$ 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Support/shared/lib/tm_parser.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | 3 | module TextMate 4 | 5 | def TextMate.url_esc (url) 6 | url.gsub(/[^a-zA-Z0-9.-\/]/) { |m| sprintf("%%%02X", m[0]) } 7 | end 8 | 9 | def TextMate.html_esc (text) 10 | text.gsub(/&/, '&').gsub(/' 15 | STDIN.each_line do |line| 16 | line = line.chop 17 | if m = /^(.*?):(?:(\d+):)?\s*(.*?)$/.match(line) then 18 | file, no, error = m[1..3] 19 | file = File.expand_path(file, ENV['PWD']) 20 | if File.exists?(file) 21 | print "#{html_esc error}
" 24 | else 25 | print html_esc(line) + '
' 26 | end 27 | else 28 | print html_esc(line) + '
' 29 | end 30 | end 31 | print '' 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /Support/shared/lib/tm/require_cmd.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 4 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" 5 | require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb" 6 | 7 | module TextMate 8 | class << self 9 | def require_cmd(cmd) 10 | unless File.executable?(cmd) or ENV['PATH'].split(':').any? { |dir| File.executable? File.join(dir, cmd) } 11 | TextMate::HTMLOutput.show(:title => "Can't find “#{cmd}” on PATH.", :sub_title => "") do |io| 12 | io << "

The current PATH is:

" 13 | io << "
" 14 | ENV["PATH"].split(":").each do |p| 15 | io << htmlize(p + "\n") 16 | end 17 | io << "
" 18 | io << "

Please add the directory containing “#{cmd}” to PATH in TextMate's Shell Variables preferences.

" 19 | end 20 | TextMate.exit_show_html 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /Support/shared/lib/exit_codes.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | 3 | module TextMate 4 | module_function 5 | 6 | def exit_discard 7 | exit 200 8 | end 9 | 10 | def exit_replace_text(out = nil) 11 | print out if out 12 | exit 201 13 | end 14 | 15 | def exit_replace_document(out = nil) 16 | print out if out 17 | exit 202 18 | end 19 | 20 | def exit_insert_text(out = nil) 21 | print out if out 22 | exit 203 23 | end 24 | 25 | def exit_insert_snippet(out = nil) 26 | print out if out 27 | exit 204 28 | end 29 | 30 | def exit_show_html(out = nil) 31 | print out if out 32 | exit 205 33 | end 34 | 35 | def exit_show_tool_tip(out = nil) 36 | STDERR << out if out 37 | exit 206 38 | end 39 | 40 | def exit_create_new_document(out = nil) 41 | print out if out 42 | exit 207 43 | end 44 | 45 | def exit_insert_snippet_no_indent(out = nil) 46 | print out if out 47 | exit 208 48 | end 49 | end -------------------------------------------------------------------------------- /Support/shared/lib/selected_files_tests.rb: -------------------------------------------------------------------------------- 1 | # cheat a bit to let textmate.rb not fail its require 2 | ENV['TM_SUPPORT_PATH'] = '..' 3 | require 'textmate.rb' 4 | require 'test/unit' 5 | 6 | 7 | # some tests to verify TextMate.selected_files is working 8 | class SelectedFilesTestCase < Test::Unit::TestCase 9 | 10 | def test_empty 11 | assert_nil( TextMate.selected_files(nil) ) 12 | assert_nil( TextMate.selected_files('') ) 13 | end 14 | 15 | def test_single_file 16 | assert_equal( ["test'me"], TextMate.selected_files("'test'\\''me'") ) 17 | 18 | assert_equal( 19 | ["test'me'again'and ''again ' and again."], 20 | TextMate.selected_files("'test'\\''me'\\''again'\\''and '\\'\\''"+ 21 | "again '\\'' and again.'") 22 | ) 23 | end 24 | 25 | def test_multiple_files 26 | assert_equal( 27 | [ "test'me", " and me", "/and / also ' mmh me/.rb"], 28 | TextMate.selected_files( 29 | "'test'\\''me' " + "' and me' " + "'/and / also '\\'' mmh me/.rb'") 30 | ) 31 | end 32 | 33 | end 34 | -------------------------------------------------------------------------------- /Support/shared/script/webpreview.js: -------------------------------------------------------------------------------- 1 | /* 2 | Some scripts for the HTML Output. To be used in conjunction with `../lib/webpreview.sh`. 3 | 4 | In Flux: http://macromates.com/wiki/Suggestions/StylingHTMLOutput 5 | */ 6 | function selectTheme(event) { 7 | var theme = event.target.value; 8 | var path = event.target.options[event.target.options.selectedIndex].title; 9 | 10 | TextMate.system("defaults write com.macromates.textmate.webpreview SelectedTheme '" + theme + "'", null); 11 | 12 | document.getElementById('tm_webpreview_body').className = theme; 13 | document.getElementById('tm_webpreview_content').className = theme; 14 | 15 | var replacements = {teaser: "teaser", gradient: "header"}; 16 | for(var r in replacements) { 17 | var element = document.getElementById(r); 18 | element.src = 'file://' + path + '/images/' + replacements[r] + ".png"; 19 | } 20 | } 21 | 22 | function hide_header() { 23 | document.getElementById('tm_webpreview_header').style.display = 'none'; 24 | document.getElementById('tm_webpreview_content').setAttribute('style', 'margin-top: 1em'); 25 | // var header = document.getElementById('tm_webpreview_header'); 26 | // var parent = header.parentNode; 27 | // parent.removeChild(header); 28 | } 29 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/dsa_pub.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIDOzCCAi0GByqGSM44BAEwggIgAoIBAQDjPN8K4TW34lYfYkzreg47fijtSXDU 3 | fSwngmpYyX7pcW0mK4Z3RuVkkKqztm/vgoCmtAG0u7rQX8p27lrKRf+tQkSCzib+ 4 | Ny3LaWMW+GLlIFZ0269cu5b07GUKGRtgNjNmsWod6Zdi7FWsnXjMmSF1kFdotv+L 5 | x3rBWer0hsXxX+nZPxoLvEbes2OuzQ6s0wHagwnS6tpYuTnQiyV6ea6W+wXVFlGo 6 | j63DgGj/oTQzRw19dOc5tWhbBpyJC/p8aG1PQ1ShU+x0RgnBSuTmBcd/LWo48Tk9 7 | slz5ocZCSY3GcEqxm2cOKm5oJw6hrUtFCj1RgD3/7VFDFnT8w7GTsXvZAhUA6NRU 8 | frBbGFYYcKFP96tj6IKvHI8CggEAC5zH0KC6DzUvU7iHFG26EYpT0ilUtexqvkIp 9 | AcKe5g4crGFc3SRDUMS/wuOgEiplrQBJ3hYIIeOd3e/2tFxGPrB/o0HDCBWkKtt5 10 | iBV7FKfy6zXhNg+Uv5fgQnrZmuPY8sTgZdQ+Wj/MEkhBi4VoDTMWXkMsxaqNE28j 11 | XdZVaTQSxdTRuuvyAwEVNK3CxBfDv5Peq9XUvbn5coMlcVbvThesqarpm3Mv42jy 12 | pDgwvnQmDSJf9NJQxj4jrynGSV86gGiIaPLu2FKUBWHB2lO71H5ArS50z68DuZXW 13 | Bo2R1ThBuy/+BnH7r5pwPvBFrGEWWEEDeLQRkGx722Gk3lonVAOCAQYAAoIBAQDQ 14 | S4AnQZQaOOMBb3E0jqziugFaUtJB/2idisRYDEVFPcBZOp6FspQfUFVLQnCH23fb 15 | wsjB9IkiL9xANoaRMcwOsY+QUGBghC5QC1WryM2v25jUcDjCnf4I2iFpJwRp+oay 16 | L6cDsnztzHLZz9C04OBonPepMaxw5D04AnlCROFRr9DvVQ9ijhCzylxpPv7iJzAR 17 | Lz7YS0hFqf0ExC+GscU5RvYK5l0M4/6uYRo3fCyjQSJGl4erFr/Lw6DE1Bl7pkEJ 18 | /ei6eug6yHzI5OZ74fS4U+PUq9CS7cpoS0j8tsYJlIWzKd6e+7CwNFex0VUVY2BB 19 | WQ/QRh796sCdOwuPKafI 20 | -----END PUBLIC KEY----- 21 | -------------------------------------------------------------------------------- /Support/shared/private/track_usage.rb: -------------------------------------------------------------------------------- 1 | # If this file is included from anything that uses ruby 1.8.7 then a line 2 | # will be appended to: 3 | # 4 | # ~/Library/Caches/com.macromates.TextMate/LegacyUsage.csv 5 | # 6 | # This file can then later be inspected to see which TextMate commands still 7 | # need to be updated to use ruby 2.x. 8 | 9 | if RUBY_VERSION == '1.8.7' && !defined?($textmate_migration_did_log) 10 | if logfile = ENV['TEXTMATE_MIGRATION_LOG'] 11 | component = $PROGRAM_NAME.sub(/^#{Regexp.escape(ENV['HOME'])}(?=\/)/, '~') 12 | if line = caller.find { |line| line.start_with?(ENV['TM_SUPPORT_PATH'] + '/') } 13 | component = line.split(':', 2).first.sub(/^#{Regexp.escape(ENV['TM_SUPPORT_PATH'])}(?=\/)/, '$TM_SUPPORT_PATH') 14 | end 15 | 16 | open(logfile, 'a') do |io| 17 | cells = [ 18 | Time.now.gmtime.strftime('%FT%TZ'), 19 | ENV['TM_BUNDLE_ITEM_UUID'] || 'null', 20 | ENV['TM_BUNDLE_ITEM_NAME'] || 'null', 21 | "ruby #{RUBY_VERSION}", 22 | component, 23 | ] 24 | io << "date,bundleItemUUID,bundleItemName,component,extra\n" if io.pos == 0 25 | io << cells.map { |cell| cell =~ /[",]/ ? '"' + cell.gsub(/"/, '""') + '"' : cell }.join(',') << "\n" 26 | end 27 | 28 | $textmate_migration_did_log = true 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /src/find_app.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static char const* const AppVersion = "1.1"; 6 | 7 | int main (int argc, char const* argv[]) 8 | { 9 | if(argc == 2 && strncmp("-", argv[1], 1) != 0) 10 | { 11 | CFStringRef bundleID = NULL; 12 | CFStringRef appName = NULL; 13 | if(strstr(argv[1], ".app")) 14 | appName = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8*)argv[1], strlen(argv[1]), kCFStringEncodingUTF8, FALSE); 15 | else bundleID = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8*)argv[1], strlen(argv[1]), kCFStringEncodingUTF8, FALSE); 16 | 17 | CFURLRef url = NULL; 18 | if(noErr == LSFindApplicationForInfo(kLSUnknownCreator, bundleID, appName, NULL, &url)) 19 | { 20 | CFStringRef str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); 21 | 22 | CFIndex len = CFStringGetLength(str); 23 | UInt8 buf[4 * len]; 24 | 25 | CFIndex actualLength = 0; 26 | if(len == CFStringGetBytes(str, (CFRange){0, len}, kCFStringEncodingUTF8, '?', FALSE, buf, sizeof(buf), &actualLength)) 27 | { 28 | write(STDOUT_FILENO, buf, actualLength); 29 | return 0; 30 | } 31 | } 32 | } 33 | else 34 | { 35 | fprintf(stderr, "find_app %s: print full path to application\nusage: find_app bundle_identifier\n find_app application_name.app\n", AppVersion); 36 | } 37 | return 1; 38 | } 39 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Sparkle 11 | CFBundleIdentifier 12 | org.andymatuschak.Sparkle 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Sparkle 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.5 Beta (git) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 613b759 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4D199 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4D199 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Growl 11 | CFBundleIdentifier 12 | com.growl.growlframework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.3.1 19 | CFBundleSignature 20 | GRRR 21 | CFBundleVersion 22 | 1.3.1 23 | DTCompiler 24 | com.apple.compilers.llvm.clang.1_0 25 | DTPlatformBuild 26 | 4D199 27 | DTPlatformVersion 28 | GM 29 | DTSDKBuild 30 | 11C63 31 | DTSDKName 32 | macosx10.7 33 | DTXcode 34 | 0420 35 | DTXcodeBuild 36 | 4D199 37 | NSPrincipalClass 38 | GrowlApplicationBridge 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Sparkle 11 | CFBundleIdentifier 12 | org.andymatuschak.Sparkle 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Sparkle 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.5 Beta (git) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 613b759 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4D199 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4D199 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Growl 11 | CFBundleIdentifier 12 | com.growl.growlframework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.3.1 19 | CFBundleSignature 20 | GRRR 21 | CFBundleVersion 22 | 1.3.1 23 | DTCompiler 24 | com.apple.compilers.llvm.clang.1_0 25 | DTPlatformBuild 26 | 4D199 27 | DTPlatformVersion 28 | GM 29 | DTSDKBuild 30 | 11C63 31 | DTSDKName 32 | macosx10.7 33 | DTXcode 34 | 0420 35 | DTXcodeBuild 36 | 4D199 37 | NSPrincipalClass 38 | GrowlApplicationBridge 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Sparkle 11 | CFBundleIdentifier 12 | org.andymatuschak.Sparkle 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Sparkle 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.5 Beta (git) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 613b759 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4D199 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4D199 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Growl.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11C74 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | Growl 11 | CFBundleIdentifier 12 | com.growl.growlframework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.3.1 19 | CFBundleSignature 20 | GRRR 21 | CFBundleVersion 22 | 1.3.1 23 | DTCompiler 24 | com.apple.compilers.llvm.clang.1_0 25 | DTPlatformBuild 26 | 4D199 27 | DTPlatformVersion 28 | GM 29 | DTSDKBuild 30 | 11C63 31 | DTSDKName 32 | macosx10.7 33 | DTXcode 34 | 0420 35 | DTXcodeBuild 36 | 4D199 37 | NSPrincipalClass 38 | GrowlApplicationBridge 39 | 40 | 41 | -------------------------------------------------------------------------------- /Support/shared/lib/escape.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | 3 | # escape text to make it useable in a shell script as one “word” (string) 4 | def e_sh(str) 5 | str.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\').gsub(/\n/, "'\n'").sub(/^$/, "''") 6 | end 7 | 8 | # escape text for use in a TextMate snippet 9 | def e_sn(str) 10 | str.to_s.gsub(/(?=[$`\\])/, '\\') 11 | end 12 | 13 | # escape text for use in a TextMate snippet placeholder 14 | def e_snp(str) 15 | str.to_s.gsub(/(?=[$`\\}])/, '\\') 16 | end 17 | 18 | # escape text for use in an AppleScript string 19 | def e_as(str) 20 | str.to_s.gsub(/(?=["\\])/, '\\') 21 | end 22 | 23 | # URL escape a string but preserve slashes (idea being we have a file system path that we want to use with file://) 24 | def e_url(str) 25 | str.gsub(/([^a-zA-Z0-9\/_.-]+)/n) do 26 | '%' + $1.unpack('H2' * $1.size).join('%').upcase 27 | end 28 | end 29 | 30 | # Make string suitable for display as HTML, preserve spaces. Set :no_newline_after_br => true 31 | # to cause “\n” to be substituted by “
” instead of “
\n” 32 | def htmlize(str, opts = {}) 33 | str = str.to_s.gsub("&", "&").gsub("<", "<") 34 | str = str.gsub(/\t+/, '\0') 35 | str = str.gsub(/(^ +)|( )( +)/) { "#$2#{' ' * ($1 || $3).length}" } 36 | if opts[:no_newline_after_br].nil? 37 | str.gsub("\n", "
\n") 38 | else 39 | str.gsub("\n", "
") 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /Support/shared/lib/webpreview.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Version 3 (2006-08-14) - by Soryu 4 | # 5 | # This file contains support functions for generating HTML, to be used with TextMate's HTML output window. Please don't put functions in here without coordinating the core Bundle developers on IRC. 6 | # 7 | # Further Notes: 8 | # This is in flux right (see http://macromates.com/wiki/Suggestions/StylingHTMLOutput) now as I'm updating the Web Preview (HTML output). `html.sh` is the old version. To make for a smooth transition I threw out all the old (now partly incompatible and as I see it hardly used) functions and kind of started from scratch. 9 | 10 | # Generate HTML header up to and including the body tag. Also includes the default stylesheet and javascript. 11 | # USAGE: html_header [page title] [page info, like Bundle Name, shown at the top right] 12 | html_header() { 13 | case ${#@} in 14 | 1) export WINDOW_TITLE="$1"; export PAGE_TITLE="$1"; ;; 15 | 2) export WINDOW_TITLE="$1"; export PAGE_TITLE="$1"; export SUB_TITLE="$2";; 16 | 3) export WINDOW_TITLE="$1"; export PAGE_TITLE="$2"; export SUB_TITLE="$3";; 17 | esac 18 | 19 | ruby18 -r"$TM_SUPPORT_PATH/lib/web_preview.rb" <<-'RUBY' 20 | puts html_head( 21 | :window_title => ENV['WINDOW_TITLE'], 22 | :page_title => ENV['PAGE_TITLE'], 23 | :sub_title => ENV['SUB_TITLE'] 24 | ) 25 | RUBY 26 | } 27 | 28 | # Generate HTML footer. 29 | # USAGE: html_footer 30 | html_footer() { 31 | echo $' \n\n' 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Support/shared/lib/tm/detach.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 4 | require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" 5 | 6 | module TextMate 7 | class << self 8 | def detach(&block) 9 | pid = fork do 10 | STDOUT.reopen(open('/dev/null', 'w')) 11 | STDERR.reopen(open('/dev/null', 'w')) 12 | 13 | begin 14 | block.call 15 | rescue SystemExit => e 16 | # not sure why this is an exception!?! 17 | rescue Exception => e 18 | TextMate::UI.alert(:warning, "Error Running Command", "The script failed with the following exception:\n\n#{pretty_print_exception e}", "OK") 19 | end 20 | end 21 | Process.detach(pid) 22 | end 23 | 24 | def pretty_print_exception(e) 25 | str = "#{e.class.name}: #{e.message.sub(/`(\w+)'/, '‘\1’').sub(/ -- /, ' — ')}\n\n" 26 | 27 | e.backtrace.each do |b| 28 | if b =~ /(.*?):(\d+)(?::in\s*`(.*?)')?/ then 29 | file, line, method = $1, $2, $3 30 | display_name = File.basename(file) 31 | str << "At line #{line} in ‘#{display_name}’ " 32 | str << (method ? "(inside method ‘#{method}’)" : "(top level)") 33 | str << "\n" 34 | end 35 | end 36 | 37 | str 38 | end 39 | end 40 | end 41 | 42 | if __FILE__ == $0 43 | TextMate::detach { 44 | sleep 1 45 | gafung 46 | } 47 | 48 | TextMate::detach { 49 | sleep 5 50 | File.open('/tmp/this/is/not/here') 51 | } 52 | end 53 | -------------------------------------------------------------------------------- /Support/shared/lib/ruby1.9/add_1.8_features.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # This file adds features that were present in Ruby 1.8 but that have been 4 | # removed in 1.9. It should only be used on externally run programs. 5 | 6 | # vendor/rcodetools/lib/rcodetools/xmpfilter.rb assumes String 7 | # is enumerable, and that it has grep and friends 8 | 9 | if RUBY_VERSION >= "1.9" 10 | class String 11 | def grep(*args) 12 | each_line.grep(*args) 13 | end 14 | 15 | def reject(&block) 16 | each_line.reject(&block) 17 | end 18 | 19 | def map(&block) 20 | each_line.map(&block) 21 | end 22 | 23 | def inject(*args, &block) 24 | each_line.inject(*args, &block) 25 | end 26 | end 27 | end 28 | 29 | if $0 == __FILE__ 30 | require 'test/unit' 31 | 32 | class TestStringExtensions < Test::Unit::TestCase 33 | 34 | def test_basic_grep 35 | str = "a\nb\nc\nd" 36 | assert_equal(["c\n"], str.grep(/c/)) 37 | assert_equal([], str.grep(/x/)) 38 | end 39 | def test_multi_grep 40 | assert_equal(["cat\n", "car"], "dog\ncat\nfred\ncar".grep(/a/)) 41 | end 42 | 43 | def test_basic_reject 44 | str = "a\nb\nc\nd" 45 | assert_equal(["a\n", "b\n", "d"], str.reject {|l| l =~ /c/}) 46 | assert_equal(["a\n", "b\n", "c\n", "d"], str.reject {|l| l =~ /x/}) 47 | end 48 | def test_multi_reject 49 | str = "a\nb\nc\nd" 50 | assert_equal(["a\n", "d"], str.reject {|l| l =~ /[bc]/}) 51 | end 52 | 53 | def test_map 54 | str = "a\nb\nc" 55 | assert_equal(["A\n", "B\n", "C"], str.map {|l| l.upcase }) 56 | end 57 | end 58 | end -------------------------------------------------------------------------------- /Support/shared/lib/tm/markdown.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | 3 | module TextMate 4 | module Markdown 5 | module_function 6 | def to_html(str, options = { }) 7 | filters = [ ] 8 | if ENV.has_key?('TM_MARKDOWN_PRE_FILTER') 9 | filters += ENV['TM_MARKDOWN_PRE_FILTER'].split(':').reject{ |s| s == '' } 10 | end 11 | filters << (ENV.has_key?('TM_MARKDOWN') ? '$TM_MARKDOWN' : '"$TM_SUPPORT_PATH/bin/Markdown.pl"') 12 | if ENV.has_key?('TM_MARKDOWN_POST_FILTER') 13 | filters += ENV['TM_MARKDOWN_POST_FILTER'].split(':').reject{ |s| s == '' } 14 | end 15 | 16 | return str if filters.empty? 17 | 18 | IO.popen(filters.join('|'), 'r+') do |io| 19 | Thread.new { io << str; io.close_write } 20 | io.read 21 | end 22 | end 23 | end 24 | end 25 | 26 | if $0 == __FILE__ 27 | include TextMate 28 | 29 | ENV.delete('TM_MARKDOWN') 30 | ENV.delete('TM_MARKDOWN_PRE_FILTER') 31 | ENV.delete('TM_MARKDOWN_POST_FILTER') 32 | puts Markdown.to_html("Standard markdown processor") # =>

Standard markdown processor

33 | 34 | ENV['TM_MARKDOWN'] = "rev" 35 | puts Markdown.to_html("Custom markdown processor") # => rossecorp nwodkram motsuC 36 | 37 | ENV.delete('TM_MARKDOWN') 38 | ENV['TM_MARKDOWN_PRE_FILTER'] = "sed -e 's/ / /g':rev" 39 | ENV.delete('TM_MARKDOWN_POST_FILTER') 40 | puts Markdown.to_html("multiple pre filters") # =>

sretlif erp elpitlum

41 | 42 | ENV['TM_MARKDOWN_PRE_FILTER'] = "rev" 43 | ENV['TM_MARKDOWN_POST_FILTER'] = "tr p '*'" 44 | puts Markdown.to_html("pre and post filtered") # => <*>deretlif tso* dna er* 45 | end 46 | -------------------------------------------------------------------------------- /Support/shared/bin/Markdown-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004, John Gruber 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | * Neither the name "Markdown" nor the names of its contributors may 17 | be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | This software is provided by the copyright holders and contributors "as 21 | is" and any express or implied warranties, including, but not limited 22 | to, the implied warranties of merchantability and fitness for a 23 | particular purpose are disclaimed. In no event shall the copyright owner 24 | or contributors be liable for any direct, indirect, incidental, special, 25 | exemplary, or consequential damages (including, but not limited to, 26 | procurement of substitute goods or services; loss of use, data, or 27 | profits; or business interruption) however caused and on any theory of 28 | liability, whether in contract, strict liability, or tort (including 29 | negligence or otherwise) arising in any way out of the use of this 30 | software, even if advised of the possibility of such damage. 31 | -------------------------------------------------------------------------------- /Support/shared/lib/password.rb: -------------------------------------------------------------------------------- 1 | # Example usage: 2 | # 3 | # require "password" 4 | # 5 | # TextMate.call_with_password({ :user => 'duff', :url => 'http://example.com/blog/xmlrpc.php' }) do |pw| 6 | # pw == "foo" ? :reject_pw : :accept_pw 7 | # end 8 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 9 | require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" 10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate.rb" 11 | 12 | module TextMate 13 | 14 | def TextMate.call_with_password(args, &block) 15 | user, url = args[:user], args[:url] 16 | abort "misformed URL #{url}" unless url =~ %r{^(\w+)://([^/]+)(.*?/?)[^/]*$} 17 | proto, host, path = $1, $2, $3 18 | 19 | action = :reject_pw 20 | 21 | rd, wr = IO.pipe 22 | if pid = fork 23 | wr.close 24 | Process.waitpid(pid) 25 | else 26 | STDERR.reopen(wr) 27 | STDOUT.reopen('/dev/null', 'r') 28 | rd.close; wr.close 29 | exec(['/usr/bin/security', TextMate.app_path + "/Contents/MacOS/TextMate"], 'find-internet-password', '-g', '-a', user, '-s', host, '-r', proto) 30 | end 31 | 32 | action = block.call($1) if rd.gets =~ /^password: "(.*)"$/ 33 | rd.close 34 | 35 | while action == :reject_pw 36 | break unless res = TextMate::UI.request_secure_string(:title => "Enter Password", :prompt => "Enter password for #{user} at #{proto}://#{host}#{path}") 37 | 38 | action = block.call(res) 39 | if action == :accept_pw then 40 | %x{security add-internet-password -a "#{user}" -s "#{host}" -r "#{proto}" -p "#{path}" -w "#{res}"} 41 | end 42 | end 43 | 44 | return action 45 | end 46 | 47 | end 48 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11B26 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | finish_installation 11 | CFBundleIconFile 12 | Sparkle 13 | CFBundleIdentifier 14 | org.andymatuschak.sparkle.finish-installation 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4D177b 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4D177b 39 | LSBackgroundOnly 40 | 1 41 | LSMinimumSystemVersion 42 | 10.6 43 | LSUIElement 44 | 1 45 | NSMainNibFile 46 | MainMenu 47 | NSPrincipalClass 48 | NSApplication 49 | 50 | 51 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/finish_installation.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11B26 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | finish_installation 11 | CFBundleIconFile 12 | Sparkle 13 | CFBundleIdentifier 14 | org.andymatuschak.sparkle.finish-installation 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4D177b 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4D177b 39 | LSBackgroundOnly 40 | 1 41 | LSMinimumSystemVersion 42 | 10.6 43 | LSUIElement 44 | 1 45 | NSMainNibFile 46 | MainMenu 47 | NSPrincipalClass 48 | NSApplication 49 | 50 | 51 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/finish_installation.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11B26 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | finish_installation 11 | CFBundleIconFile 12 | Sparkle 13 | CFBundleIdentifier 14 | org.andymatuschak.sparkle.finish-installation 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 4D177b 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 10K549 33 | DTSDKName 34 | macosx10.6 35 | DTXcode 36 | 0420 37 | DTXcodeBuild 38 | 4D177b 39 | LSBackgroundOnly 40 | 1 41 | LSMinimumSystemVersion 42 | 10.6 43 | LSUIElement 44 | 1 45 | NSMainNibFile 46 | MainMenu 47 | NSPrincipalClass 48 | NSApplication 49 | 50 | 51 | -------------------------------------------------------------------------------- /Support/shared/lib/tm/tempfile.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | 3 | module TextMate 4 | module IO 5 | class << self 6 | # Allows use with a block or without. 7 | # 8 | # Block usage: 9 | # 10 | # Requires a file ext and takes an optional leading name string. 11 | # 12 | # TextMate::IO.tempfile('diff', 'foo') { |file| 13 | # file.write(diff) 14 | # `mate -w #{e_sh(file.path)}` 15 | # } 16 | # 17 | # Note: If you want to use mate to open the result you will need 18 | # to use the -w option. 19 | # 20 | # Standalone usage: 21 | # 22 | # Returns the open file as a file handle, the file will be 23 | # unlinked when the script exits. 24 | # 25 | # file = TextMate::IO.tempfile('diff', 'foo') 26 | # 27 | def tempfile(ext, name=nil) 28 | require 'tmpdir' 29 | 30 | if ENV.has_key?('TM_PID') 31 | unique_id = ENV["TM_PID"].to_i 32 | else 33 | unique_id = ENV['LOGNAME'].sum(10) 34 | end 35 | 36 | begin 37 | file = File.new( 38 | '%s/%s_%s.%s' % [Dir::tmpdir, name || 'untitled', unique_id.to_s(36), ext], 39 | File::RDWR|File::CREAT|File::EXCL, 0600 40 | ) 41 | 42 | file.sync = true 43 | 44 | if block_given? 45 | res = yield(file) 46 | 47 | file.close 48 | File.unlink(file.path) if File.exists?(file.path) 49 | 50 | return res 51 | else 52 | at_exit { 53 | file.close 54 | File.unlink(file.path) if File.exists?(file.path) 55 | } 56 | return file 57 | end 58 | rescue Errno::EEXIST 59 | unique_id += 1 60 | retry 61 | end 62 | end 63 | end 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /Support/shared/bin/ruby18: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script is designed for backwards compatibility with bundle items that 4 | # were designed for ruby 1.8. It passes the input along to ruby 1.8 if already 5 | # installed or if needed downloads and installs a copy for TextMates exclusive 6 | # use. This does not affect the system ruby version or any other part of the 7 | # system. 8 | 9 | if [[ -e /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby ]]; then 10 | exec /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby "$@" 11 | elif [[ ! -e ~/Library/Application\ Support/TextMate/Ruby/1.8.7/bin/ruby ]]; then 12 | token=$("$DIALOG" -ap '{ title = "Preparing Ruby"; summary = "Please wait while ruby 1.8 is prepared for use…"; isIndeterminate = 1; }' "ProgressDialog.nib") 13 | "$DIALOG" -t "$token" -p '{ progressAnimate = 1; }' 14 | 15 | # Remove potentially broken ruby 1.8.7 install 16 | rm -rf ~/Library/Application\ Support/TextMate/Ruby/1.8 17 | 18 | # Start a new error log 19 | echo "Error log:" > ~/Library/Logs/TextMate\ Ruby\ Preparation.log 20 | 21 | # Create directory for installation 22 | mkdir -p ~/Library/Application\ Support/TextMate/Ruby 23 | cd ~/Library/Application\ Support/TextMate/Ruby 24 | 25 | # Download and decompress 26 | /usr/bin/curl -fsSL --connect-timeout 10 https://archive.textmate.org/ruby/ruby_1.8.7.tbz 2>> ~/Library/Logs/TextMate\ Ruby\ Preparation.log | /usr/bin/tar xz -m 2>> ~/Library/Logs/TextMate\ Ruby\ Preparation.log 27 | 28 | "$DIALOG" -x "$token" 29 | 30 | if [[ ! -e ~/Library/Application\ Support/TextMate/Ruby/1.8.7/bin/ruby ]]; then 31 | echo >&2 "Unable to install ruby 1.8. Please try again or contact support if issue persists." 32 | cat >&2 ~/Library/Logs/TextMate\ Ruby\ Preparation.log 33 | exit 1 34 | fi 35 | 36 | # Remove error log 37 | unlink ~/Library/Logs/TextMate\ Ruby\ Preparation.log 38 | 39 | # Return to previous directory 40 | cd - &>/dev/null 41 | fi 42 | 43 | exec ~/Library/Application\ Support/TextMate/Ruby/1.8.7/bin/ruby -r"$TM_SUPPORT_PATH/private/ruby18_fix_loadpath.rb" "$@" 44 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 11E53 7 | CFBundleDevelopmentRegion 8 | en_US 9 | CFBundleExecutable 10 | cocoaDialog 11 | CFBundleIconFile 12 | cocoadialog 13 | CFBundleIdentifier 14 | com.cocoaDialog 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | cocoaDialog 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 3.0-beta7 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 3.0.0-beta7 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 4D502 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 10K549 35 | DTSDKName 36 | macosx10.6 37 | DTXcode 38 | 0421 39 | DTXcodeBuild 40 | 4D502 41 | LSMinimumSystemVersion 42 | 10.4 43 | LSMinimumSystemVersionByArchitecture 44 | 45 | i386 46 | 10.4 47 | ppc 48 | 10.4 49 | ppc64 50 | 10.5 51 | x86_64 52 | 10.6 53 | 54 | LSUIElement 55 | 1 56 | NSMainNibFile 57 | MainMenu 58 | NSPrincipalClass 59 | NSApplication 60 | SUEnableAutomaticChecks 61 | 62 | SUPublicDSAKeyFile 63 | dsa_pub.pem 64 | 65 | 66 | -------------------------------------------------------------------------------- /Support/shared/bin/man2html: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 -wKU 2 | 3 | sect, word = *ARGV 4 | page = %x{ man #{sect} #{word}|col -b } 5 | 6 | if page =~ /^([A-Za-z0-9_.\-]+)\(\d\)/ 7 | name = $1.downcase 8 | else 9 | name = '(unknown)' 10 | end 11 | 12 | STDOUT << [0xFEFF].pack("U*") # Output UTF-8 ByteOrderMark since this is the only way I have been able to make WebKit show the file as UTF-8. It ignores the tag and it also ignores the com.apple.TextEncoding extended attribute. 13 | 14 | STDOUT << <<-HTML 15 | 16 | 17 | 18 | Documentation for “#{word}” 19 | 25 | 26 | 27 | HTML 28 | 29 | 30 | toc = [ ] 31 | see_also = [ ] 32 | 33 | page.gsub!(/&/, '&') 34 | page.gsub!(/\n

#{$1.capitalize}

\n
" }
38 | page.gsub!(/\b([a-z0-9_.\-]+)\((\d)\)/) { see_also << [ $1, $2 ]; "#$1(#$2)" }
39 | 
40 | STDOUT << "
\n" 41 | 42 | STDOUT << "\n" 46 | 47 | STDOUT << "\n" 51 | 52 | STDOUT << "

#{name}

" 53 | STDOUT << "
\n" 54 | STDOUT << "
\n"
55 | 
56 | STDOUT << page
57 | 


--------------------------------------------------------------------------------
/Support/shared/lib/bash_init.sh:
--------------------------------------------------------------------------------
 1 | unset BASH_ENV # avoid recursively running this script
 2 | export LC_CTYPE="en_US.UTF-8"
 3 | 
 4 | set +u # avoid warning when we use unset variables (if user had ‘set -u’ in his profile)
 5 | 
 6 | if [[ -d "$TM_SUPPORT_PATH/bin" ]]; then
 7 | 	PATH="$PATH:$TM_SUPPORT_PATH/bin"
 8 | 	if [[ -d "$TM_SUPPORT_PATH/bin/CocoaDialog.app/Contents/MacOS" ]]; then
 9 | 		PATH="$TM_SUPPORT_PATH/bin/CocoaDialog.app/Contents/MacOS:$PATH"
10 | 	fi
11 | fi
12 | 
13 | if [[ -d "$TM_BUNDLE_SUPPORT" && -d "$TM_BUNDLE_SUPPORT/bin" ]]; then
14 |    PATH="$TM_BUNDLE_SUPPORT/bin:$PATH"
15 | fi
16 | 
17 | export PATH
18 | 
19 | : ${TM_BASH_INIT:=$HOME/Library/Application Support/TextMate/bash_init.sh}
20 | if [[ -f "$TM_BASH_INIT" ]]; then
21 | 	. "$TM_BASH_INIT"
22 | fi
23 | 
24 | export RUBYLIB="${RUBYLIB:+$RUBYLIB:}$TM_SUPPORT_PATH/lib"
25 | 
26 | textmate_init () {
27 | 	[[ "$1" != / && "$1" != ~ ]] && textmate_init "$(dirname "$1")"
28 | 	[[ -f "$1/.textmate_init" ]] && . "$1/.textmate_init"
29 | 	[[ "$1" == / && -f ~/.textmate_init ]] && . ~/.textmate_init
30 | }
31 | textmate_init "${TM_DIRECTORY:-$HOME}"
32 | 
33 | # an abstract way to change the output option of the running command
34 | exit_discard ()					   {                   exit 200; }
35 | exit_replace_text ()				   { echo -n "$1";     exit 201; }
36 | exit_replace_document ()		   { echo -n "$1";     exit 202; }
37 | exit_insert_text ()				   { echo -n "$1";     exit 203; }
38 | exit_insert_snippet ()			   { echo -n "$1";     exit 204; }
39 | exit_show_html ()					   { echo -n "$1";     exit 205; }
40 | exit_show_tool_tip ()			   { echo -n "$1" >&1; exit 206; }
41 | exit_create_new_document ()	   { echo -n "$1";     exit 207; }
42 | exit_insert_snippet_no_indent () { echo -n "$1";     exit 208; }
43 | 
44 | # force TM to refresh current file and project drawer
45 | rescan_project () { true; }
46 | 
47 | # use this as a filter (|pre) when you want
48 | # raw output to show as such in the HTML output
49 | pre () {
50 | 	echo -n '
'
51 | 	perl -pe '$| = 1; s/&/&/g; s//>/g; s/$\\n/
/' 52 | echo '
' 53 | } 54 | 55 | # this will check for the presence of a command and 56 | # prints an (HTML) error + exists if it's not there 57 | require_cmd () { 58 | if ! type -p "$1" >/dev/null; then 59 | cat <Couldn't find $1 61 | ${2:+

$2

} 62 |

Locations searched:

63 |

64 | ${PATH//:/
65 | }
66 | 

67 | HTML 68 | exit_show_html; 69 | fi 70 | } 71 | -------------------------------------------------------------------------------- /Support/shared/bin/checknest.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 2 | # 3 | # Program to check and fix nested blocks. 4 | # By Sune Foldager, 2005. 5 | # 6 | # USAGE: checknest [options] 7 | # 8 | # -n: Evaluate nesting at the line number given. Otherwise at EOF. 9 | # -l: Consider up to the given number of open blocks. 10 | # Defaults to 1. Set to -1 to consider all. 11 | # -e: If a spurious close-tag is encoutered, substitute line with this. 12 | # -p: Pass file thru, don't just output the close text. 13 | # -d: Debugging: print out the line number and current stack, 14 | # whenever an opening or closing tag is found. 15 | # 16 | # and -e can use $n to substitute tag captures. 17 | # 18 | 19 | 20 | # Collect necessary arguments. 21 | if ARGV.size < 3 22 | puts 'USAGE: checknest [options]' 23 | exit 24 | end 25 | begin 26 | open_match = Regexp.new ARGV[0] 27 | close_match = Regexp.new ARGV[1] 28 | open_or_close_match = Regexp.new("%s|%s" % ARGV) 29 | close_text = ARGV[2] 30 | rescue 31 | puts 'ERROR: Ill-formed regex in open or close tag.' 32 | exit 1 33 | end 34 | 35 | # Collect options. 36 | num = nil 37 | levels = 1 38 | error_text = nil 39 | pass = false 40 | debug = false 41 | ARGV[3..-1].each {|e| 42 | case e 43 | when /^-n(\d+)$/ then num = $1.to_i 44 | when /^-l(\d+)$/ then levels = $1.to_i 45 | when /^-e(.+)$/ then error_text = $1 46 | when /^-p$/ then pass = true 47 | when /^-d$/ then debug = true 48 | end 49 | } 50 | 51 | # Do the nesting thang. 52 | stack = [] 53 | line = 1 54 | while (!num or line 0 and e = stack.pop 78 | print close_text.gsub(/\$(\d)/) {e[$1.to_i]} 79 | levels -= 1 80 | print "\n" if levels > 0 and not stack.empty? 81 | end 82 | 83 | # Dump rest of file, if requested. 84 | if pass and s = $stdin.gets(nil) 85 | print s 86 | end 87 | 88 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Resources/Changelog: -------------------------------------------------------------------------------- 1 | 2.1.1 April 26, 2006 2 | - Implemented --packages-as-directories in fileselect. 3 | 4 | 2.1.0 Feb 26, 2006 5 | - Compiled as a Universal Binary 6 | - Intelligent resizing to accommodate --informative-text in 7 | all inputbox dialogs, all msgbox dialogs, and textbox. 8 | Same for --text in all dropdown dialogs. 9 | - New "filesave" dialogs 10 | - Added --packages-as-directories option to fileselect. 11 | - Added --x-placement and --y-placement to bubble. 12 | 13 | 2.0.0 Jan 2, 2006 14 | - Added bubble dialog. 15 | - Added secure modes for inputbox and standard-inputbox. 16 | - The application now runs as a background app. This means no more annoying 17 | menu or dock icon! 18 | - Some dialogs can be floated above all other applications. 19 | - Timeouts on several dialogs. 20 | - Intelligent button resizing 21 | - Added custom icon support to msgbox, ok-msgbox, and standard-msgbox. 22 | - Added --help options (still needs improvement). 23 | - Added --select-only-directories to fileselect. 24 | - Restructured project directory, code hierarchy, and refactored much of the code. 25 | - Cleaned up the look of several dialogs. 26 | - Progressbar won't be displayed right away, to prevent showing for 27 | very short operations. 28 | - Bug fixes (string-input on inputboxes, missing deallocs). 29 | - New application icon. 30 | 31 | 1.2.2 32 | - (Didn't release) 33 | - Allan's patch 34 | 35 | 1.2.1 Jan, 2005 36 | - (Did I even release this?). 37 | - Wout's patch: 38 | added --no-show, --float, --timeout and --help options 39 | turned into a background app so that the dialog icon does not show 40 | up in the menu bar. This, together with float, is very useful for 41 | loginhooks. 42 | 43 | 1.2.0 Dec 28, 2004 44 | - added dropdown and standard-dropdown controls. 45 | 46 | 1.1.3 May 11, 2004 47 | - fixed handling of multi-line input to progressbar. 48 | 49 | 1.1.2 May 10, 2004 50 | - fixed crash that would occur when printing return values containing 51 | non-Roman characters. Thanks to Nobumi Iyanaga for finding this. 52 | - added "debug" class method to CDControl and got rid of those 53 | printf()s. 54 | 55 | 1.1.1 April 26, 2004 56 | - starting to use x.y.z versioning (instead of x.y) 57 | - progressbar incorrectly printed error with --debug 58 | (runControlFromOptions: always returned nil, which should only happen 59 | on error). This has been fixed. 60 | - progressbar character encoding bug fixed. should now properly handle 61 | UTF8 labels read from stdin. see bug 942012 on sf.net page. thanks to 62 | J-F Boquillard for finding and fixing this. 63 | 64 | 1.1 65 | - added inputbox, standard-inputbox 66 | - textbox window no longer closes on escape unless there's a "Cancel" 67 | button 68 | - fixed error handling for textbox when --text-from-file file is 69 | invalid. 70 | 71 | 1.0 72 | - initial release 73 | 74 | -------------------------------------------------------------------------------- /Support/shared/lib/shelltokenize.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | # 3 | # String helpers for build command tokenization. 4 | # 5 | class String 6 | 7 | # strscan was not bundled with Ruby 1.6, so we need to roll our own. 8 | # This is actually not much more code than the equivalent strscan code, 9 | # I believe, but it's more intricate than a strscan version would be. 10 | def next_token 11 | out_token = "" 12 | state = :normal 13 | 14 | self.slice(@happy_token_offset...self.length).each_byte do |byte| 15 | 16 | char = byte.chr 17 | 18 | @happy_token_offset += 1 19 | 20 | case state 21 | when :singlequote 22 | if char == '\'' 23 | state = :normal 24 | else 25 | out_token += char 26 | end 27 | when :doublequote 28 | if char == '"' 29 | state = :normal 30 | else 31 | out_token += char 32 | end 33 | when :ignore_next 34 | out_token += char 35 | state = :normal 36 | when :normal 37 | state = case char 38 | when '\\' 39 | :ignore_next 40 | when '\'' 41 | :singlequote 42 | when '"' 43 | :doublequote 44 | when /\s/ 45 | break 46 | else 47 | out_token += char 48 | :normal 49 | end 50 | end 51 | end 52 | 53 | out_token 54 | end 55 | 56 | # return a list of tokens. 57 | # Token delimiters are double-quotes and whitespace, except for whitespace within double-quotes. 58 | def tokenize 59 | out_tokens = Array.new 60 | 61 | @happy_token_offset = 0 62 | until @happy_token_offset >= (self.length - 1) 63 | out_tokens << next_token 64 | end 65 | 66 | out_tokens.reject {|token| token.empty? } 67 | end 68 | 69 | # insert escape sequences where needed 70 | def quote_filename_for_shell 71 | outname = "" 72 | self.each_byte do |byte| 73 | char = byte.chr 74 | case char 75 | when /[^\w_\-\+=\/\x7F-\xFF]/ 76 | outname += "\\" 77 | end 78 | outname += char 79 | end 80 | outname 81 | end 82 | 83 | end 84 | 85 | class Array 86 | def quote_for_shell_arguments 87 | self.collect{|path| path.quote_filename_for_shell}.join(" ") 88 | end 89 | end 90 | 91 | module TextMate 92 | 93 | # parse TM environment variables 94 | def TextMate.selected_paths_array 95 | paths = nil 96 | paths = ENV['TM_SELECTED_FILES'].dup.tokenize if ENV.has_key?('TM_SELECTED_FILES') 97 | 98 | if ENV.has_key?('TM_FILEPATH') and paths.nil? 99 | paths = [ENV['TM_FILEPATH']] 100 | # if paths.nil? 101 | # paths = [ENV['TM_FILEPATH']] 102 | # else 103 | # paths.push ENV['TM_FILEPATH'] 104 | # end 105 | end 106 | 107 | if paths.nil? 108 | paths = [ ] 109 | end 110 | 111 | paths 112 | end 113 | 114 | def TextMate.selected_paths_for_shell 115 | selected_paths_array.quote_for_shell_arguments 116 | end 117 | 118 | end 119 | -------------------------------------------------------------------------------- /Support/shared/lib/dialog.py: -------------------------------------------------------------------------------- 1 | from types import NoneType 2 | import sys 3 | import os 4 | import subprocess 5 | 6 | tm_support_path = os.environ['TM_SUPPORT_PATH'] + '/lib' 7 | if tm_support_path not in sys.path: 8 | sys.path.insert(0, tm_support_path) 9 | 10 | from tm_helpers import to_plist, from_plist 11 | 12 | dialog = os.environ["DIALOG"] 13 | nib_path = os.environ['TM_SUPPORT_PATH'] + '/nibs' 14 | 15 | try: 16 | all 17 | except: 18 | def all(items): 19 | for item in items: 20 | if not item: 21 | return False 22 | return True 23 | 24 | def item(val): 25 | if isinstance(val, basestring): 26 | return {"title": val} 27 | if isinstance(val, tuple): 28 | return {"title": val[0]} 29 | elif val is None: 30 | return {"separator": 1} 31 | 32 | def all_are_instance(it, typ): 33 | return all([isinstance(i, typ) for i in it]) 34 | 35 | def menu(options): 36 | """ Accepts a list and causes TextMate to show an inline menu. 37 | 38 | If options is a list of strings, will return the selected index. 39 | 40 | If options is a list of (key, value) tuples, will display "key" and 41 | return "value". Note that we don't use dicts, so that key-value options 42 | can be ordered. If you want to use a dict, try dict.items(). 43 | 44 | In either input case, a list item with value `None` causes tm_dialog to 45 | display a separator for that index. 46 | """ 47 | hashed_options = False 48 | if not options: 49 | return None 50 | menu = dict(menuItems=[item(thing) for thing in options]) 51 | if all_are_instance(options, (tuple, NoneType)): 52 | hashed_options = True 53 | plist = to_plist(menu) 54 | proc = subprocess.Popen([dialog, '-u'], stdout=subprocess.PIPE, stdin=subprocess.PIPE) 55 | proc.stdin.write(plist) 56 | output, _ = proc.communicate() 57 | result = from_plist(output) 58 | if not 'selectedIndex' in result: 59 | return None 60 | index = int(result['selectedIndex']) 61 | if hashed_options: 62 | return options[index][1] 63 | return options[index] 64 | 65 | def get_string(**options): 66 | """Get a string using dialog 67 | 68 | Accepts: 69 | - `title` - The string to show in the title bar 70 | - `prompt` - The label for the text field 71 | - `string` - The default value inside the text field 72 | 73 | Returns: 74 | - The string entered by the user. 75 | """ 76 | 77 | # Set defaults and get options: 78 | if not options.has_key('title'): 79 | options['title']='Enter String' 80 | if not options.has_key('prompt'): 81 | options['prompt']='String:' 82 | if not options.has_key('string'): 83 | options['string']='' 84 | plist = to_plist(options) 85 | 86 | # Run dialog, piping our plist in, and reading the output: 87 | nib = nib_path + '/RequestString' 88 | proc = subprocess.Popen([dialog, '-cm', nib], 89 | stdout=subprocess.PIPE, stdin=subprocess.PIPE) 90 | proc.stdin.write(plist) 91 | output, _ = proc.communicate() 92 | 93 | # Extract exit value: 94 | result = from_plist(output) 95 | if not 'result' in result: 96 | return None 97 | else: 98 | return result['result'].get('returnArgument') 99 | -------------------------------------------------------------------------------- /Support/shared/lib/tm_helpers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: UTF-8 -*- 3 | """ 4 | tm_helpers.py 5 | 6 | A collection of useful helper functions and classes for writing 7 | commands in Python for TextMate. 8 | """ 9 | import sys 10 | from re import sub, compile as compile_ 11 | from os import popen, path, environ as env 12 | 13 | # fix up path 14 | # tm_support_path = path.join(env["TM_SUPPORT_PATH"], "lib") 15 | # if not tm_support_path in env: 16 | # sys.path.insert(0, tm_support_path) 17 | 18 | from plistlib import writePlistToString, readPlistFromString 19 | 20 | # alias the plistlib functions, we will replace these 21 | # with PyObjC when it becomes available. 22 | to_plist = writePlistToString 23 | from_plist = readPlistFromString 24 | 25 | def current_word(pat, direction="both"): 26 | """ Return the current word from the environment. 27 | 28 | pat – A regular expression (as a raw string) matching word characters. 29 | Typically something like this: r"[A-Za-z_]*". 30 | direction – One of "both", "left", "right". The function will look in 31 | the specified directions for word characters. 32 | """ 33 | word = "" 34 | if "TM_SELECTED_TEXT" in env: 35 | word = env["TM_SELECTED_TEXT"] 36 | elif "TM_CURRENT_WORD" in env and env["TM_CURRENT_WORD"]: 37 | line, x = env["TM_CURRENT_LINE"], int(env["TM_LINE_INDEX"]) 38 | # get text before and after the index. 39 | first_part, last_part = line[:x], line[x:] 40 | word_chars = compile_(pat) 41 | m = word_chars.match(first_part[::-1]) 42 | if m and direction in ("left", "both"): 43 | word = m.group(0)[::-1] 44 | m = word_chars.match(last_part) 45 | if m and direction in ("right", "both"): 46 | word += m.group(0) 47 | return word 48 | 49 | def env_python(): 50 | """ Return (python, version) from env. 51 | 52 | Checks for the environment variable TM_FIRST_LINE and parses 53 | it for a #!. Failing that, checks for the environment variable 54 | TM_PYTHON. Failing that, uses "/usr/bin/env python". 55 | """ 56 | python = "" 57 | if "TM_FIRST_LINE" in env: 58 | first_line = env["TM_FIRST_LINE"] 59 | hash_bang = compile_(r"^#!(.*)$") 60 | m = hash_bang.match(first_line) 61 | if m: 62 | python = m.group(1) 63 | version_string = sh(python + " -S -V 2>&1") 64 | if version_string.startswith("-bash:"): 65 | python = "" 66 | if not python and "TM_PYTHON" in env: 67 | python = env["TM_PYTHON"] 68 | elif not python: 69 | python = "/usr/bin/env python" 70 | version_string = sh(python + " -S -V 2>&1") 71 | version = version_string.strip().split()[1] 72 | version = int(version[0] + version[2]) 73 | return python, version 74 | 75 | def sh(cmd): 76 | """ Execute `cmd` and capture stdout, and return it as a string. """ 77 | result = "" 78 | pipe = None 79 | try: 80 | pipe = popen(cmd) 81 | result = pipe.read() 82 | finally: 83 | if pipe: pipe.close() 84 | return result 85 | 86 | def sh_escape(s): 87 | """ Escape `s` for the shell. """ 88 | return sub(r"(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])", r'\\', s).replace("\n", "'\n'") 89 | -------------------------------------------------------------------------------- /Support/shared/lib/io.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 3 | 4 | module TextMate 5 | module IO 6 | 7 | @sync = false 8 | @blocksize = 4096 9 | 10 | class << self 11 | 12 | attr_accessor :sync 13 | def sync?; @sync end 14 | 15 | attr_accessor :blocksize 16 | 17 | def exhaust(named_fds, &block) 18 | 19 | leftovers = {} 20 | named_fds = named_fds.dup 21 | named_fds.delete_if { |key, value| value.nil? } 22 | named_fds.each_key {|k| leftovers[k] = "" } 23 | 24 | until named_fds.empty? do 25 | 26 | fd = select(named_fds.values)[0][0] 27 | 28 | name = named_fds.find { |key, value| fd == value }.first 29 | data = fd.sysread(@blocksize) rescue "" 30 | 31 | if data.to_s.empty? then 32 | named_fds.delete(name) 33 | fd.close 34 | 35 | elsif not sync? 36 | if data =~ /\A(.*\n|)([^\n]*)\z/m 37 | if $1 == "" 38 | leftovers[name] += $2 39 | next 40 | end 41 | lines = leftovers[name].to_s + $1 42 | leftovers[name] = $2 43 | case block.arity 44 | when 1 then lines.each_line { |line| block.call(line) } 45 | when 2 then lines.each_line { |line| block.call(line, name) } 46 | end 47 | else 48 | raise "Malformed script output (most likely not UTF-8): ‘#{data.to_s}’" 49 | end 50 | 51 | elsif sync? 52 | case block.arity 53 | when 1 then block.call(data) 54 | when 2 then block.call(data, name) 55 | end 56 | 57 | end 58 | end 59 | 60 | # clean up the crumbs 61 | if not sync? 62 | leftovers.delete_if {|name,crumb| crumb == ""} 63 | case block.arity 64 | when 1 then leftovers.each_pair { |name, crumb| block.call(crumb) } 65 | when 2 then leftovers.each_pair { |name, crumb| block.call(crumb, name) } 66 | end 67 | end 68 | 69 | end 70 | 71 | end 72 | 73 | end 74 | end 75 | 76 | # interactive unit tests 77 | if $0 == __FILE__ 78 | require "open3" 79 | #TextMate::IO.sync = false 80 | #TextMate::IO.blocksize = 1 81 | 82 | puts "1=== Line by Line" 83 | stdin, stdout, stderr = Open3.popen3("echo 'foo\nbar'; echo 1>&2 bar; echo fud") 84 | TextMate::IO.exhaust(:out => stdout, :err => stderr) do |data, type| 85 | puts "#{type}: “#{data.rstrip}”" 86 | end 87 | 88 | puts "2---" 89 | stdin, stdout, stderr = Open3.popen3('echo oof; echo 1>&2 rab; echo duf') 90 | TextMate::IO.exhaust(:out => stdout, :err => stderr) do |data| 91 | puts "“#{data.rstrip}”" 92 | end 93 | 94 | # check that everything still works with sync enabled. 95 | TextMate::IO.sync = true 96 | 97 | puts "3=== Streaming" 98 | stdin, stdout, stderr = Open3.popen3("echo 'foo\nbar'; echo 1>&2 bar; echo fud") 99 | TextMate::IO.exhaust(:out => stdout, :err => stderr) do |data, type| 100 | puts "#{type}: “#{data.rstrip}”" 101 | end 102 | 103 | puts "4---" 104 | stdin, stdout, stderr = Open3.popen3('echo oof; echo 1>&2 rab; echo duf') 105 | TextMate::IO.exhaust(:out => stdout, :err => stderr) do |data| 106 | puts "“#{data.rstrip}”" 107 | end 108 | end 109 | -------------------------------------------------------------------------------- /Support/shared/lib/tm/save_current_document.rb: -------------------------------------------------------------------------------- 1 | require "fileutils" 2 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 3 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/tempfile.rb" 4 | 5 | module TextMate 6 | class << self 7 | # 8 | # Calling TextMate.save_current_document ensures that one of the following hold true: 9 | # 1. If TM_FILEPATH is writeable, then the current document is saved. 10 | # In this case, TM_FILEPATH, TM_FILENAME, TM_DISPLAYNAME are left as is. 11 | # 2. If TM_FILEPATH is not writeable, then the contents of the current 12 | # document will be saved in a temporary file. 13 | # In this case: 14 | # TM_FILEPATH, TM_FILENAME reflect the temporary file. 15 | # TM_ORIG_FILEPATH and TM_ORIG_FILENAME will reflect the original unwriteable file. 16 | # TM_DISPLAYNAME will be annotated by (M) to show that the file has not been saved. 17 | # 3. If TM_FILEPATH is unset, the current document has never been saved. 18 | # The current document's content will be saved in a temporary file. 19 | # In this case: 20 | # TM_FILEPATH, TM_FILENAME reflect the temporary file. 21 | # TM_FILE_IS_UNTITLED will be set to “true” 22 | # TM_DISPLAYNAME will be set to “untitled” 23 | # There is a funny case where if a new file file has been created with `mate` but has 24 | # not yet been saved. In this case TM_FILEPATH is set, but no file exists at that 25 | # path. If the directory is writeable, we touch the file and fall through to the 26 | # above cases. If the directory is unwritable, we fall through without action. 27 | # 28 | # TextMate.save_current_document also accepts an optional `temp_ext` argument. If 29 | # a temporary file is used it will have `temp_ext` as it's extension. 30 | # 31 | # Note that this method calls STDIN.read. If you want to access the contents of the 32 | # current document after you've called this method, do File.read(ENV['TM_FILEPATH']). 33 | 34 | def save_if_untitled(temp_ext='tmp') 35 | return unless ENV['TM_FILEPATH'].nil? 36 | 37 | ENV['TM_FILEPATH'] = TextMate::IO.tempfile(temp_ext).path 38 | ENV['TM_FILENAME'] = File.basename(ENV['TM_FILEPATH']) 39 | ENV['TM_FILE_IS_UNTITLED'] = 'true' 40 | 41 | begin 42 | Dir.chdir(File.dirname(ENV["TM_FILEPATH"])) 43 | open(ENV['TM_FILEPATH'], 'w') { |io| io << STDIN.read } 44 | rescue e 45 | abort "Failed to save document as ‘#{ENV['TM_FILEPATH']}’: #{e}" 46 | end 47 | end 48 | 49 | # DEPRECATED Starting with TextMate 2.0 50 | def save_current_document(temp_ext='tmp') 51 | 52 | doc, dst = STDIN.read, ENV['TM_FILEPATH'] 53 | 54 | unless dst.nil? 55 | FileUtils.touch(dst) unless File.exists?(dst) or not File.writable?(File.dirname(dst)) 56 | return if File.exists?(dst) and File.read(dst) == doc 57 | else 58 | ENV['TM_FILEPATH'] = dst = TextMate::IO.tempfile(temp_ext).path 59 | ENV['TM_FILENAME'] = File.basename dst 60 | ENV['TM_FILE_IS_UNTITLED'] = "true" 61 | Dir.chdir(File.dirname(ENV["TM_FILEPATH"])) 62 | end 63 | 64 | begin 65 | open(dst, 'w') { |io| io << doc } 66 | rescue Errno::EACCES 67 | ENV['TM_ORIG_FILEPATH'] = dst 68 | ENV['TM_ORIG_FILENAME'] = File.basename dst 69 | ENV['TM_FILEPATH'] = dst = TextMate::IO.tempfile(temp_ext).path 70 | ENV['TM_FILENAME'] = File.basename dst 71 | ENV['TM_DISPLAYNAME'] += ' (M)' 72 | end 73 | end 74 | end 75 | end -------------------------------------------------------------------------------- /Support/shared/css/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Default style sheet for commands that output HTML. Please use this (and customize 4 | locally if needed) for all commands, as it will help provide a unified look. 5 | Changes to this document should be coordinated (with me, for instance :-p). 6 | 7 | Most css was originally derived and adapted from the Objective-C bundle. 8 | The color scheme is gray-ish. 9 | 10 | If someone disagrees with the look.. well.. I'm no designer, so let's talk about it 11 | then :-). Especially applies to the authors of the Objective-C bundle from which I 12 | derived much. 13 | 14 | By Sune Foldager. 15 | Version 1, 2005-05-20. 16 | 17 | */ 18 | 19 | 20 | /* General formatting. */ 21 | 22 | body { 23 | font-family: "Lucida Grande", sans-serif; 24 | font-size: 11pt; 25 | } 26 | 27 | h1 { 28 | font-size: 16pt; 29 | text-shadow: #ddd 2px 3px 3px; 30 | } 31 | 32 | hr { 33 | color: #bbb; 34 | margin: 2px; 35 | margin-top: 6px; 36 | margin-bottom: 6px; 37 | background-color: #bbb; 38 | height: 1px; 39 | border: 0px; 40 | } 41 | 42 | pre, code, tt { 43 | font-family: "Bitstream Vera Sans Mono", "Monaco", monospace; 44 | font-size: medium; 45 | } 46 | 47 | /** The “pro” table look (used in Apple’s documentation) 48 | 49 | Example: 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
FirstLast

Allan

Odgaard

62 | 63 | **/ 64 | 65 | .graybox { 66 | border-top: 1px solid #919699; 67 | border-left: 1px solid #919699; 68 | } 69 | .graybox th { 70 | background: #E2E2E2; 71 | border-bottom: 1px solid #919699; 72 | border-right: 1px solid #919699; 73 | font-weight: bold; 74 | padding: 4px 8px 4px 8px; 75 | } 76 | .graybox td { 77 | border-bottom: 1px solid #919699; 78 | border-right: 1px solid #919699; 79 | padding: 4px; 80 | vertical-align: top; 81 | } 82 | .graybox p { 83 | margin: 0; 84 | } 85 | .graybox p + p { 86 | margin-top: 1em; 87 | } 88 | 89 | /* Sidebars and boxes. */ 90 | 91 | div.sideBar { 92 | display: block; 93 | position: relative; 94 | border-left: 2px solid #888; 95 | background: #eee; 96 | color: #888; 97 | padding: 2px; 98 | margin: 3px; 99 | font-size: 10pt; 100 | } 101 | 102 | div.sideBar strong { 103 | color: #555; 104 | } 105 | 106 | div.box { 107 | display: block; 108 | position: relative; 109 | border: 2px solid #888; 110 | background: #eee; 111 | color: #888; 112 | padding: 2px; 113 | margin: 3px; 114 | font-size: 10pt; 115 | } 116 | 117 | div.box strong { 118 | color: #555; 119 | } 120 | 121 | .toggle { 122 | position: absolute; 123 | color: #00a; 124 | top: 0px; 125 | right: 8px; 126 | font-size: 8pt; 127 | margin: 0px; 128 | margin-top: 2px; 129 | margin-bottom: 2px; 130 | } 131 | 132 | .sideBar .toggle { 133 | right: 10px; 134 | } 135 | 136 | .toggle :link, .toggle :visited { 137 | color: #00a; 138 | font-size: 8pt; 139 | } 140 | 141 | .toggle :active { 142 | color: #e00; 143 | } 144 | 145 | .sideBar .details, .box .details { 146 | font-size: 9pt; 147 | } 148 | 149 | .warning { 150 | color: orange; 151 | } 152 | 153 | .error { 154 | color: red; 155 | } 156 | 157 | /* a */ 158 | td.added { 159 | color: green; 160 | background-color: #bbffb3; 161 | } 162 | 163 | /* M */ 164 | td.modified { 165 | color: #eb6400; 166 | background-color: #f7e1ad; 167 | } 168 | 169 | /* D */ 170 | td.deleted { 171 | color: red; 172 | background-color: #f59696; 173 | } 174 | 175 | /* C, !, " */ 176 | td.conflict, td.missing, td.typeconflict { 177 | color: teal; 178 | background-color: #A3CED0; 179 | } 180 | 181 | /* ?, I, X */ 182 | td.unknown, td.ignore, td.external { 183 | color: purple; 184 | background-color: #edaef5; 185 | } 186 | 187 | div.bibtex { 188 | background-color: #EBD3DF; 189 | } 190 | 191 | div.mkindex { 192 | background-color: #C9EDCC; 193 | } -------------------------------------------------------------------------------- /Support/shared/lib/progress.rb: -------------------------------------------------------------------------------- 1 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 2 | require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" 3 | 4 | module TextMate 5 | 6 | # Call the given block while showing a progress dialog. By default, the progress bar is 7 | # indeterminate/indefinite/'barber pole.' 8 | # 9 | # Note that the cancel button is only available when you provide the :cancel argument, which is 10 | # expected to be a proc. To support the cancel button, the primary block is forked into a new 11 | # process. When the cancel button is pressed, the cancel proc is also executed in the new process. 12 | # At that point, you can Kernel.exit the process directly from the cancel block (as in the code 13 | # above) or set a global variable for orderly shutdown. 14 | # 15 | # TODO: this may need additional work to make cancel detectable from the client script. 16 | def TextMate.call_with_progress( args, &block ) 17 | title = args[:title] || 'Progress' 18 | message = args[:message] || args[:summary] || 'Frobbing the widget...' 19 | details = args[:details] || '' 20 | cancel_proc = args[:cancel] 21 | indeterminate = args[:indeterminate] 22 | indeterminate = true if indeterminate.nil? 23 | return_val = nil 24 | 25 | params = {'title' => title, 26 | 'summary' => message, 27 | 'details' => details, 28 | 'isIndeterminate' => indeterminate, 29 | 'progressAnimate' => true 30 | } 31 | 32 | params['cancelButtonHidden'] = false unless cancel_proc.nil? 33 | 34 | run_block = Proc.new do |d| 35 | if block.arity == 0 36 | block.call 37 | else 38 | block.call(d) 39 | end 40 | end 41 | 42 | UI.dialog('ProgressDialog.nib', params, nil, true) do |dialog| 43 | if cancel_proc.nil? 44 | # if there is no cancel proc, we get no input from the dialog and need not block. 45 | return_val = run_block.call(dialog) 46 | else # not cancel_proc.nil? 47 | 48 | # invoke processing block in one process 49 | run_block_process = Process.pid 50 | # run_block_process = fork do 51 | trap('SIGUSR1'){cancel_proc.call} 52 | # end 53 | 54 | # invoke ui waiting in a second process 55 | ui_process = fork do 56 | begin 57 | dialog.wait_for_input do |params| 58 | # tell the main process to run the cancel_proc 59 | Process.kill('SIGUSR1', run_block_process) if params['returnButton'] == 'Cancel' # FIXME localization problem... 60 | false 61 | end 62 | rescue TextMate::WindowNotFound 63 | # ignore; the window was probably canceled 64 | end 65 | exit! 66 | end 67 | return_val = run_block.call(dialog) 68 | 69 | # hang out until the dialog is done 70 | # Process.wait 71 | end 72 | 73 | # if we do not set the animate state back to NO the progress indicator in the nib will leak and will even consume CPU-time 74 | dialog.parameters = { "progressAnimate" => false } 75 | end 76 | return_val 77 | end 78 | 79 | end 80 | 81 | # test 82 | if __FILE__ == $0 83 | 84 | value = TextMate.call_with_progress(:title =>'Evil', 85 | :summary => 'Is Love...') do 86 | 87 | "this text should appear" 88 | end 89 | puts value 90 | 91 | # indeterminate 92 | TextMate.call_with_progress(:title =>'Now Testing', 93 | :summary => 'Starting Up...') do 94 | 95 | sleep 3 96 | end 97 | 98 | # finite 99 | TextMate.call_with_progress(:title =>'Now Testing', 100 | :summary => 'Starting Up...', 101 | :indeterminate => false, 102 | :cancel => lambda {puts "Canceled!"; exit 0} ) do |dialog| 103 | 104 | sleep 1 105 | dialog.parameters = {'summary' => 'Loving the alien...','progressValue' => 30 } 106 | sleep 1 107 | dialog.parameters = {'summary' => 'Eating the pie...','progressValue' => 60 } 108 | sleep 1 109 | dialog.parameters = {'summary' => 'Vacuuming the rug...','progressValue' => 90 } 110 | sleep 1 111 | dialog.parameters = {'summary' => 'Complete!','progressValue' => 100 } 112 | sleep 2 113 | end 114 | end 115 | -------------------------------------------------------------------------------- /Support/shared/lib/markdown_to_help.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby18 -wKU 2 | # encoding: utf-8 3 | 4 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 5 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" 6 | 7 | class TreeNode 8 | attr_accessor :heading, :attributes, :parent, :level, :count 9 | def initialize(parent = nil, count = 1) 10 | @parent = parent 11 | @level = parent ? parent.level + 1 : 0 12 | @count = count 13 | @child = @next = nil 14 | @heading = nil 15 | end 16 | def index 17 | @parent ? [@parent.index, @count].flatten : [] 18 | end 19 | def to_s 20 | child = @child ? "\n
    \n#{@child}
\n" : '' 21 | entry = @heading ? "
  • #{index.join '.'} #{unanchored_heading}#{child}
  • \n" : child 22 | @next ? entry.to_s + @next.to_s : entry.to_s 23 | end 24 | def new_child 25 | abort "Already has child" if @child 26 | @child = TreeNode.new(self) 27 | end 28 | def new_sibling 29 | @next = TreeNode.new(@parent, @count + 1) 30 | end 31 | def new_heading 32 | "#{index.join '.'} #{@heading}" 33 | end 34 | def unanchored_heading 35 | heading.gsub(/<(.*?)>/) {|innards| innards.gsub(/ id=("|').*?\1/, '') } 36 | end 37 | end 38 | 39 | IO.popen('"$TM_SUPPORT_PATH/bin/Markdown.pl"|"$TM_SUPPORT_PATH/bin/SmartyPants.pl"', "r+") do |io| 40 | 41 | Thread.new { ARGF.each_line { |line| 42 | io << line.gsub(/\[(.+?)\]\(\?(.+?)\)/){ '[' + $1 + '][?' + $2 + ']' + "\n[?" + $2 + "]: help:anchor='" + e_url($2) + "'%20bookID='TextMate%20Help'\n" } 43 | }; io.close_write } 44 | 45 | root = tree_node = TreeNode.new 46 | contents = '' 47 | io.each_line do |line| 48 | if line =~ %r{^(.*)$} then 49 | level = $1.to_i 50 | tree_node = tree_node.parent while tree_node.level > level 51 | tree_node = tree_node.new_child while tree_node.level < level 52 | tree_node = tree_node.new_sibling if tree_node.heading 53 | tree_node.heading = $3 54 | tree_node.attributes = $2 55 | 56 | contents << "\n
    \n" if level == 1 57 | line = tree_node.new_heading 58 | end 59 | line.gsub!(/ 65 | .uplink:hover:after { 66 | content: " ⇞"; 67 | } 68 | 69 | 105 | 106 | HTML 107 | 108 | puts "

    Table of Contents

    " 109 | puts root 110 | puts contents 111 | 112 | puts <<-HTML 113 | 116 | HTML 117 | 118 | end 119 | -------------------------------------------------------------------------------- /Support/shared/lib/tm/process.rb: -------------------------------------------------------------------------------- 1 | # ----------------------- 2 | # TextMate::Process.run() 3 | # ----------------------- 4 | # Method for opening processes under TextMate. 5 | # 6 | # # BASIC USAGE 7 | # 8 | # 1. out, err = TextMate::Process.run("svn", "commit", "-m", "A commit message") 9 | # 10 | # 'out' and 'err' are the what the process produced on stdout and stderr respectively. 11 | # 12 | # 2. TextMate::Process.run("svn", "commit", "-m", "A commit message") do |str, type| 13 | # case type 14 | # when :out 15 | # STDOUT << str 16 | # when :err 17 | # STDERR << str 18 | # end 19 | # end 20 | # 21 | # The block will be called with the output of the process as it becomes available. 22 | # 23 | # 3. TextMate::Process.run("svn", "commit", "-m", "A commit message") do |str| 24 | # STDOUT << str 25 | # end 26 | # 27 | # Similar to 2, except that the type of the output is not passed. 28 | # 29 | # # OPTIONS 30 | # 31 | # The last (non block) argument to run() can be a Hash that will augment the behaviour. 32 | # The available options are (with default values in parenthesis)… 33 | # 34 | # * :granularity (:line) 35 | # 36 | # The size of the buffer to use to read the process output. The value :line 37 | # indicates that output will be passed a line at a time. Any other non integer 38 | # value will result in an unspecified buffer size being used. 39 | # 40 | # * :input (nil) 41 | # 42 | # A string to send to the stdin of the process. 43 | # 44 | # * :env (nil) 45 | # 46 | # A hash of environment variables to set for the process. 47 | # 48 | # NOTES 49 | # 50 | # The following is not valid Ruby… 51 | # 52 | # args = ["commit", "-m", "commit message"] 53 | # TextMate::Process("svn", *args, :buffer => true) 54 | # 55 | # To get around this, arguments to run() are flattened. This allows the 56 | # almost as good version… 57 | # 58 | # args = ["commit", "-m", "commit message"] 59 | # TextMate::Process("svn", args, :buffer => true) 60 | # 61 | 62 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 63 | require "#{ENV['TM_SUPPORT_PATH']}/lib/io.rb" 64 | require 'fcntl' 65 | 66 | def pid_exists?(pid) 67 | %x{ps >/dev/null -xp #{pid}} 68 | $? == 0 69 | end 70 | 71 | def kill_and_wait(pid) 72 | begin 73 | Process.kill("-INT", pid) 74 | 20.times { return unless pid_exists?(pid); sleep 0.02 } 75 | Process.kill("-TERM", pid) 76 | 20.times { return unless pid_exists?(pid); sleep 0.02 } 77 | Process.kill("-KILL", pid) 78 | rescue 79 | # process doesn't exist anymore 80 | end 81 | end 82 | 83 | def setup_kill_handler(pid, &block) 84 | Signal.trap("USR1") do 85 | cmd = %x{/bin/ps -wwp #{pid} -o "command="}.chomp 86 | if $? == 0 87 | block.call("^C: #{cmd} (pid: #{pid})\n", :err) 88 | kill_and_wait(pid) 89 | end 90 | end 91 | end 92 | 93 | module TextMate 94 | module Process 95 | class << self 96 | 97 | def run(*cmd, &block) 98 | 99 | cmd.flatten! 100 | 101 | options = { 102 | :granularity => :line, 103 | :input => nil, 104 | :env => nil, 105 | } 106 | 107 | options.merge! cmd.pop if cmd.last.is_a? Hash 108 | 109 | io = [] 110 | 3.times { io << ::IO::pipe } 111 | io.flatten.each { |fd| fd.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) } 112 | 113 | pid = fork { 114 | at_exit { exit! } 115 | 116 | STDIN.reopen(io[0][0]) 117 | STDOUT.reopen(io[1][1]) 118 | STDERR.reopen(io[2][1]) 119 | 120 | options[:env].each { |k,v| ENV[k] = v } unless options[:env].nil? 121 | Dir.chdir(options[:chdir]) if options.has_key?(:chdir) and File.directory?(options[:chdir]) 122 | ::Process.setsid 123 | exec(*cmd.compact) 124 | } 125 | 126 | Signal.trap("INT") { ::Process.kill("-INT", pid) } 127 | Signal.trap("TERM") { ::Process.kill("-TERM", pid) } 128 | 129 | [ io[0][0], io[1][1], io[2][1] ].each { |fd| fd.close } 130 | 131 | if options[:input].nil? 132 | io[0][1].close 133 | else 134 | Thread.new { (io[0][1] << options[:input]).close } 135 | end 136 | 137 | out = "" 138 | err = "" 139 | 140 | block ||= proc { |str, fd| 141 | case fd 142 | when :out then out << str 143 | when :err then err << str 144 | end 145 | } 146 | 147 | previous_block_size = IO.blocksize 148 | IO.blocksize = options[:granularity] if options[:granularity].is_a? Integer 149 | previous_sync = IO.sync 150 | IO.sync = true unless options[:granularity] == :line 151 | 152 | setup_kill_handler(pid, &block) 153 | 154 | IO.exhaust({ :out => io[1][0], :err => io[2][0] }, &block) 155 | ::Process.waitpid(pid) 156 | 157 | IO.blocksize = previous_block_size 158 | IO.sync = previous_sync 159 | 160 | block_given? ? nil : [out,err] 161 | end 162 | 163 | end 164 | end 165 | end -------------------------------------------------------------------------------- /Support/shared/lib/tm/htmloutput.rb: -------------------------------------------------------------------------------- 1 | # tm/htmloutput.rb 2 | 3 | # Provides an API function in the TextMate namespace TextMate::HTMLOutput.show 4 | # This function expects a block, and basically just calls web_preview's html_header 5 | # before the block is executed, and html_footer after the block is executed. 6 | 7 | # The block itself is given an io object (stdout) to which it can write whatever html it 8 | # would like to have appear between the header and footer. 9 | 10 | # Call it like this: 11 | 12 | # TextMate::HTMLOutput.show(:title => "My Title", :sub_title => "Your subtitle") do |io| 13 | # io << «something something» 14 | # end 15 | 16 | require 'erb' 17 | require 'cgi' 18 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 19 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" 20 | 21 | HTMLOUTPUT_TEMPLATE = <<-HTML 22 | 24 | 25 | 26 | 27 | <%= window_title %> 28 | <%- themes[:screen].each do |theme| -%> 29 | 30 | <%- end -%> 31 | <%- themes[:print].each do |theme| -%> 32 | 33 | <%- end -%> 34 | 35 | 36 | 37 | 38 | <%= html_head -%> 39 | 40 | 41 |
    42 | header 43 |

    <%= page_title %>

    44 |

    <%= sub_title %>

    45 | teaser 46 |
    47 |
    48 |
    49 | Theme: 50 | 55 |
    56 | 59 |
    60 |
    61 |
    62 |
    63 | HTML 64 | 65 | module TextMate 66 | module HTMLOutput 67 | class << self 68 | def show(options = { }, &block) 69 | $stdout << header(options) 70 | $stdout.sync = true 71 | block.call($stdout) 72 | $stdout << footer() 73 | end 74 | 75 | def header(options) 76 | window_title = options[:window_title] || options[:title] || 'Window Title' 77 | page_title = options[:page_title] || options[:title] || 'Page Title' 78 | sub_title = options[:sub_title] || ENV['TM_FILENAME'] || 'untitled' 79 | html_head = options[:html_head] || '' 80 | 81 | if options[:fix_href] && File.exist?(ENV['TM_FILEPATH'].to_s) 82 | html_head << "\n" 83 | end 84 | 85 | themes = collect_themes 86 | 87 | active_theme = find_theme(themes, saved_theme) || find_theme(themes, 'bright') 88 | abort "No web preview theme found.\nMake sure that the Themes bundle is enabled in Preferences → Bundles." if active_theme.nil? 89 | 90 | support_path = ENV['TM_SUPPORT_PATH'] 91 | 92 | ERB.new(HTMLOUTPUT_TEMPLATE, 0, '%-').result(binding) 93 | end 94 | 95 | def footer 96 | "
    \n\n" 97 | end 98 | 99 | private 100 | 101 | def collect_themes 102 | res = { :screen => [ ], :print => [ ] } 103 | seen = [ ] 104 | 105 | paths = ENV['TM_THEME_PATH'].to_s.split(/:/) 106 | paths << "#{ENV['TM_BUNDLE_SUPPORT']}/css" if ENV.has_key? 'TM_BUNDLE_SUPPORT' 107 | paths << "#{ENV['HOME']}/Library/Application Support/TextMate/Themes/Webpreview" 108 | 109 | paths.each do |path| 110 | Dir.foreach(path) do |file| 111 | name = $1.upcase + $2 if file =~ /^(.)(.*)$/ 112 | name = nil if seen.include?(file) || file == 'default' 113 | seen << file 114 | 115 | if File.exist?("#{path}/#{file}/style.css") 116 | res[:screen] << { :name => name, :class => file, :path => "#{path}/#{file}" } 117 | end 118 | 119 | if File.exist?("#{path}/#{file}/print.css") 120 | res[:print] << { :name => name, :class => file, :path => "#{path}/#{file}" } 121 | end 122 | 123 | end if File.exists? path 124 | end 125 | 126 | res 127 | end 128 | 129 | def find_theme(themes, theme) 130 | themes[:screen].find { |e| e[:class] == theme } 131 | end 132 | 133 | def saved_theme 134 | res = %x{ defaults 2>/dev/null read com.macromates.textmate.webpreview SelectedTheme }.chomp 135 | $? == 0 ? res : 'plain' 136 | end 137 | end 138 | end 139 | end 140 | -------------------------------------------------------------------------------- /Support/shared/lib/html.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This file contains support functions for generating HTML, to be used with TextMate's 4 | # HTML output window. Please don't put functions in here without coordinating with me 5 | # or Allan. 6 | # 7 | # Only some basic stuff is included, as well as stuff designed to work with the default 8 | # stylesheet and javascript. 9 | # 10 | # Version 2 (2005-05-23). 11 | # By Sune Foldager. 12 | # 13 | 14 | # Initialization. 15 | _toggleID=1 16 | declare -a _tagStack 17 | 18 | # Types back the arguments if given, or stdin (internal use). 19 | _doArg() { 20 | [ -n "$1" ] && echo -n "$@" || cat 21 | } 22 | 23 | # Generate JavaScript code (i.e. wrap arguments in script tags). A final ; is added. 24 | # USAGE: javaScript 25 | javaScript() { 26 | echo '' 29 | } 30 | 31 | # Import JavaScript code. 32 | # USAGE: importJS 33 | importJS() { 34 | echo '' 37 | } 38 | 39 | # Execute JavaScript code after a delay (in milliseconds). 40 | # USAGE: delayedExec 41 | delayedJS() { 42 | echo -n "" 45 | } 46 | 47 | # Redirect to a given URL. 48 | # USAGE: redirect 49 | redirect() { 50 | javaScript "window.location='$1'" 51 | } 52 | 53 | # Generate CSS (i.e. wrap arguments in style tags). 54 | # USAGE: css 55 | css() { 56 | echo '' 59 | } 60 | 61 | # Import a CSS script. 62 | # USAGE: importCSS 63 | importCSS() { 64 | echo '' 67 | } 68 | 69 | # Generate HTML header up to and including the body tag. Also includes the default 70 | # stylesheet and javascript. 71 | # USAGE: htmlHeader [page title] [optional stuff] 72 | htmlHeader() { 73 | echo '' 74 | echo '' 76 | echo '' 77 | echo '' 78 | [ -n "$1" ] && echo "$1" 79 | importCSS "${TM_SUPPORT_PATH}/css/default.css" 80 | importJS "${TM_SUPPORT_PATH}/script/default.js" 81 | [ -n "$2" ] && echo "$2" 82 | echo '' 83 | } 84 | 85 | # Generate HTML footer. 86 | # USAGE: htmlFooter 87 | htmlFooter() { 88 | echo '' 89 | } 90 | 91 | # Close the HTML window, after a delay (in milliseconds). Defaults to 1 second. 92 | # USAGE: closeWindow [delay in ms] 93 | closeWindow() { 94 | local to=$1 95 | [ ${to:=1000} ] 96 | delayedJS $to 'window.close();' 97 | } 98 | 99 | # Typesets the arguments in tags. 100 | # USAGE: emph 101 | emph() { 102 | echo -n '' 103 | _doArg "$1" 104 | echo '' 105 | } 106 | 107 | # Typesets the arguments in tags. 108 | # USAGE: strong 109 | strong() { 110 | echo -n '' 111 | _doArg "$1" 112 | echo '' 113 | } 114 | 115 | # Creates a link (HTML anchor tag) 116 | # USAGE: link 117 | link() { 118 | echo -n "
    " 119 | _doArg "$2" 120 | echo '' 121 | } 122 | 123 | # Generate a tag, with optional class, id and other attributes. 124 | # USAGE: beginTag [class] [id] [extra] 125 | # endTag 126 | # tag [class] [id] [extra] 127 | beginTag() { 128 | echo -n "<$1" 129 | [ -n "$2" ] && echo -n " class=\"$2\"" 130 | [ -n "$3" ] && echo -n " id=\"$3\"" 131 | [ -n "$4" ] && echo -n " $4" 132 | echo '>' 133 | _tagStack[${#_tagStack[*]}]="$1" 134 | } 135 | endTag() { 136 | if ((${#_tagStack[*]} > 0)); then 137 | local index=$((${#_tagStack[*]} - 1)) 138 | echo -n '' 141 | unset _tagStack[$index] 142 | fi 143 | } 144 | tag() { 145 | beginTag "$1" "$3" "$4" "$5" 146 | _doArg "$2" 147 | endTag 148 | } 149 | 150 | # Creates a toggle tag, and bumps the global ID. Used by the functions below. 151 | # Mainly an internal function; USAGE: makeToggle 152 | makeToggle() { 153 | beginTag div toggle 154 | beginTag span '' "toggle${_toggleID}_s" 'style="display: inline;"' 155 | link "javascript:showElement('toggle${_toggleID}');" 'Show details' 156 | endTag 157 | beginTag span '' "toggle${_toggleID}_h" 'style="display: none;"' 158 | link "javascript:hideElement('toggle${_toggleID}');" 'Hide details' 159 | endTag 160 | endTag 161 | _toggleID=$((_toggleID + 1)) 162 | } 163 | 164 | # Creates a toggle box, which consists of the following: 165 | # - The main box. 166 | # - A show/hide button. 167 | # - A part that is always displayed (called 'brief'). 168 | # - A part initially hidden, but toggleable with the button (called 'details'). 169 | # The box will be left open at the 'details' part. Use toggleBoxE to close it. 170 | # USAGE: beginToggleBox 171 | # endToggleBox 172 | # toggleBox 173 | beginToggleBox() { 174 | local id=$_toggleID 175 | beginTag div "$1" 176 | makeToggle 177 | beginTag div brief 178 | _doArg "$2" 179 | endTag 180 | beginTag div details "toggle${id}_b" 'style="display: none;"' 181 | } 182 | endToggleBox() { 183 | endTag 184 | endTag 185 | } 186 | toggleBox() { 187 | beginToggleBox "$1" "$2" 188 | _doArg "$3" 189 | endToggleBox 190 | } 191 | 192 | # Quick way to create sideBars and boxes (see the default stylesheet). 193 | # Leaves the box open at the 'details' part. 194 | # USAGE: beginSideBar/box 195 | # sideBar/box 196 | beginSideBar() { 197 | beginToggleBox sideBar "$1" 198 | } 199 | endSideBar() { 200 | endToggleBox 201 | } 202 | sideBar() { 203 | toggleBox sideBar "$1" "$2" 204 | } 205 | beginBox() { 206 | beginToggleBox box "$1" 207 | } 208 | endBox() { 209 | endToggleBox 210 | } 211 | box() { 212 | toggleBox box "$1" "$2" 213 | } 214 | 215 | -------------------------------------------------------------------------------- /Support/shared/nibs/SimpleNotificationWindow.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | log 15 | title 16 | summary 17 | nil 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 66 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Resources/SUModelTranslation.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ADP2,1 6 | Developer Transition Kit 7 | iMac1,1 8 | iMac G3 (Rev A-D) 9 | iMac4,1 10 | iMac (Core Duo) 11 | iMac4,2 12 | iMac for Education (17-inch, Core Duo) 13 | iMac5,1 14 | iMac (Core 2 Duo, 17 or 20 inch, SuperDrive) 15 | iMac5,2 16 | iMac (Core 2 Duo, 17 inch, Combo Drive) 17 | iMac6,1 18 | iMac (Core 2 Duo, 24 inch, SuperDrive) 19 | iMac8,1 20 | iMac (April 2008) 21 | MacBook1,1 22 | MacBook (Core Duo) 23 | MacBook2,1 24 | MacBook (Core 2 Duo) 25 | MacBook4,1 26 | MacBook (Core 2 Duo Feb 2008) 27 | MacBookAir1,1 28 | MacBook Air (January 2008) 29 | MacBookAir2,1 30 | MacBook Air (June 2009) 31 | MacBookAir3,1 32 | MacBook Air (October 2010) 33 | MacBookPro1,1 34 | MacBook Pro Core Duo (15-inch) 35 | MacBookPro1,2 36 | MacBook Pro Core Duo (17-inch) 37 | MacBookPro2,1 38 | MacBook Pro Core 2 Duo (17-inch) 39 | MacBookPro2,2 40 | MacBook Pro Core 2 Duo (15-inch) 41 | MacBookPro3,1 42 | MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo) 43 | MacBookPro3,2 44 | MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo) 45 | MacBookPro4,1 46 | MacBook Pro (Core 2 Duo Feb 2008) 47 | Macmini1,1 48 | Mac Mini (Core Solo/Duo) 49 | MacPro1,1 50 | Mac Pro (four-core) 51 | MacPro2,1 52 | Mac Pro (eight-core) 53 | MacPro3,1 54 | Mac Pro (January 2008 4- or 8- core "Harpertown") 55 | MacPro4,1 56 | Mac Pro (March 2009) 57 | MacPro5,1 58 | Mac Pro (August 2010) 59 | PowerBook1,1 60 | PowerBook G3 61 | PowerBook2,1 62 | iBook G3 63 | PowerBook2,2 64 | iBook G3 (FireWire) 65 | PowerBook2,3 66 | iBook G3 67 | PowerBook2,4 68 | iBook G3 69 | PowerBook3,1 70 | PowerBook G3 (FireWire) 71 | PowerBook3,2 72 | PowerBook G4 73 | PowerBook3,3 74 | PowerBook G4 (Gigabit Ethernet) 75 | PowerBook3,4 76 | PowerBook G4 (DVI) 77 | PowerBook3,5 78 | PowerBook G4 (1GHz / 867MHz) 79 | PowerBook4,1 80 | iBook G3 (Dual USB, Late 2001) 81 | PowerBook4,2 82 | iBook G3 (16MB VRAM) 83 | PowerBook4,3 84 | iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003) 85 | PowerBook5,1 86 | PowerBook G4 (17 inch) 87 | PowerBook5,2 88 | PowerBook G4 (15 inch FW 800) 89 | PowerBook5,3 90 | PowerBook G4 (17-inch 1.33GHz) 91 | PowerBook5,4 92 | PowerBook G4 (15 inch 1.5/1.33GHz) 93 | PowerBook5,5 94 | PowerBook G4 (17-inch 1.5GHz) 95 | PowerBook5,6 96 | PowerBook G4 (15 inch 1.67GHz/1.5GHz) 97 | PowerBook5,7 98 | PowerBook G4 (17-inch 1.67GHz) 99 | PowerBook5,8 100 | PowerBook G4 (Double layer SD, 15 inch) 101 | PowerBook5,9 102 | PowerBook G4 (Double layer SD, 17 inch) 103 | PowerBook6,1 104 | PowerBook G4 (12 inch) 105 | PowerBook6,2 106 | PowerBook G4 (12 inch, DVI) 107 | PowerBook6,3 108 | iBook G4 109 | PowerBook6,4 110 | PowerBook G4 (12 inch 1.33GHz) 111 | PowerBook6,5 112 | iBook G4 (Early-Late 2004) 113 | PowerBook6,7 114 | iBook G4 (Mid 2005) 115 | PowerBook6,8 116 | PowerBook G4 (12 inch 1.5GHz) 117 | PowerMac1,1 118 | Power Macintosh G3 (Blue & White) 119 | PowerMac1,2 120 | Power Macintosh G4 (PCI Graphics) 121 | PowerMac10,1 122 | Mac Mini G4 123 | PowerMac10,2 124 | Mac Mini (Late 2005) 125 | PowerMac11,2 126 | Power Macintosh G5 (Late 2005) 127 | PowerMac12,1 128 | iMac G5 (iSight) 129 | PowerMac2,1 130 | iMac G3 (Slot-loading CD-ROM) 131 | PowerMac2,2 132 | iMac G3 (Summer 2000) 133 | PowerMac3,1 134 | Power Macintosh G4 (AGP Graphics) 135 | PowerMac3,2 136 | Power Macintosh G4 (AGP Graphics) 137 | PowerMac3,3 138 | Power Macintosh G4 (Gigabit Ethernet) 139 | PowerMac3,4 140 | Power Macintosh G4 (Digital Audio) 141 | PowerMac3,5 142 | Power Macintosh G4 (Quick Silver) 143 | PowerMac3,6 144 | Power Macintosh G4 (Mirrored Drive Door) 145 | PowerMac4,1 146 | iMac G3 (Early/Summer 2001) 147 | PowerMac4,2 148 | iMac G4 (Flat Panel) 149 | PowerMac4,4 150 | eMac 151 | PowerMac4,5 152 | iMac G4 (17-inch Flat Panel) 153 | PowerMac5,1 154 | Power Macintosh G4 Cube 155 | PowerMac6,1 156 | iMac G4 (USB 2.0) 157 | PowerMac6,3 158 | iMac G4 (20-inch Flat Panel) 159 | PowerMac6,4 160 | eMac (USB 2.0, 2005) 161 | PowerMac7,2 162 | Power Macintosh G5 163 | PowerMac7,3 164 | Power Macintosh G5 165 | PowerMac8,1 166 | iMac G5 167 | PowerMac8,2 168 | iMac G5 (Ambient Light Sensor) 169 | PowerMac9,1 170 | Power Macintosh G5 (Late 2005) 171 | RackMac1,1 172 | Xserve G4 173 | RackMac1,2 174 | Xserve G4 (slot-loading, cluster node) 175 | RackMac3,1 176 | Xserve G5 177 | Xserve1,1 178 | Xserve (Intel Xeon) 179 | Xserve2,1 180 | Xserve (January 2008 quad-core) 181 | 182 | 183 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ADP2,1 6 | Developer Transition Kit 7 | iMac1,1 8 | iMac G3 (Rev A-D) 9 | iMac4,1 10 | iMac (Core Duo) 11 | iMac4,2 12 | iMac for Education (17-inch, Core Duo) 13 | iMac5,1 14 | iMac (Core 2 Duo, 17 or 20 inch, SuperDrive) 15 | iMac5,2 16 | iMac (Core 2 Duo, 17 inch, Combo Drive) 17 | iMac6,1 18 | iMac (Core 2 Duo, 24 inch, SuperDrive) 19 | iMac8,1 20 | iMac (April 2008) 21 | MacBook1,1 22 | MacBook (Core Duo) 23 | MacBook2,1 24 | MacBook (Core 2 Duo) 25 | MacBook4,1 26 | MacBook (Core 2 Duo Feb 2008) 27 | MacBookAir1,1 28 | MacBook Air (January 2008) 29 | MacBookAir2,1 30 | MacBook Air (June 2009) 31 | MacBookAir3,1 32 | MacBook Air (October 2010) 33 | MacBookPro1,1 34 | MacBook Pro Core Duo (15-inch) 35 | MacBookPro1,2 36 | MacBook Pro Core Duo (17-inch) 37 | MacBookPro2,1 38 | MacBook Pro Core 2 Duo (17-inch) 39 | MacBookPro2,2 40 | MacBook Pro Core 2 Duo (15-inch) 41 | MacBookPro3,1 42 | MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo) 43 | MacBookPro3,2 44 | MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo) 45 | MacBookPro4,1 46 | MacBook Pro (Core 2 Duo Feb 2008) 47 | Macmini1,1 48 | Mac Mini (Core Solo/Duo) 49 | MacPro1,1 50 | Mac Pro (four-core) 51 | MacPro2,1 52 | Mac Pro (eight-core) 53 | MacPro3,1 54 | Mac Pro (January 2008 4- or 8- core "Harpertown") 55 | MacPro4,1 56 | Mac Pro (March 2009) 57 | MacPro5,1 58 | Mac Pro (August 2010) 59 | PowerBook1,1 60 | PowerBook G3 61 | PowerBook2,1 62 | iBook G3 63 | PowerBook2,2 64 | iBook G3 (FireWire) 65 | PowerBook2,3 66 | iBook G3 67 | PowerBook2,4 68 | iBook G3 69 | PowerBook3,1 70 | PowerBook G3 (FireWire) 71 | PowerBook3,2 72 | PowerBook G4 73 | PowerBook3,3 74 | PowerBook G4 (Gigabit Ethernet) 75 | PowerBook3,4 76 | PowerBook G4 (DVI) 77 | PowerBook3,5 78 | PowerBook G4 (1GHz / 867MHz) 79 | PowerBook4,1 80 | iBook G3 (Dual USB, Late 2001) 81 | PowerBook4,2 82 | iBook G3 (16MB VRAM) 83 | PowerBook4,3 84 | iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003) 85 | PowerBook5,1 86 | PowerBook G4 (17 inch) 87 | PowerBook5,2 88 | PowerBook G4 (15 inch FW 800) 89 | PowerBook5,3 90 | PowerBook G4 (17-inch 1.33GHz) 91 | PowerBook5,4 92 | PowerBook G4 (15 inch 1.5/1.33GHz) 93 | PowerBook5,5 94 | PowerBook G4 (17-inch 1.5GHz) 95 | PowerBook5,6 96 | PowerBook G4 (15 inch 1.67GHz/1.5GHz) 97 | PowerBook5,7 98 | PowerBook G4 (17-inch 1.67GHz) 99 | PowerBook5,8 100 | PowerBook G4 (Double layer SD, 15 inch) 101 | PowerBook5,9 102 | PowerBook G4 (Double layer SD, 17 inch) 103 | PowerBook6,1 104 | PowerBook G4 (12 inch) 105 | PowerBook6,2 106 | PowerBook G4 (12 inch, DVI) 107 | PowerBook6,3 108 | iBook G4 109 | PowerBook6,4 110 | PowerBook G4 (12 inch 1.33GHz) 111 | PowerBook6,5 112 | iBook G4 (Early-Late 2004) 113 | PowerBook6,7 114 | iBook G4 (Mid 2005) 115 | PowerBook6,8 116 | PowerBook G4 (12 inch 1.5GHz) 117 | PowerMac1,1 118 | Power Macintosh G3 (Blue & White) 119 | PowerMac1,2 120 | Power Macintosh G4 (PCI Graphics) 121 | PowerMac10,1 122 | Mac Mini G4 123 | PowerMac10,2 124 | Mac Mini (Late 2005) 125 | PowerMac11,2 126 | Power Macintosh G5 (Late 2005) 127 | PowerMac12,1 128 | iMac G5 (iSight) 129 | PowerMac2,1 130 | iMac G3 (Slot-loading CD-ROM) 131 | PowerMac2,2 132 | iMac G3 (Summer 2000) 133 | PowerMac3,1 134 | Power Macintosh G4 (AGP Graphics) 135 | PowerMac3,2 136 | Power Macintosh G4 (AGP Graphics) 137 | PowerMac3,3 138 | Power Macintosh G4 (Gigabit Ethernet) 139 | PowerMac3,4 140 | Power Macintosh G4 (Digital Audio) 141 | PowerMac3,5 142 | Power Macintosh G4 (Quick Silver) 143 | PowerMac3,6 144 | Power Macintosh G4 (Mirrored Drive Door) 145 | PowerMac4,1 146 | iMac G3 (Early/Summer 2001) 147 | PowerMac4,2 148 | iMac G4 (Flat Panel) 149 | PowerMac4,4 150 | eMac 151 | PowerMac4,5 152 | iMac G4 (17-inch Flat Panel) 153 | PowerMac5,1 154 | Power Macintosh G4 Cube 155 | PowerMac6,1 156 | iMac G4 (USB 2.0) 157 | PowerMac6,3 158 | iMac G4 (20-inch Flat Panel) 159 | PowerMac6,4 160 | eMac (USB 2.0, 2005) 161 | PowerMac7,2 162 | Power Macintosh G5 163 | PowerMac7,3 164 | Power Macintosh G5 165 | PowerMac8,1 166 | iMac G5 167 | PowerMac8,2 168 | iMac G5 (Ambient Light Sensor) 169 | PowerMac9,1 170 | Power Macintosh G5 (Late 2005) 171 | RackMac1,1 172 | Xserve G4 173 | RackMac1,2 174 | Xserve G4 (slot-loading, cluster node) 175 | RackMac3,1 176 | Xserve G5 177 | Xserve1,1 178 | Xserve (Intel Xeon) 179 | Xserve2,1 180 | Xserve (January 2008 quad-core) 181 | 182 | 183 | -------------------------------------------------------------------------------- /Support/shared/bin/CocoaDialog.app/Contents/Frameworks/Sparkle.framework/Versions/Current/Resources/SUModelTranslation.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ADP2,1 6 | Developer Transition Kit 7 | iMac1,1 8 | iMac G3 (Rev A-D) 9 | iMac4,1 10 | iMac (Core Duo) 11 | iMac4,2 12 | iMac for Education (17-inch, Core Duo) 13 | iMac5,1 14 | iMac (Core 2 Duo, 17 or 20 inch, SuperDrive) 15 | iMac5,2 16 | iMac (Core 2 Duo, 17 inch, Combo Drive) 17 | iMac6,1 18 | iMac (Core 2 Duo, 24 inch, SuperDrive) 19 | iMac8,1 20 | iMac (April 2008) 21 | MacBook1,1 22 | MacBook (Core Duo) 23 | MacBook2,1 24 | MacBook (Core 2 Duo) 25 | MacBook4,1 26 | MacBook (Core 2 Duo Feb 2008) 27 | MacBookAir1,1 28 | MacBook Air (January 2008) 29 | MacBookAir2,1 30 | MacBook Air (June 2009) 31 | MacBookAir3,1 32 | MacBook Air (October 2010) 33 | MacBookPro1,1 34 | MacBook Pro Core Duo (15-inch) 35 | MacBookPro1,2 36 | MacBook Pro Core Duo (17-inch) 37 | MacBookPro2,1 38 | MacBook Pro Core 2 Duo (17-inch) 39 | MacBookPro2,2 40 | MacBook Pro Core 2 Duo (15-inch) 41 | MacBookPro3,1 42 | MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo) 43 | MacBookPro3,2 44 | MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo) 45 | MacBookPro4,1 46 | MacBook Pro (Core 2 Duo Feb 2008) 47 | Macmini1,1 48 | Mac Mini (Core Solo/Duo) 49 | MacPro1,1 50 | Mac Pro (four-core) 51 | MacPro2,1 52 | Mac Pro (eight-core) 53 | MacPro3,1 54 | Mac Pro (January 2008 4- or 8- core "Harpertown") 55 | MacPro4,1 56 | Mac Pro (March 2009) 57 | MacPro5,1 58 | Mac Pro (August 2010) 59 | PowerBook1,1 60 | PowerBook G3 61 | PowerBook2,1 62 | iBook G3 63 | PowerBook2,2 64 | iBook G3 (FireWire) 65 | PowerBook2,3 66 | iBook G3 67 | PowerBook2,4 68 | iBook G3 69 | PowerBook3,1 70 | PowerBook G3 (FireWire) 71 | PowerBook3,2 72 | PowerBook G4 73 | PowerBook3,3 74 | PowerBook G4 (Gigabit Ethernet) 75 | PowerBook3,4 76 | PowerBook G4 (DVI) 77 | PowerBook3,5 78 | PowerBook G4 (1GHz / 867MHz) 79 | PowerBook4,1 80 | iBook G3 (Dual USB, Late 2001) 81 | PowerBook4,2 82 | iBook G3 (16MB VRAM) 83 | PowerBook4,3 84 | iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003) 85 | PowerBook5,1 86 | PowerBook G4 (17 inch) 87 | PowerBook5,2 88 | PowerBook G4 (15 inch FW 800) 89 | PowerBook5,3 90 | PowerBook G4 (17-inch 1.33GHz) 91 | PowerBook5,4 92 | PowerBook G4 (15 inch 1.5/1.33GHz) 93 | PowerBook5,5 94 | PowerBook G4 (17-inch 1.5GHz) 95 | PowerBook5,6 96 | PowerBook G4 (15 inch 1.67GHz/1.5GHz) 97 | PowerBook5,7 98 | PowerBook G4 (17-inch 1.67GHz) 99 | PowerBook5,8 100 | PowerBook G4 (Double layer SD, 15 inch) 101 | PowerBook5,9 102 | PowerBook G4 (Double layer SD, 17 inch) 103 | PowerBook6,1 104 | PowerBook G4 (12 inch) 105 | PowerBook6,2 106 | PowerBook G4 (12 inch, DVI) 107 | PowerBook6,3 108 | iBook G4 109 | PowerBook6,4 110 | PowerBook G4 (12 inch 1.33GHz) 111 | PowerBook6,5 112 | iBook G4 (Early-Late 2004) 113 | PowerBook6,7 114 | iBook G4 (Mid 2005) 115 | PowerBook6,8 116 | PowerBook G4 (12 inch 1.5GHz) 117 | PowerMac1,1 118 | Power Macintosh G3 (Blue & White) 119 | PowerMac1,2 120 | Power Macintosh G4 (PCI Graphics) 121 | PowerMac10,1 122 | Mac Mini G4 123 | PowerMac10,2 124 | Mac Mini (Late 2005) 125 | PowerMac11,2 126 | Power Macintosh G5 (Late 2005) 127 | PowerMac12,1 128 | iMac G5 (iSight) 129 | PowerMac2,1 130 | iMac G3 (Slot-loading CD-ROM) 131 | PowerMac2,2 132 | iMac G3 (Summer 2000) 133 | PowerMac3,1 134 | Power Macintosh G4 (AGP Graphics) 135 | PowerMac3,2 136 | Power Macintosh G4 (AGP Graphics) 137 | PowerMac3,3 138 | Power Macintosh G4 (Gigabit Ethernet) 139 | PowerMac3,4 140 | Power Macintosh G4 (Digital Audio) 141 | PowerMac3,5 142 | Power Macintosh G4 (Quick Silver) 143 | PowerMac3,6 144 | Power Macintosh G4 (Mirrored Drive Door) 145 | PowerMac4,1 146 | iMac G3 (Early/Summer 2001) 147 | PowerMac4,2 148 | iMac G4 (Flat Panel) 149 | PowerMac4,4 150 | eMac 151 | PowerMac4,5 152 | iMac G4 (17-inch Flat Panel) 153 | PowerMac5,1 154 | Power Macintosh G4 Cube 155 | PowerMac6,1 156 | iMac G4 (USB 2.0) 157 | PowerMac6,3 158 | iMac G4 (20-inch Flat Panel) 159 | PowerMac6,4 160 | eMac (USB 2.0, 2005) 161 | PowerMac7,2 162 | Power Macintosh G5 163 | PowerMac7,3 164 | Power Macintosh G5 165 | PowerMac8,1 166 | iMac G5 167 | PowerMac8,2 168 | iMac G5 (Ambient Light Sensor) 169 | PowerMac9,1 170 | Power Macintosh G5 (Late 2005) 171 | RackMac1,1 172 | Xserve G4 173 | RackMac1,2 174 | Xserve G4 (slot-loading, cluster node) 175 | RackMac3,1 176 | Xserve G5 177 | Xserve1,1 178 | Xserve (Intel Xeon) 179 | Xserve2,1 180 | Xserve (January 2008 quad-core) 181 | 182 | 183 | -------------------------------------------------------------------------------- /Support/shared/lib/current_word.rb: -------------------------------------------------------------------------------- 1 | # When creating a custom regex for Word.current_word, you need to keep a few things in mind: 2 | # The regex matches from your caret, so your caret position will always be the beginning of the line 3 | # Everything before your caret is reversed for the match, so the left of your caret will also match your caret position as ^ 4 | # You must use a capture group () for the text you're trying to match 5 | # You must use a capture group () for the text before/after your match 6 | # 7 | # EG: /(^[a-z]*)(.*$)/ 8 | # The first capture group in that regex will match from your caret out until it can't find anymore lowercase letters. 9 | # Then it'll match everything else in the line as the before/after match part. 10 | # You can currently only use a single regex to match before and after your caret. 11 | # 12 | # Since your regex matches what's before your caret in reverse, you'll have to reverse specific stuff in your regex, eg: 13 | # /(.*):/ wouldn't match 'color' in ` color: `, but /:(.*)/ would. 14 | # It's reversed you see 15 | # 16 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 17 | 18 | module Word 19 | def self.current_word(pat='a-zA-Z0-9', direction=:both) 20 | word = ENV['TM_SELECTED_TEXT'] 21 | 22 | if word.nil? or word.empty? 23 | line, col = ENV['TM_CURRENT_LINE'], ENV['TM_LINE_INDEX'].to_i 24 | 25 | if pat.kind_of? Regexp 26 | @reg = pat 27 | else 28 | @reg = /(^[#{pat}]*)(.*$\r?\n?)/ 29 | end 30 | 31 | left, before_match = *( line[0...col].reverse.match(@reg) ||[])[1..2] 32 | right, after_match = *( line[col..-1] .match(@reg) ||[])[1..2] 33 | 34 | (before_match||='').reverse! 35 | (left||='').reverse! 36 | 37 | # p before_match, left, right, after_match 38 | 39 | case direction 40 | when :both then word = [left, right].join('') 41 | when :left then word = left 42 | when :right then word = right 43 | when :hash then word = { 44 | :line => [before_match, left, right, after_match].join(''), 45 | :before_match => before_match, 46 | :left => left, 47 | :right => right, 48 | :after_match => after_match, 49 | } 50 | end 51 | end 52 | 53 | word 54 | end 55 | end 56 | 57 | if __FILE__ == $0 58 | require "test/unit" 59 | class TestWord < Test::Unit::TestCase 60 | # =begin 61 | def test_with_spaces 62 | ENV['TM_SELECTED_TEXT']= nil 63 | ENV['TM_CURRENT_LINE'] = <<-EOF 64 | BeforeAfter 65 | EOF 66 | ENV['TM_LINE_INDEX'] = '10' 67 | ENV['TM_TAB_SIZE'] = '2' 68 | assert_equal 'BeforeAfter', Word.current_word 69 | assert_equal 'Before', Word.current_word('a-zA-Z0-9',:left) 70 | assert_equal 'After', Word.current_word('a-zA-Z0-9',:right) 71 | 72 | assert_equal ' Before', Word.current_word(" a-zA-Z",:left) 73 | assert_equal 'After ', Word.current_word(" a-zA-Z",:right) 74 | end 75 | 76 | def test_with_tabs 77 | ENV['TM_SELECTED_TEXT']= nil 78 | ENV['TM_CURRENT_LINE'] = <<-EOF 79 | BeforeAfter 80 | EOF 81 | ENV['TM_LINE_INDEX'] = '8' 82 | ENV['TM_TAB_SIZE'] = '2' 83 | assert_equal 'BeforeAfter', Word.current_word 84 | assert_equal 'Before', Word.current_word('a-zA-Z0-9',:left) 85 | assert_equal 'After', Word.current_word('a-zA-Z0-9',:right) 86 | 87 | assert_equal "\t\tBefore", Word.current_word("\ta-zA-Z",:left) 88 | assert_equal "After\t\t", Word.current_word("\ta-zA-Z",:right) 89 | end 90 | 91 | def test_with_dash 92 | ENV['TM_SELECTED_TEXT']= nil 93 | ENV['TM_CURRENT_LINE'] = <<-EOF 94 | Before--After 95 | EOF 96 | ENV['TM_LINE_INDEX'] = '11' 97 | ENV['TM_TAB_SIZE'] = '2' 98 | assert_equal 'Before--After', Word.current_word('-a-zA-Z0-9') 99 | assert_equal 'Before-', Word.current_word('-a-zA-Z0-9',:left) 100 | assert_equal '-After', Word.current_word('-a-zA-Z0-9',:right) 101 | 102 | assert_equal 'Before-', Word.current_word("\ta-zA-Z\-",:left) 103 | end 104 | 105 | def test_hash_result 106 | ENV['TM_SELECTED_TEXT']= nil 107 | ENV['TM_CURRENT_LINE'] = <<-EOF 108 | before_match BeforeAfter after_match 109 | EOF 110 | ENV['TM_LINE_INDEX'] = '22' 111 | ENV['TM_TAB_SIZE'] = '2' 112 | 113 | word = Word.current_word("a-zA-Z",:hash) 114 | 115 | assert_equal ENV['TM_CURRENT_LINE'], "#{word[:line]}" 116 | assert_equal 'Before', word[:left] 117 | assert_equal 'After', word[:right] 118 | end 119 | =begin 120 | =end 121 | def test_both_result 122 | ENV['TM_SELECTED_TEXT']= nil 123 | ENV['TM_CURRENT_LINE'] = <<-EOF 124 | before_match BeforeAfter after_match 125 | EOF 126 | ENV['TM_LINE_INDEX'] = '22' 127 | ENV['TM_TAB_SIZE'] = '2' 128 | 129 | assert_equal 'BeforeAfter', Word.current_word("a-zA-Z",:both) 130 | end 131 | 132 | def test_should_support_custom_regex 133 | ENV['TM_SELECTED_TEXT']= nil 134 | ENV['TM_CURRENT_LINE'] = <<-EOF 135 | before_match BeforeAfter after_match 136 | EOF 137 | ENV['TM_LINE_INDEX'] = '22' 138 | ENV['TM_TAB_SIZE'] = '2' 139 | 140 | assert_equal '', Word.current_word(/[a-zA-Z]/,:both) # No match since no capture group was used! 141 | 142 | assert_equal 'ef', Word.current_word(/([a-z])/,:both) # Capture group, but only selecting a single caracter before and after the caret 143 | assert_equal 'eforefter', Word.current_word(/([a-z]+)/,:both) # Only lowercase characters 144 | assert_equal 'BeforeAfter', Word.current_word(/^([a-z]*)/i,:both) # Ignore case 145 | assert_equal 'BeforeAfter', Word.current_word(/^([a-zA-Z]*)/,:both) # Explicit case 146 | end 147 | 148 | def test_should_support_custom_regex_example1 149 | ENV['TM_SELECTED_TEXT']= nil 150 | ENV['TM_CURRENT_LINE'] = <<-EOF 151 | background-color: ; 152 | EOF 153 | ENV['TM_LINE_INDEX'] = '20' 154 | ENV['TM_TAB_SIZE'] = '2' 155 | 156 | assert_equal ' background-color: ', Word.current_word(/^(.*)/,:left) 157 | assert_equal 'background-color', Word.current_word(/:([-a-z]+)/,:left) 158 | end 159 | 160 | def test_should_support_custom_regex_example2 161 | ENV['TM_SELECTED_TEXT']= nil 162 | ENV['TM_CURRENT_LINE'] = <<-EOF 163 |

    Lorem ipsum dolor sit amet

    164 | EOF 165 | ENV['TM_LINE_INDEX'] = '44' 166 | ENV['TM_TAB_SIZE'] = '2' 167 | 168 | assert_equal %Q{\t

    Lorem ipsum}, Word.current_word(/^(.*)/,:left) 169 | assert_equal 'Lorem ipsum dolor sit amet', Word.current_word(/^([^<>]+)/i,:both) 170 | 171 | # You have to reverse the regex since it's matching against the reverse of the text before the caret 172 | assert_equal 'p', Word.current_word(/([-:a-z]+) ENV['TM_FILEPATH'], :line => default_line, :column => 1}.merge(options) 25 | if options[:file] 26 | `"$TM_SUPPORT_PATH/bin/mate" -l #{options[:line]}:#{options[:column]} #{e_sh options[:file]}` 27 | else 28 | `open "txmt://open?line=#{options[:line]}&column=#{options[:column]}"` 29 | end 30 | end 31 | 32 | def require_cmd(command, message = nil) 33 | if `which "#{command}"`.empty? 34 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/htmloutput.rb" 35 | 36 | TextMate::HTMLOutput.show( 37 | :title => "Command Not Found", 38 | :sub_title => "Command Not Found - #{command}" 39 | ) do |io| 40 | io << <<-HTML 41 |

    Unable to locate #{command}

    42 | 43 |

    #{message || "To succesfully run this action you need to 44 | install «#{command}». If you know that it is already 45 | installed on your system, you instead need to update 46 | your search path.

    47 | 48 |

    The manual has a section about 49 | 50 | how to update your search path."}

    51 | 52 |

    For diagnostic purposes, the paths searched for «#{command}» were:

    53 | 54 |
      55 | #{`echo $PATH`.gsub(/:/, "\n").gsub(/^(.*)$/, "
    • \\&
    • ")} 56 |
    57 | HTML 58 | end 59 | 60 | TextMate.exit_show_html 61 | end 62 | end 63 | 64 | def require_env_var(env_var, message = nil) 65 | unless ENV.has_key? env_var 66 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/htmloutput.rb" 67 | TextMate::HTMLOutput.show( 68 | :title => "Environment Variable Not Set", 69 | :sub_title => "Environment Variable Not Set - #{env_var}" 70 | ) do |io| 71 | io << <<-HTML 72 |

    The environment variable #{env_var} is unset.

    73 | 74 |

    #{message || "To succesfully run this action you need to 75 | set the «#{env_var}» environment variable. If you know that it is already 76 | installed on your system, you instead need to update 77 | your search path."}

    78 | 79 |

    The manual has a section about 80 | 81 | setting environment variables.

    82 | HTML 83 | end 84 | TextMate.exit_show_html 85 | end 86 | end 87 | 88 | def rescan_project 89 | end 90 | end 91 | 92 | class ProjectFileFilter 93 | def initialize 94 | @file_pattern = load_pattern('OakFolderReferenceFilePattern', '!(/\.(?!htaccess)[^/]*|\.(tmproj|o|pyc)|/Icon\r)$') 95 | @folder_pattern = load_pattern('OakFolderReferenceFolderPattern', '!.*/(\.[^/]*|CVS|_darcs|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$') 96 | 97 | @text_types = prefs_for_key('OakProjectTextFiles') || [ ] 98 | @text_types.collect! { |ext| '.' + ext } 99 | @binary_types = prefs_for_key('OakProjectBinaryFiles') || [ "nib" ] 100 | @binary_types.collect! { |ext| '.' + ext } 101 | end 102 | 103 | def prefs_for_key (key) 104 | prefs_file = "#{ENV['HOME']}/Library/Preferences/#{ENV['TM_APP_IDENTIFIER'] || 'com.macromates.textmate'}.plist" 105 | File.open(prefs_file) do |f| 106 | return OSX::PropertyList::load(f)[key] 107 | end 108 | end 109 | 110 | def load_pattern (key, default_pattern) 111 | str = prefs_for_key(key) 112 | str = default_pattern if str.to_s.empty? 113 | if str[0] == ?! then 114 | { :regexp => Regexp.new(str[1..-1]), :negate => true } 115 | else 116 | { :regexp => Regexp.new(str), :negate => false } 117 | end 118 | end 119 | 120 | def binary? (file) 121 | ext = File.extname(file) 122 | if @text_types.member?(ext) then 123 | false 124 | elsif @binary_types.member?(ext) then 125 | true 126 | else 127 | # ask the file shell command about the type 128 | case `file #{e_sh file}` 129 | when /\bempty\b/ then 130 | # treat empty files as binary, but do not record the extension 131 | true 132 | when /\btext\b/ then 133 | @text_types << ext unless ext.empty? 134 | false 135 | else 136 | @binary_types << ext unless ext.empty? 137 | true 138 | end 139 | end 140 | end 141 | 142 | def skip? (file) 143 | a_directory = File.directory?(file) 144 | ptrn = a_directory ? @folder_pattern : @file_pattern 145 | skip_it = ptrn[:regexp].match(file) ? ptrn[:negate] : !ptrn[:negate] 146 | return (skip_it or a_directory) ? skip_it || File.symlink?(file) : binary?(file) 147 | end 148 | end 149 | 150 | def TextMate.scan_dir (dir, block, filter) 151 | return unless File.executable?(dir) 152 | Dir.entries(dir).each do |filename| 153 | fullpath = File.join(dir, filename) 154 | if(filter.skip?(fullpath)) then 155 | # skip hidden files and folders 156 | elsif(File.directory?(fullpath)) then 157 | scan_dir(fullpath, block, filter) 158 | else 159 | block.call(fullpath) 160 | end 161 | end 162 | end 163 | 164 | def TextMate.each_text_file (&block) 165 | project_dir = ENV['TM_PROJECT_DIRECTORY'] 166 | current_file = ENV['TM_FILEPATH'] 167 | 168 | if selected_files then 169 | selected_files.each do |path| 170 | if File.directory? path 171 | scan_dir(path, block, ProjectFileFilter.new) 172 | else 173 | block.call(path) 174 | end 175 | end 176 | elsif project_dir then 177 | TextMate.scan_dir(project_dir, block, ProjectFileFilter.new) 178 | elsif current_file then 179 | block.call(current_file) 180 | end 181 | end 182 | 183 | def TextMate.each_text_file_in_project (&block) 184 | project_dir = ENV['TM_PROJECT_DIRECTORY'] 185 | current_file = ENV['TM_FILEPATH'] 186 | 187 | if project_dir then 188 | TextMate.scan_dir(project_dir, block, ProjectFileFilter.new) 189 | elsif current_file then 190 | block.call(current_file) 191 | end 192 | end 193 | 194 | # returns a array if all currently selected files or nil 195 | def TextMate.selected_files( tm_selected_files = ENV['TM_SELECTED_FILES'] ) 196 | return nil if tm_selected_files.nil? or tm_selected_files.empty? 197 | require 'shellwords' 198 | Shellwords.shellwords( tm_selected_files ) 199 | end 200 | 201 | end 202 | 203 | # if $0 == __FILE__ then 204 | # `touch /tmp/a.txt /tmp/b.txt` 205 | # ENV['TM_PROJECT_DIRECTORY'] = "/tmp" 206 | # ENV['TM_SELECTED_FILES'] = "/tmp/a.txt" 207 | # TextMate.each_text_file { |f| puts f } 208 | # TextMate.each_text_file_in_project { |f| puts f } 209 | # end 210 | -------------------------------------------------------------------------------- /Support/shared/nibs/ProgressDialog.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | title 15 | summary 16 | details 17 | progressValue 18 | isIndeterminate 19 | progressMax 20 | progressMin 21 | YES 22 | cancelButtonVisible 23 | cancelButtonHidden 24 | progressAnimate 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /Support/shared/lib/scriptmate.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | require "#{ENV['TM_SUPPORT_PATH']}/private/track_usage.rb" 4 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" 5 | require "#{ENV['TM_SUPPORT_PATH']}/lib/web_preview.rb" 6 | require "#{ENV['TM_SUPPORT_PATH']}/lib/io.rb" 7 | require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/tempfile.rb" 8 | 9 | require 'cgi' 10 | require 'fcntl' 11 | 12 | $KCODE = 'u' if (RUBY_VERSION.to_f < 1.9) 13 | 14 | $SCRIPTMATE_VERSION = "$Revision$" 15 | 16 | def my_popen3(*cmd) # returns [stdin, stdout, strerr, pid] 17 | pw = IO::pipe # pipe[0] for read, pipe[1] for write 18 | pr = IO::pipe 19 | pe = IO::pipe 20 | 21 | [ pw, pr, pe ].flatten.each { |fd| fd.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) } 22 | 23 | # F_SETOWN = 6, ideally this would be under Fcntl::F_SETOWN 24 | pw[0].fcntl(6, ENV['TM_PID'].to_i) if ENV.has_key? 'TM_PID' 25 | 26 | pid = fork{ 27 | STDIN.reopen(pw[0]) 28 | STDOUT.reopen(pr[1]) 29 | STDERR.reopen(pe[1]) 30 | 31 | tm_interactive_input = "#{ENV['TM_SUPPORT_PATH']}/lib/tm_interactive_input.dylib" 32 | if (File.exists? tm_interactive_input) 33 | dil = ENV['DYLD_INSERT_LIBRARIES'] 34 | ENV['DYLD_INSERT_LIBRARIES'] = (dil) ? "#{tm_interactive_input}:#{dil}" : tm_interactive_input unless (dil =~ /#{tm_interactive_input}/) 35 | ENV['DYLD_FORCE_FLAT_NAMESPACE'] = "1" 36 | ENV['TM_INTERACTIVE_INPUT'] = 'AUTO|ECHO' 37 | end 38 | 39 | exec(*cmd) 40 | } 41 | 42 | pw[0].close 43 | pr[1].close 44 | pe[1].close 45 | 46 | pw[1].sync = true 47 | 48 | [pw[1], pr[0], pe[0], pid] 49 | end 50 | 51 | def cmd_mate(cmd) 52 | # cmd can be either a string or a list of strings to be passed to Popen3 53 | # this command will write the output of the `cmd` on STDOUT, formatted in 54 | # HTML. 55 | c = UserCommand.new(cmd) 56 | m = CommandMate.new(c) 57 | m.emit_html 58 | end 59 | 60 | class UserCommand 61 | attr_reader :display_name, :path 62 | def initialize(cmd) 63 | @cmd = cmd 64 | end 65 | def run 66 | stdin, stdout, stderr, pid = my_popen3(@cmd) 67 | return stdout, stderr, nil, pid 68 | end 69 | def to_s 70 | @cmd.to_s 71 | end 72 | end 73 | 74 | class CommandMate 75 | def initialize (command) 76 | # the object `command` needs to implement a method `run`. `run` should 77 | # return an array of three file descriptors [stdout, stderr, stack_dump]. 78 | @error = "" 79 | @command = command 80 | STDOUT.sync = true 81 | @mate = self.class.name 82 | end 83 | protected 84 | def filter_stdout(str) 85 | # strings from stdout are passed through this method before being printed 86 | # txmt://open?line=3&url=file:///var/folders/Gx/Gxr7D8ILFba5bZaZC6rrCE%2B%2B%2BTQ/-Tmp-/untitled_m16p.py 87 | str = htmlize(str).gsub(/\/, "
    \n") 88 | 89 | end 90 | def filter_stderr(str) 91 | # strings from stderr are passwed through this method before printing 92 | "#{htmlize str}".gsub(/\/, "
    \n") 93 | end 94 | def emit_header 95 | puts html_head(:window_title => "#{@command}", :page_title => "#{@command}", :sub_title => "") 96 | puts "
    "
     97 |     end
     98 |     def emit_footer
     99 |       puts "
    " 100 | html_footer 101 | end 102 | public 103 | def emit_html 104 | @command.run do |stdout, stderr, stack_dump, pid| 105 | %w[INT TERM].each do |signal| 106 | trap(signal) do 107 | begin 108 | Process.kill("KILL", pid) 109 | sleep 0.5 110 | Process.kill("TERM", pid) 111 | rescue 112 | # process doesn't exist anymore 113 | end 114 | end 115 | end 116 | emit_header() 117 | TextMate::IO.exhaust(:out => stdout, :err => stderr, :stack => stack_dump) do |str, type| 118 | case type 119 | when :out then print filter_stdout(str) 120 | when :err then puts filter_stderr(str) 121 | when :stack then 122 | unless @command.temp_file.nil? 123 | str.gsub!(/(href=("|')(?:txmt:\/\/open\?(?:[a-z]+=[0-9]+)*?))(&url=.*)([a-z]+=[0-9]+)?(\2)/, '\1\2') 124 | ext = @command.default_extension 125 | str.gsub!(File.basename(@command.temp_file), "untitled") 126 | end 127 | @error << str 128 | end 129 | end 130 | emit_footer() 131 | Process.waitpid(pid) 132 | end 133 | end 134 | end 135 | 136 | class UserScript 137 | attr_reader :display_name, :path, :warning 138 | attr_reader :temp_file 139 | def initialize(content) 140 | 141 | @warning = '' 142 | @content = content 143 | @hashbang = $1 if @content =~ /\A#!(.*)$/ 144 | 145 | @saved = true 146 | if ENV.has_key? 'TM_FILEPATH' then 147 | @path = ENV['TM_FILEPATH'] 148 | @display_name = File.basename(@path) 149 | begin 150 | file = open(@path, 'w') 151 | file.write @content 152 | rescue Errno::EACCES 153 | @saved = false 154 | @warning = "Could not save #{@path} before running, using temp file..." 155 | ensure 156 | file.close unless file.nil? 157 | end 158 | else 159 | @saved = false 160 | end 161 | end 162 | 163 | public 164 | 165 | def executable 166 | # return the path to the executable that will run @content. 167 | end 168 | def args 169 | # return any arguments to be fed to the executable 170 | [] 171 | end 172 | def filter_cmd(cmd) 173 | # this method is called with this list: 174 | # [executable, args, e_sh(@path), ARGV.to_a ].flatten 175 | cmd 176 | end 177 | def version_string 178 | # return the version string of the executable. 179 | end 180 | def default_extension 181 | # return the extension to use if the script has not yet been saved 182 | end 183 | def run(&block) 184 | rd, wr = IO.pipe 185 | rd.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) 186 | ENV['TM_ERROR_FD'] = wr.to_i.to_s 187 | if @saved 188 | cmd = filter_cmd([executable, args, e_sh(@path), ARGV.to_a ].flatten) 189 | stdin, stdout, stderr, pid = my_popen3(cmd.join(" ")) 190 | wr.close 191 | block.call(stdout, stderr, rd, pid) 192 | else 193 | TextMate::IO.tempfile(default_extension) do |f| 194 | f.write @content 195 | @display_name = "untitled" 196 | @temp_file = f.path 197 | cmd = filter_cmd([executable, args, e_sh(f.path), ARGV.to_a ].flatten) 198 | stdin, stdout, stderr, pid = my_popen3(cmd.join(" ")) 199 | wr.close 200 | block.call(stdout, stderr, rd, pid) 201 | end 202 | end 203 | end 204 | end 205 | 206 | class ScriptMate < CommandMate 207 | 208 | protected 209 | def emit_header 210 | puts html_head(:window_title => "#{@command.display_name} — #{@mate}", :page_title => "#{@mate}", :sub_title => "#{@command.lang}") 211 | puts <<-HTML 212 | 213 | 230 | 231 | HTML 232 | puts <<-HTML 233 | 294 | #{@command.warning} 295 |
    296 |
    297 | copy output 298 |
    299 | 300 |
    301 | #{@mate} r#{$SCRIPTMATE_VERSION[/\d+/]} running #{@command.version_string}
    302 | >>> #{@command.display_name}
    303 | 
    304 | 
    305 | HTML 306 | end 307 | 308 | def emit_footer 309 | puts '
    ' 310 | puts @error unless @error == "" 311 | puts '
    Program exited.
    ' 312 | html_footer 313 | end 314 | end 315 | -------------------------------------------------------------------------------- /Support/shared/nibs/RequestString.nib/designable.nib: -------------------------------------------------------------------------------- 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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 101 | 124 | 125 | 126 | 127 | 128 | 129 | Request String 130 | Request String 131 | Request String 132 | Request String 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | prompt 141 | value 142 | string 143 | title 144 | button1 145 | button2 146 | controller 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /Support/shared/nibs/RequestSecureString.nib/designable.nib: -------------------------------------------------------------------------------- 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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 101 | 124 | 125 | 126 | 127 | 128 | 129 | Request String 130 | Request String 131 | Request String 132 | Request String 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | prompt 141 | value 142 | string 143 | title 144 | button1 145 | button2 146 | controller 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | --------------------------------------------------------------------------------