Requires TextMate 2.0-beta.3
Requires TextMate 2.0-alpha.9575
Bundle support ruby codes are currently have not been updated for ruby 2.0, so anything using bundle support ruby codes they must be run on ruby 1.8.
For example you may want to set: TM_MARKDOWN = "/path/to/multimarkdown --nosmart" Previously this would fail because TM_MARKDOWN was treated as a single command (with possible spaces in its path). This commit makes the same change for TM_SMARTYPANTS.
If installing fails we report failure back to TextMate so that it correctly aborts the command (e.g. if command was supposed to replace input, it won’t swallow the input). We write the error log to stderr so that TextMate will show it in the failure sheet.
The binary has hardcoded paths with respect to where the support library is found. To test run: ruby -e'puts $:'. This is just a quick fix, I am not sure what the proper fix would be since anything below user’s folder is variable. Perhaps we should install ruby 1.8 to /Library instead.
This is for backwards compatibility with bundle items that were designed for ruby 1.8. Input is passed along to ruby 1.8 if already installed or if needed downloading and installing a copy for TextMates exclusive use. This does not affect the system ruby version or any other part of the system. Revised from previous commit due to an error in the ruby build.
Revert due to library error referenced in #11.
This is for backwards compatibility with bundle items that were designed for ruby 1.8. Input is passed along to ruby 1.8 if already installed or if needed downloading and installing a copy for TextMates exclusive use. This does not affect the system ruby version or any other part of the system.
The script uses ruby’s ‘expand_path’ with the potential path found in the command output, but this command can throw an exception (on non-path arguments).
This mimics how a shell works and presumably anything run via TextMate::Executor that spawns child processes (like a build system) will forward SIGINT/SIGTERM to the proper children.
This is done by setting ‘:create_error_pipe’ to ‘true’ in the options passed to the function. The reason we cannot enable it for all commands is that if the command spawns a background/daemon process without closing all open file descriptors, then the new process will effectively stall TextMate::Executor, as it’s preventing the file descriptor from being closed in the parent. This commit requires that existing uses of TM_ERROR_FD be updated to specify the new argument — since only a handful of commands use it, this is simpler than having to update all commands that does not use this feature of TextMate::Executor.
The current working directory of TextMate::Executor is (with newer TextMate builds) the computer’s temporary directory, so we should not resolve file names against it.
For projects, the working directory will now be set to the project directory, if there is no project then the file’s directory is used, and if running an untitled document, the user’s home directory is used as a last fallback. Solves textmate/textmate#994 and textmate/textmate#1010.
This would happen if the direct command executed terminates but a child keeps stdout/err open, causing TextMate to wait for the child to finish. Pressing ⌃C will search for the process ID of the initial process. If this no longer exist, nil is found and subsequently used, causing a “no method” exception. The reported case was using the Make bundle with a rule that calls ‘@@mongod --fork’.
Presently bootstrapped interpreters (compilers) like ‘xcrun clang’ can’t be handled via the current TextMate.executor API, so for now we just show the executable (which in this example would be ‘xcrun’). Not ideal, but better than showing a “random” string.
Some interpreters will resolve symbolic links in the path they are given, and use this resolved (“real”) path in the error output (e.g. php and coffee-script). When running untitled documents, we previously only searched for the non-resolved path in the error output (for hyperlinking). This issue only applies to code using TextMate.executor that does its own hyperlinking.