Sublime Text 2 Run ruby ​​file in terminal

I am trying to run a terminal from Sublime Text 2, which will run a Ruby file (via the build system). The reason I am not using the ruby ​​built-in build system is because my ruby ​​script accepts input that does not work in the elevated output panel .

Does anyone have a build system that does this?

+5
source share
2 answers

OK, you can create a ruby.sh file (for example, in your home folder):

/home/your/home/ruby.sh

 #!/bin/sh
 /usr/bin/xterm -e /bin/sh -c "/path/to/ruby $1; exec /bin/sh" &

Create a new Sublime build file:

{
    "cmd": ["/home/your/home/ruby.sh", "$file"]
}

, CTRL-B, ruby.sh , ruby ​​ /. xterm ().

+1

, .

1 , :  ~/Library/ /Sublime Text 2//

, , :... APPDATA/ROAMING/Sublime Text2/...

2 . , :

{
    "cmd": ["~/.rvm/bin/rvm-auto-ruby", "$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.ruby"
}

:

0

All Articles