|
3 | 3 | <plist version="1.0">
|
4 | 4 | <dict>
|
5 | 5 | <key>beforeRunningCommand</key>
|
6 |
| - <string>nop</string> |
| 6 | + <string>saveModifiedFiles</string> |
7 | 7 | <key>command</key>
|
8 |
| - <string>#!/usr/bin/env ruby18 -wKU |
9 |
| -
|
10 |
| -require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb' |
11 |
| -require ENV["TM_SUPPORT_PATH"] + "/lib/tm/htmloutput" |
12 |
| -
|
13 |
| -TextMate.require_env_var("SCALA_HOME", "Please set the SCALA_HOME shell variable to the root of your scala installation. For me this is /Users/Mads/dev/programming_languages/scala-2.8.0.final") |
14 |
| -
|
15 |
| -if ENV['TM_FILEPATH'] != nil |
16 |
| - TextMate::HTMLOutput.show( |
17 |
| - :title => "Running: #{ENV['TM_FILEPATH']}", |
18 |
| - :sub_title => "") do |io| |
19 |
| - cmd = ENV['SCALA_HOME'] + "/bin/scala -nocompdaemon -howtorun:script " + "'" + ENV['TM_FILEPATH'] + "'" |
20 |
| - io << "<pre><code>" |
21 |
| - io << `#{cmd}` |
22 |
| - io << "</code></pre>" |
23 |
| - end |
24 |
| -else |
25 |
| - puts "Please save your file first" |
26 |
| -end |
27 |
| -
|
| 8 | + <string>#!/usr/bin/env ruby18 |
28 | 9 |
|
| 10 | +require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/executor" |
| 11 | +require "#{ENV['TM_SUPPORT_PATH']}/lib/tm/save_current_document" |
29 | 12 |
|
| 13 | +TextMate.save_if_untitled('scala') |
| 14 | +TextMate::Executor.run(ENV['TM_SCALA'], '-nocompdaemon', '-howtorun:script', ENV['TM_FILEPATH'], :version_args => ["-version"], :version_regex => /\AScala code runner version ([^\s]*).*/m) |
30 | 15 | </string>
|
31 | 16 | <key>input</key>
|
32 | 17 | <string>document</string>
|
|
35 | 20 | <key>keyEquivalent</key>
|
36 | 21 | <string>@r</string>
|
37 | 22 | <key>name</key>
|
38 |
| - <string>Run as script</string> |
| 23 | + <string>Run</string> |
39 | 24 | <key>outputCaret</key>
|
40 | 25 | <string>afterOutput</string>
|
41 | 26 | <key>outputFormat</key>
|
42 | 27 | <string>html</string>
|
43 | 28 | <key>outputLocation</key>
|
44 | 29 | <string>newWindow</string>
|
| 30 | + <key>requiredCommands</key> |
| 31 | + <array> |
| 32 | + <dict> |
| 33 | + <key>command</key> |
| 34 | + <string>scala</string> |
| 35 | + <key>locations</key> |
| 36 | + <array> |
| 37 | + <string>/usr/local/bin/scala</string> |
| 38 | + <string>/opt/local/bin/scala</string> |
| 39 | + </array> |
| 40 | + <key>variable</key> |
| 41 | + <string>TM_SCALA</string> |
| 42 | + </dict> |
| 43 | + </array> |
45 | 44 | <key>scope</key>
|
46 | 45 | <string>source.scala</string>
|
47 | 46 | <key>uuid</key>
|
|
0 commit comments