TextMateでRSpecを扱う設定
TextMateに RSpec操作を簡単にするBunldleがあるんだが、どうしても、specソースとlibソース間を簡単に行き来するコマンドが使えなかった.
今日、ようやく使えるようになった。以下に設定の覚え書き.
~/.MacOSX/environment.plistの設定
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>GL_ENABLE_DEBUG_ATTACH</key> <string>YES</string> <key>PATH</key> <string>/opt/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/Applications/TextMate.app/Contents/SharedSupport/Support/bin</string> </dict> </plist>
1183907253* ~/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate/switch_command.rbの修正
def go_to_twin(project_directory, filepath) other = twin(filepath) if File.file?(other) - `mate #{other}` + `mate "#{other}"` else relative = other[project_directory.length+1..-1] file_type = file_type(other)
What is this?
スペースを含む絶対パスのファイルをmateで開けるように修正.
Context
specとlibの切り替え確認をRSpec.tmbundle以下のファイルで確認していた。ところが
「~/Application Support」のスペースのためにファイルが開けてなかった.
「"」で囲んでやれば開けることに気づく.
RSpec.tmbundleやrspecのソースに付いてきている、libとspecで[alternate file]が実行できることを確認.
これでQuickJUnitとほぼ同じ機能が使えることがTextMateでも可能であることが確認できた.
追記:pathの設定を~/.MacOSX/environment.plist で行わなくてもよいことがわかった.詳細は次のページで
http://d.hatena.ne.jp/haru01/20070710