Saving an IRB Session

M

Matthew Cox

Hi,

I'm learning Ruby from the pickaxe book and I'm using the IRB to try
out examples. I'd like to know if it is possible to save to disk the
IRB session so that when I come back I can load up a session to the
state it was in before. Is this possible?

Thanks,
Matt
 
R

Robert Klemme

Matthew Cox said:
Hi,

I'm learning Ruby from the pickaxe book and I'm using the IRB to try
out examples. I'd like to know if it is possible to save to disk the
IRB session so that when I come back I can load up a session to the
state it was in before. Is this possible?

I do not think so. You certainly can store objects to disk (using Marshal
or Yaml) but then you would still be missing a lot info (local variables,
files to require etc.)

If you are on a Unix a workaround might be to use screen.

Kind regards

robert
 
B

Bil Kleb

Matthew said:
Hi,
Hi.

I'm learning Ruby from the pickaxe book and I'm using the IRB to try
out examples. I'd like to know if it is possible to save to disk the
IRB session so that when I come back I can load up a session to the
state it was in before. Is this possible?

This comes up from time-to-time. I don't know if
there is a hands-down winner, but

http://www.google.com/search?q=saving+irb+session

turns up at least two answers:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/68259
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/110924

Regards,
 
J

James Edward Gray II


Even better, Ben Bleything showed off his IRb enhancements for this
in a RubyConf 06 lightening talk. They are quite smooth.

You can get Ben's code from his blog:

http://blog.bleything.net/articles/2006/10/21/shell-style-history-for-
irb

James Edward Gray II
 
B

Ben Bleything

Even better, Ben Bleything showed off his IRb enhancements for this
in a RubyConf 06 lightening talk. They are quite smooth.

You can get Ben's code from his blog:

http://blog.bleything.net/articles/2006/10/21/shell-style-history-for-
irb

Thanks for the mention, James!

I've been meaning to get that cleaned up and post usage examples and
whatnot. In the meantime, if anyone has any questions or suggestions,
I'd be happy to hear 'em.

It also sounds as if Nick Sieger and I are going to be pooling resources
and putting out a gem soon full of similar IRB hacks. Watch this space
:)

Ben
 
P

Paul Duncan

--PNTmBPCT7hxwcZjr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ben Bleything ([email protected]) said:
=20
Thanks for the mention, James!
=20
I've been meaning to get that cleaned up and post usage examples and
whatnot. In the meantime, if anyone has any questions or suggestions,
I'd be happy to hear 'em.
=20
It also sounds as if Nick Sieger and I are going to be pooling resources
and putting out a gem soon full of similar IRB hacks. Watch this space
:)

No one mentioned Wirble, even though it's linked from Ben's post:

http://pablotron.org/software/wirble/

Setup:

$ sudo gem install wirble
$ cat > ~/.irbrc
%w{rubygems wirble}.each { |lib| require lib }
Wirble.init
$

--=20
Paul Duncan <[email protected]> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

--PNTmBPCT7hxwcZjr
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFFR8tezdlT34LClWIRAjp6AKCrzDpsgKbv57k7dGAyrvOqh1I+TgCgqEEc
Nb38aR4V5If79LtXWNz3uRE=
=aCdG
-----END PGP SIGNATURE-----

--PNTmBPCT7hxwcZjr--
 
B

Ben Bleything

--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

No one mentioned Wirble, even though it's linked from Ben's post:
=20
http://pablotron.org/software/wirble/

In the history realm, does wirble do more than just enabling readline?
I use it for colorization and that, but haven't been able to figure out
much else.

I also emailed you a couple of times to see if you wanted to join forces
with Nick and I, but got no response. It occurs to me now that maybe
they didn't make it through?

Ben

--AhhlLboLdkugWU4S
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----

iD8DBQFFR87eNRFiSXP2RtkRAjN2AKDXKLisLrhQjL+mdYRIk52CuV+ocgCeLZwd
MJ2NpA1ZJmhNjYN5W04uvlc=
=PTWX
-----END PGP SIGNATURE-----

--AhhlLboLdkugWU4S--
 
P

Paul Duncan

--0eh6TmSyL6TZE2Uz
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ben Bleything ([email protected]) said:
=20
In the history realm, does wirble do more than just enabling readline?
I use it for colorization and that, but haven't been able to figure out
much else.

That's pretty much it. I went through the Ruby Garden Irb page and
snagged the useful stuff, then rolled it up with my fancy-schmancy
colorization and called it Wirble.
I also emailed you a couple of times to see if you wanted to join forces
with Nick and I, but got no response. It occurs to me now that maybe
they didn't make it through?

I didn't get them. I've been getting over 20k spam messages per month
for the last two months, so it's possible they may have gotten snagged
by my spam filter.

I'll check my spam folder; it might be time to set up a whitelist and/or
re-train spamprobe. :/



--=20
Paul Duncan <[email protected]> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

--0eh6TmSyL6TZE2Uz
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFFSDM+zdlT34LClWIRAryhAKC0pqZmRfxasWgvNJBSvGzOZ9ezMQCfYbiq
sobt34tB+RQ9V2u3JekuGI0=
=mOE2
-----END PGP SIGNATURE-----

--0eh6TmSyL6TZE2Uz--
 
P

Paul Duncan

--s9fJI615cBHmzTOP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ben Bleything ([email protected]) said:
=20
In the history realm, does wirble do more than just enabling readline?
I use it for colorization and that, but haven't been able to figure out
much else.
=20
I also emailed you a couple of times to see if you wanted to join forces
with Nick and I, but got no response. It occurs to me now that maybe
they didn't make it through?

I just checked through my spam folder from last month and I didn't see
anything from you. What address did you email (I'm trying to figure out
if I'm losing mail or if the messages got routed to some other folder).

Anyway, I'm interested in collaberating, or, at the very least,
borrowing your guys' hard work and shamelessly rolling it in to Wirble
:).

PS. As of October, I'm officially over 30k spam messages per month --
Yipee. :(



--=20
Paul Duncan <[email protected]> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

--s9fJI615cBHmzTOP
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFFSEGEzdlT34LClWIRAhGEAJ9rx1E7t5D+QjHJHhXCLbK+49gYJACgpzw+
typ3mx+p+czHKCUrUvjO52E=
=VSa8
-----END PGP SIGNATURE-----

--s9fJI615cBHmzTOP--
 
J

James Edward Gray II

then rolled it up with my fancy-schmancy
colorization and called it Wirble.

Just FYI, there's a bug in Wirble's colorization I'm hitting pretty
often. This exposes it:
=> #<Example:0x74722c @var={:eek:ne=>1, :two=>2}

James Edward Gray II
 
P

Paul Duncan

--+jhVVhN62yS6hEJ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* James Edward Gray II ([email protected]) said:
On Oct 31, 2006, at 11:40 PM, Paul Duncan wrote:
=20
=20
Just FYI, there's a bug in Wirble's colorization I'm hitting pretty =20
often. This exposes it:

Ergh :/.
=3D> #<Example:0x74722c @var=3D{:eek:ne=3D>1, :two=3D>2}

Well now, that's no good. I'll toss it in my pile o' bugs.

Thanks!
James Edward Gray II

--=20
Paul Duncan <[email protected]> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

--+jhVVhN62yS6hEJ8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFFSOaczdlT34LClWIRAlGLAKCBIqWrH4i/Bc2vktoCwGR9BdOFjwCfXdgj
qEt/sFqNPTzmw0H+hoQKVmg=
=2RDx
-----END PGP SIGNATURE-----

--+jhVVhN62yS6hEJ8--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,939
Members
47,484
Latest member
JackRichard

Latest Threads

Top