0

I've noticed that when i run a ruby command prompt and enter anything, i always get something returned.

4
=> 4

4.class
=> Fixnum

The command prompt is fine but i want somewhere to save my ruby so i can open it again later etc.

I downloaded netbeans and noticed that 4 and 4.class didn't actually return anything. Fine I thought, maybe that's because it's JRuby or something. I downloaded Komodo Edit and that behaves the same, 4 and 4.class do not return a value when i run the script from Komodo Edit.

The default intepreter path in Komodo Edit 8 is set to

C:\Ruby200-x64\bin\ruby.exe

Can I setup netbeans or komodo edit to behave the same as a ruby command prompt by returning something for every piece of code i enter? Is there another IDE I can use to accomplish this?

5uperdan
  • 1,481
  • 2
  • 14
  • 30
  • It's not entirely clear what you mean by "save my ruby". Do you mean run a session in IRB and save its state so you can resume it later? You do know you can save your "ruby" to a file and actually run it using Ruby's interpreter, right? IMO, relying on an IDE is less flexible than using an editor like Sublime or vim and running your code at the command-line. – the Tin Man Mar 06 '14 at 23:45
  • There are a number of editors you can configure with `xmpfilter` to do something similar to what you're describing; I'm not sure if netbeans or komodo are among them. [See this video](http://devblog.avdi.org/2013/06/24/rubytapas-freebie-xmpfilter/) for an example. – Zach Kemp Mar 07 '14 at 00:55
  • @theTinMan Thanks for your comment. I do realise all of that. Komodo Edit is really just a fancy text editor like Vim or Sublime and I could use it to save my file then run it at the command line. I just thought since it has the ability to output then if i could make that output match the command line then i wouldn't need so much open and i could streamline development a little. – 5uperdan Mar 07 '14 at 10:59
  • @ZachKemp Thanks for taking the time to link me to that. It looks interested so I may try to implement it in something – 5uperdan Mar 07 '14 at 11:00

1 Answers1

1

Use the following process for Komodo Edit:

  • Click Tools=>Run Command
  • In the Run field, enter %(ruby) -i %f
  • In the Run in: field, select New Console or Command Output Tab
  • Check Add to Toolbox

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265