TextMate is a code and markup editor for OS X that ships with syntax highlighting and other goodies for Ruby (and Rails). Its official site is http://macromates.com/
Share your tips and trix
rails 2 style html.erb etc. templates are not interpreted correctly by the textmate rails bundle.
To change this, go to Bundles > Bundle Editor
Open Rails > HTML (Rails) and change the 2nd line to
fileTypes = ( ‘rhtml’, ‘html.erb’ );
and also the Ruby on Rails node, line 2 to:
fileTypes = ( ‘rxml’, ‘xml.erb’ );
Q: is there an updated edge-rails bundle out there?
footnotes is a rails plugin that makes trace links clickable in the browser in development mode. Very cool. Read more here: Textmate Footnotes Plugin
There’s a neat little Rails application at http://keyref.octopod.info/ that you can paste TextMate’s shortcut list into (Command-Option-Control-k from an edit window) and it’ll let you pick up to eight bundles, then email you a PDF cheatsheet for them.
This is an modified version of the default TODO command in TextMate
The modification:Howto:
WorkPath="$TM_PROJECT_DIRECTORY"
WorkPath="${WorkPath// /%20}/" # turn spaces into %20
export WorkPath
cat <<EOF
<html><head><style>
body { font: 12px 'Lucida Grande' }
</style></head><body>
<center><h1> - TODO LIST - </h1></center>
<div style="border-top: 1px #cccccc dotted;"> </div>
<ul>
EOF
cd "$TM_PROJECT_DIRECTORY"
find . -name '.svn' -type d -prune -or -name '*.rb' -type f -exec grep -HinwE "TODO|FIXME|FIX ME" '{}' \; -or -name '*.rhtml' -type f -exec grep -HinwE "TODO|FIXME|FIX ME" '{}' \; | perl -pe '$|=1; s/&/&/g; s/</</g; s/>/>/g; s!(.*?):(.*?):.*?(?:TODO|FIXME|FIX ME)[:,]?(.*)$!<li><a href="txmt://open?url=file://$ENV{'WorkPath'}/$1&line=$2"><small>$1</small></a>:<br/><div style="margin: 10px">$3</div></li>!i'
echo "</ul>"
echo '<center><div style="border-top: 1px #cccccc dotted; margin-top: 20px; color: #aaaaaa;"><br/><i>Done.</i></div></center>'
echo "<body>"
TODO this must be fixedto one of your source files,
(the command above returns ’/bin/bash: line 1: WorkPath=/: No such file or directory’ for me)
You can add this snippet too
#TODO `date +%d-%m-%Y` ${1:what you want}
(the above date example does not work for me. It does not get parsed.)