Pasting code with tab indentation to irb

B

benny

dear list,

I want to be able to copy/paste code with tab indentation to irb, but I
don't know how to setup irb for this.

I am aware of

require 'irb/completion'

in the .irbrc taking the tab completition away from the shell and
making its own tab completition.

So maybe I may overwrite some method in irb/ irb/completition to prevent
irb tab completition and shell/bash tab completition.

I tried to figure it out on my own but didn't succeed.

Any hints? (Please no discussion about tab indentation vs. space indentation
here :) )


benny
 
M

Mark Hubbart

dear list,
=20
I want to be able to copy/paste code with tab indentation to irb, but I
don't know how to setup irb for this.
=20
I am aware of
=20
require 'irb/completion'
=20
in the .irbrc taking the tab completition away from the shell and
making its own tab completition.
=20
So maybe I may overwrite some method in irb/ irb/completition to prevent
irb tab completition and shell/bash tab completition.
=20
I tried to figure it out on my own but didn't succeed.
=20
Any hints? (Please no discussion about tab indentation vs. space indentat= ion
here :) )

You could assign a new input method to IRB.CurrentContext.io:
IRB.CurrentContext.io =3D IRB::StdioInputMethod.new

Write a short-named method that toggles the input method between
IRB::StdioInputMethod and IRB::ReadlineInputMethod, and you can
quickly switch between the two modes.

cheers,
Mark
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top