IDLE like interactive console for Ruby

2019-07-26 07:44发布

I'm starting out with Ruby and was wondering if there's an interactive console similar to Python's IDLE, you know, with context highlighting and autocompletion. I've tried IRB, but it's fairly spartan (although it gets the work done; no question about that). Googling hasn't helped. You guys have any suggestions?

3条回答
我命由我不由天
2楼-- · 2019-07-26 07:59

You should check pry . it is awesome . it includes syntax highlighting , tab completion and many other features .

查看更多
Anthone
3楼-- · 2019-07-26 08:03

There are a lot of gems that add functionality to IRB (colored output, better history, formatted output, etc). Just search http://gemcutter.org for them. Next to that, IRB comes with tab-completion. Start it with "irb -r 'irb/completion'" or put

require 'irb/completion'

in your ~/.irbrc

查看更多
我只想做你的唯一
4楼-- · 2019-07-26 08:09

If you are a Vim user, you can run Vim within IRB by using the interactive editor gem. Even if you are not a Vim user, this gem apparently enables you to use any other text editor from inside IRB.

There is also a similar gem called sketches, but I have not tried it myself.

查看更多
登录 后发表回答