# Best Command Prompt

**URL:** <https://www.ruby-forum.com/t/best-command-prompt/151339>\
**Category:** Ruby\
**Created:** [October 20, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339 "2008-10-20T15:07:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/1 "2008-10-20T15:07:12Z")

</div>

There’s a good command interpreter for ruby instead of irb? Like  
ipython for python?

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 3:25pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/2 "2008-10-20T15:25:25Z")

</div>

On Oct 20, 9:05 am, gewton [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> There’s a good command interpreter for ruby instead of irb? Like  
> ipython for python?

How is ipython better than irb?

I’ve been using wirble which improves irb a bit (although I hate that  
it doesn’t allow duplicate entries in the history --anyone know how to  
fix?).

T.

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 3:35pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/3 "2008-10-20T15:35:24Z")

</div>

hi trans!

Trans [2008-10-20 15:23]:

> I’ve been using wirble which improves irb a bit (although I hate that  
> it doesn’t allow duplicate entries in the history --anyone know how to  
> fix?).  
> i always hated that it would store history entries in oldest-first  
> order. so i just copied the code for save\_history from wirble.rb  
> into my .irbrc and adjusted it accordingly:

require ‘wirble’

# save history newest-first, instead of default oldest-first

class Wirble::History  
def save\_history  
return unless Object.const\_defined? :IRB

```
  path, max_size, perms = %w{path size perms}.map { |v| cfg(v) }

  # read lines from history, and truncate the list (if necessary)
  #lines = Readline::HISTORY.to_a.uniq
  lines = Readline::HISTORY.to_a.reverse.uniq.reverse
  lines = lines[-max_size..-1] if lines.size > max_size

  # write the history file
  real_path = File.expand_path(path)
  File.open(real_path, perms) { |fh| fh.puts lines }
  say 'Saved %d lines to history file %s.' % [lines.size, path]
end

```

end

you could simply change the line that fills the ‘lines’ array to  
something like this:

```
  lines = Readline::HISTORY.to_a

```

cheers  
jens

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 6:33pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/4 "2008-10-20T18:33:35Z")

</div>

On Oct 20, 9:33 am, Jens W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> require ‘wirble’  
> lines = Readline::HISTORY.to\_a.reverse.uniq.reverse  
> something like this:
> 
> ```
> lines = Readline::HISTORY.to_a
> 
> ```

awesome. thanks jens.

maybe i’ll do a little work on wirble to make it more flexible for  
variant preferences like ours and post a patch.

t.

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 3:43pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/5 "2008-10-20T15:43:03Z")

</div>

2008/10/20 gewton [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> There’s a good command interpreter for ruby instead of irb? Like  
> ipython for python?

What functionality are you missing in IRB?

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 8:09pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/6 "2008-10-20T20:09:22Z")

</div>

Robert K. wrote:

> 2008/10/20 gewton [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > There’s a good command interpreter for ruby instead of irb? Like  
> > ipython for python?
> 
> What functionality are you missing in IRB?
> 
> Kind regards
> 
> robert  
> I believe what he’s looking for is a \*nix command shell (like sh) that  
> implements ruby scripting language features.

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/7 "2008-10-20T18:35:57Z")

</div>

Trans [2008-10-20 18:31]:

> maybe i’ll do a little work on wirble to make it more flexible  
> for variant preferences like ours and post a patch.  
> that would be great! let me know if i can lend a hand.

cheers  
jens

---

<div class="post-metadata">

**Author:** ![gewton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@gewton](https://www.ruby-forum.com/u/gewton)\
**Post date:** [October 20, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/best-command-prompt/151339/8 "2008-10-20T21:10:11Z")

</div>

On Mon, Oct 20, 2008 at 11:08 AM, David W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I believe what he’s looking for is a \*nix command shell (like sh) that  
> implements ruby scripting language features.

If that’s the case: [http://rush.heroku.com/](http://rush.heroku.com/)

FWIW,
