-
-
Save Stanley/82581 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function irb( input ){ | |
jQuery.ajaxSetup({ | |
async: false | |
}); | |
var baseUrl = "http://tryruby.hobix.com/irb"; | |
var params = {cmd: "!INIT!IRB!"}; | |
jQuery.get( baseUrl, params); | |
var params = {cmd: input}; | |
return jQuery.get( baseUrl, params ).responseText.replace(/\n/g, "<br/>"); | |
} | |
CmdUtils.CreateCommand({ | |
names: ["irb"], | |
icon: "http://ruby-doc.org/favicon.ico", | |
homepage: "http://wasiutynski.net/blog", | |
author: { name: "Stanislaw Wasiutynski", email: "stanislaw@wasiutynski.net"}, | |
license: "GPL", | |
description: "Interactive Ruby Shell", | |
help: "Insert your ruby code", | |
arguments: {role: "object", nountype: noun_arb_text, label: "code"}, | |
preview: function( pblock, input ) { | |
pblock.innerHTML = irb( input.object.text ); | |
}, | |
execute: function( input ) { | |
CmdUtils.setSelection( irb( input.object.text ) ); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment