Is there an equivalent in irb to command: history in bash?

Is there an equivalent in irb to the command history in bash?

After I’ve been doing a bunch of work in the shell I often use the
history command in bash to get a list of all the commands I’ve
executed which I copy and past into an editor to document the work I
did.

Is there an equivalent command for irb which would list by lines each
command I have entered? Rightnow I use readline to scan backwards
and copy and paste individually.

Thanks for any suggestions.

On Nov 18, 10:44 pm, Stephen B. [email protected]
wrote:

Thanks for any suggestions.

I think this irb_history business from Ben B. is what you want:
http://blog.bleything.net/pages/irb_history

HTH,
Chris

On Mon, Nov 19, 2007, Chris S. wrote:

I think this irb_history business from Ben B. is what you want:
http://blog.bleything.net/pages/irb_history

I think so too :wink:

Ben

On Mon, Nov 19, 2007, Chris S. wrote:

I think this irb_history business from Ben B. is what you want:
http://blog.bleything.net/pages/irb_history

I think so too :wink:

Thanks … perfect :wink:

Hi, Ben. really great work, :slight_smile:

One more feature request: Why not auto save the history in .irb_history,
just like what the history of bash does?

sishen

On Tue, Nov 20, 2007, sishen wrote:

Hi, Ben. really great work, :slight_smile:

Thanks!

One more feature request: Why not auto save the history in .irb_history,
just like what the history of bash does?

So that’s something that should probably be documented better. The code
that I wrote relies on pre-existing history enabler code. It is meant
as a supplement to something like Michael G.'s persistent IRB
history:

or Wirble (gem install wirble), which just packages the above with some
other IRB hacks. If you set up Michael’s code or install wirble and
enable history, it’ll save your history between sessions.

My code does not replace that stuff; it serves a different purpose.
Mine is about accessing the history you already have. I’ve been meaning
to re-open a conversation I was having with wirble’s author over a year
ago, to get my code included there. Once that happens (if Paul is still
interested), you’ll be able to just install/enable wirble and have all
your history goodies for free.

Hope that answers your question :slight_smile:

Ben

On Mon, 19 Nov 2007, Ben B. wrote:

On Mon, Nov 19, 2007, Chris S. wrote:

I think this irb_history business from Ben B. is what you want:
http://blog.bleything.net/pages/irb_history

I think so too :wink:

Ben

Ben, don’t you want to add a link from the blog entry to where people
can
get the chunk of code that will perform the magic?
*t

On Tue, Nov 20, 2007, Tomas P.'s Mailing L. wrote:

On Mon, Nov 19, 2007, Chris S. wrote:

I think this irb_history business from Ben B. is what you want:
http://blog.bleything.net/pages/irb_history

Ben, don’t you want to add a link from the blog entry to where people can
get the chunk of code that will perform the magic?

The link from the thread takes you to the actual code, and both blog
posts (linked below) link to it as well. Maybe it’s not obvious enough?
Or are you talking about a different page?

http://blog.bleything.net/2006/10/21/shell-style-history-for-irb
http://blog.bleything.net/2007/7/30/announcing-shell-style-history-for-irb-the-fixed-edition

Ben

On Tue, 20 Nov 2007, Ben B. wrote:

Or are you talking about a different page?

http://blog.bleything.net/2006/10/21/shell-style-history-for-irb
http://blog.bleything.net/2007/7/30/announcing-shell-style-history-for-irb-the-fixed-edition

Oh, I was coming from the “RubyConf stuff” blog entry which AFAICS
doesn’t
have a pointer to the code. I didn’t verify the other blog entries links
:-o
*t

On Tue, Nov 20, 2007, Tomas P.'s Mailing L. wrote:

Oh, I was coming from the “RubyConf stuff” blog entry which AFAICS doesn’t
have a pointer to the code. I didn’t verify the other blog entries links
:-o

Woops! You’re right, and I should fix that. And now I have. Thanks :slight_smile:

Ben

Cool~, :slight_smile: