Sublime Forum

"build" / execute ruby code

#1

A nice feature of textmate was the ability to run a block of ruby directly inside the editor, and I would love to know if this is possible in Sublime2?

Thanks

-John

0 Likes

#2

Anyone?

0 Likes

#3
0 Likes

#4

Figured this out,

Edit ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Ruby/Ruby.sublime-build

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

Then it builds

-John

0 Likes

#5

Question on this, Is there any way to execute code w/o having to save the file ? You dont have to save the file in TextMate and I would love the same for Sublime2

0 Likes

#6

Tried SublimeREPL?

0 Likes

#7

I’ve just written a small plugin to do this for PHP, perhaps it can help you:

github.com/ralphschindler/Sublime-PHP-Extras

-ralph

0 Likes