I’ve searched around for this, but have so far come up dry. Is there a way to run the currently selected text through a ruby interpreter and replace with the result?
Run Selection as Ruby Code?
canadaduane
#2
I see from the Build System documentation [1] that it’s possible to use any executable or shell script to “build” your project or file. I thought this might be a solution, but it doesn’t appear to allow for piping selected text through to the shell. It does allow for the whole file, however:
{
"cmd": "python", "-u", "$file"],
"file_regex": "^ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
0 Likes
canadaduane
#3
I’m still searching for an answer, but for others who may find this post later:
Darin Morrison has created a python version of what I’m looking for and hosts it at github [1]. I wonder if it would be easy to modify it to execute selected text inside a Ruby interpreter instead…
[1] SublimeMeta - execute python / shell commands from buffer
0 Likes
I’ve done for PHP, you can tailor to your needs.
github.com/ralphschindler/Sublime-PHP-Extras
-ralph
0 Likes