forked from dchelimsky/rspec-tmbundle
/
Save spec and remember.tmCommand
38 lines (31 loc) · 1.08 KB
/
Save spec and remember.tmCommand
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>#!/usr/bin/env bash
. "$TM_BUNDLE_SUPPORT/lib/rvm_textmate"
cat <<'RUBYEOF' > /tmp/textmate-command-$$.rb
require ENV['TM_BUNDLE_SUPPORT'] + "/lib/spec/mate"
# Remembers the last _spec.rb file so that 'Run last spec' command
# can be activated from any Ruby source file
Spec::Mate::Runner.new.save_as_last_remembered_file ENV['TM_FILEPATH']
RUBYEOF
${TM_RUBY:-ruby} /tmp/textmate-command-$$.rb; exit_status=$?; rm /tmp/textmate-command-$$.rb; exit $exit_status
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@s</string>
<key>name</key>
<string>Save Example file and remember</string>
<key>output</key>
<string>showAsTooltip</string>
<key>scope</key>
<string>source.ruby.rspec</string>
<key>uuid</key>
<string>AC7FD3DD-A904-4B5B-8B02-4D6F04CD8ED4</string>
</dict>
</plist>