Skip to content

Commit

Permalink
• try to make at least the command section look less messy
Browse files Browse the repository at this point in the history
git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/Ruby.tmbundle@1904 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information
duff committed Oct 7, 2005
1 parent 951e6b8 commit 84cbd04
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 66 deletions.
2 changes: 1 addition & 1 deletion Commands/Execute Line with Ruby.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EOF</string>
<key>keyEquivalent</key>
<string>^E</string>
<key>name</key>
<string>Execute Line with Ruby</string>
<string>Execute Line as Ruby</string>
<key>output</key>
<string>afterSelectedText</string>
<key>uuid</key>
Expand Down
29 changes: 0 additions & 29 deletions Commands/Get Info for Selection (ri).plist

This file was deleted.

37 changes: 14 additions & 23 deletions Commands/Lookup in Documentation.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,22 @@
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>echo "&lt;title&gt;Ruby doc for ${TM_SELECTED_TEXT:=$TM_CURRENT_WORD}&lt;/title&gt;"
ri -Tf html "${TM_SELECTED_TEXT:=$TM_CURRENT_WORD}"|{
<string># this requires Ruby &gt; 1.8.1 or an earlier version with ri installed.
echo "&lt;title&gt;Ruby doc for ${TM_SELECTED_TEXT:=$TM_CURRENT_WORD}&lt;/title&gt;"
ri -Tf html "$TM_SELECTED_TEXT"|{
read MSG
if [[ $MSG == "More than one method matched your request. You can refine" ]]; then
if grep -q &lt;&lt;&lt;$MSG "More than one method matched"; then
read MSG; read MSG
cat &lt;&lt;'EOF'
&lt;script&gt;
function ri (arg) {
document.getElementById("result").innerText = "";
function output (str) {
document.getElementById("result").innerText += str;
cat &lt;&lt;-'EOF'
&lt;script&gt;function ri (arg) {
var res = TextMate.system("ri -T '" + arg + "'", null).outputString;
document.getElementById("result").innerText = res;
window.location.hash = "result";
}
var cmd = "ri -Tf plain '" + arg + "'"
var myCommand = TextMate.system(cmd, function (task) { });
myCommand.onreadoutput = output;
}
&lt;/script&gt;
&lt;h1&gt;Multiple matches&lt;/h1&gt;
&lt;ul&gt;
EOF
perl -pe 's/(.+?)(, |$)/&lt;li&gt;&lt;a href="javascript:ri(&amp;quot;$1&amp;quot;)"&gt;$1&lt;\/a&gt;&lt;\/li&gt;\n/g'
echo "&lt;/ul&gt;&lt;hr&gt;&lt;pre id="result"&gt;&lt;/pre&gt;"
&lt;/script&gt;&lt;h1&gt;Multiple matches&lt;/h1&gt;&lt;ul&gt;
EOF
perl -pe $'s%(.+?)(, |$)%&lt;li&gt;&lt;a href=\'javascript:ri("$1")\'&gt;$1&lt;/a&gt;&lt;/li&gt;%g'
echo '&lt;/ul&gt;&lt;hr&gt;&lt;pre id="result"&gt;&lt;/pre&gt;'
else
echo "$MSG"; cat
fi
Expand All @@ -38,9 +29,9 @@ EOF
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string></string>
<string>^h</string>
<key>name</key>
<string>Lookup in Documentation</string>
<string>Documentation for Word</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
Expand Down
8 changes: 4 additions & 4 deletions Commands/Run Ruby (:usr:local:bin:ruby).plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ fi
# save file, add shebang if it's missing (RubyMate needs it)
{ read SHEBANG
if [[ "${SHEBANG:0:2}" != "#!" ]]; then
echo "#!${TM_RUBY:-/usr/bin/env ruby}"
fi
# if [[ "${SHEBANG:0:2}" != "#!" ]]; then
# echo "#!${TM_RUBY:-/usr/bin/env ruby}"
# fi
echo "$SHEBANG"; cat; } &gt;"${TM_FILEPATH:=$TM_RUBYMATE_TMPFILE}"
[[ ${TM_WARN_LEVEL:-0} &gt; 0 ]] &amp;&amp; w='-w' || w=''
Expand All @@ -29,7 +29,7 @@ fi</string>
<key>keyEquivalent</key>
<string>@r</string>
<key>name</key>
<string>Run Ruby</string>
<string>Run Script</string>
<key>output</key>
<string>showAsHTML</string>
<key>scope</key>
Expand Down
2 changes: 1 addition & 1 deletion Commands/Run focused unit test.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ${TM_RUBY:=ruby} "$TM_FILEPATH" --name=$method</string>
<key>lineCaptureRegister</key>
<string>2</string>
<key>name</key>
<string>Run focused Ruby unit test</string>
<string>Run Focused Unit Test</string>
<key>output</key>
<string>separateWindow</string>
<key>scope</key>
Expand Down
2 changes: 1 addition & 1 deletion Macros/New method 2.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<key>keyEquivalent</key>
<string>$</string>
<key>name</key>
<string>New method</string>
<string>New Method</string>
<key>scope</key>
<string>source.ruby</string>
<key>scopeType</key>
Expand Down
2 changes: 1 addition & 1 deletion Macros/Overwrite } in #{ .. }.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<key>keyEquivalent</key>
<string>}</string>
<key>name</key>
<string>Overwrite } in #{ .. }</string>
<string>Overwrite '}' in #{ .. }</string>
<key>scope</key>
<string>source.ruby string.quoted source.ruby.embedded</string>
<key>scopeType</key>
Expand Down
2 changes: 1 addition & 1 deletion Snippets/open yield block ({).plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>content</key>
<string>{ ${1/(^(?&lt;var&gt;\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g&lt;var&gt;)*,?\s*$)|.*/(?1:|)/}${1:variable}${1/(^(?&lt;var&gt;\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g&lt;var&gt;)*,?\s*$)|.*/(?1:| )/}${2:$TM_SELECTED_TEXT} </string>
<key>name</key>
<string>open yield block ({)</string>
<string>{ |variable| .. } ({)</string>
<key>scope</key>
<string>source.ruby - string - comment</string>
<key>tabTrigger</key>
Expand Down
13 changes: 8 additions & 5 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
<!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>deleted</key>
<array>
<string>013EE699-7FD7-11D9-8343-000A95A89C98</string>
</array>
<key>name</key>
<string>Ruby</string>
<key>ordering</key>
<array>
<string>8C102BE9-6E49-11D9-A933-000D93589AF6</string>
<string>5289EE40-86B8-11D9-A8D4-000A95E13C98</string>
<string>EE5F19BA-6C02-11D9-92BA-0011242E4184</string>
<string>76FCF165-54CB-4213-BC55-BD60B9C6A3EC</string>
<string>63F3B3B7-CBE2-426B-B551-657733F3868B</string>
<string>EE5F1FB2-6C02-11D9-92BA-0011242E4184</string>
<string>EE5F1AE5-6C02-11D9-92BA-0011242E4184</string>
<string>013EE699-7FD7-11D9-8343-000A95A89C98</string>
<string>63F3B3B7-CBE2-426B-B551-657733F3868B</string>
<string>5289EE40-86B8-11D9-A8D4-000A95E13C98</string>
<string>8C102BE9-6E49-11D9-A933-000D93589AF6</string>
<string>92EAEEFE-2116-4404-9421-A34945E59540</string>
<string>E5158F94-CC52-4424-A495-14EF9272653F</string>
<string>840B9C4C-7037-4C3B-9028-EB9DC75EDB3E</string>
Expand All @@ -40,9 +43,9 @@
<string>667083EE-62C3-11D9-B8CF-000D93589AF6</string>
<string>B9E3A6DF-875D-11D9-897C-000393CBCE2E</string>
<string>6670835F-62C3-11D9-B8CF-000D93589AF6</string>
<string>855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C</string>
<string>C1C179B1-5AC9-47B7-8B2D-E9ABE5885353</string>
<string>D982D275-2E9F-4E73-B049-CC3D26CDD23D</string>
<string>855FC4EF-7B1E-48EE-AD4E-5ECB8ED79D1C</string>
<string>E00B62AC-6B1C-11D9-9B1F-000D93589AF6</string>
<string>6D75102B-6E51-4360-8F12-BE12327B6AE6</string>
<string>6FEAF60F-F0F3-4618-9259-DE93285F50D1</string>
Expand Down

0 comments on commit 84cbd04

Please sign in to comment.