Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > IRB tab-completion fails for directories in ruby 0.9.1

Reply
Thread Tools

IRB tab-completion fails for directories in ruby 0.9.1

 
 
Stuart Coleman
Guest
Posts: n/a
 
      09-24-2009
I recently upgraded from Ruby 0.8.6 to 0.9.1, and was trying out some
old scripts to make sure they worked. The scripts were typically run in
IRB and performed some calculations with data saved in a networked
drive. Because the scripts are stored on my local computer I would have
to navigate over to the drive by doing something like:
"ScriptName.action 'Z:/directory/filename.bin'". In 0.8.6 I was able to
enter that filepath through tab completion, but this no longer works.

After trying to debug this problem it seems that IRB now only allows tab
completion for the methods you get from entering "require
'irb/completion'", and whatever is in the folder IRB is launched from.
So if I launch from folder "foo" which contains folder "bar", I can tab
complete 'bar/' but won't see anything in that folder.

I feel pretty confident that getting back to the old behavior is a
simple matter of setting some option, but can't for the life of me find
it (I've been googling for some time now). Any help is much appreciated.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Seebs
Guest
Posts: n/a
 
      09-24-2009
On 2009-09-24, Stuart Coleman <(E-Mail Removed)> wrote:
> I recently upgraded from Ruby 0.8.6 to 0.9.1,


Might you mean *1*.8.6 and *1*.9.1?

If not, I might recommend that you try something a LITTLE more recent,
because I'm pretty sure 0.9.1 was a while back.

(And I'm afraid I'm otherwise useless to you, as I didn't even know irb
had any kind of tab completion at all.)

-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
 
Reply With Quote
 
 
 
 
Stuart Coleman
Guest
Posts: n/a
 
      09-24-2009
Seebs wrote:
> On 2009-09-24, Stuart Coleman <(E-Mail Removed)> wrote:
>> I recently upgraded from Ruby 0.8.6 to 0.9.1,

>
> Might you mean *1*.8.6 and *1*.9.1?
>
> If not, I might recommend that you try something a LITTLE more recent,
> because I'm pretty sure 0.9.1 was a while back.
>
> (And I'm afraid I'm otherwise useless to you, as I didn't even know irb
> had any kind of tab completion at all.)
>
> -s


Yeah, I noticed that error slightly after posting, but couldn't see a
way to edit. That's the problem with working with a bunch of different
versions of several different packages, version numbers get all jumbled
up.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
cldwalker
Guest
Posts: n/a
 
      09-25-2009

> After trying to debug this problem it seems that IRB now only allows tab
> completion for the methods you get from entering "require
> 'irb/completion'", and whatever is in the folder IRB is launched from.
> So if I launch from folder "foo" which contains folder "bar", I can tab
> complete 'bar/' but won't see anything in that folder.


If you start irb without completion i.e. `irb -f`, irb should let
readline
default to file completion. You can also explicitly tell readline to
do file
completion but then you will lose irb's method completion:

Readline.completion_proc = Readline::FILENAME_COMPLETION_PROC

If you're still having trouble with completing subdirectories, you may
need to tweak
some Readline settings: http://ruby-doc.org/core-1.9/classes...e.html#M003133
 
Reply With Quote
 
Stuart Coleman
Guest
Posts: n/a
 
      09-25-2009
cldwalker wrote:

> If you start irb without completion i.e. `irb -f`, irb should let
> readline
> default to file completion. You can also explicitly tell readline to
> do file
> completion but then you will lose irb's method completion:
>
> Readline.completion_proc = Readline::FILENAME_COMPLETION_PROC
>
> If you're still having trouble with completing subdirectories, you may
> need to tweak
> some Readline settings:
> http://ruby-doc.org/core-1.9/classes...e.html#M003133


I tried starting with -f, that didn't work. I tried starting with
--readline, that didn't work. I tried both, I tried entering
"Readline.completion_proc = Readline::FILENAME_COMPLETION_PROC" after
each of those things, and that didn't work.

All of this (besides the launching commands) has been done in IRB
itself. I tried setting the config file but can't find the damn thing,
and don't think it should matter anyway (it seems like those are only
settings you can set either within IRB or as you launch it).

As for tweaking Readline itself, how would I go about doing that? I'm
not even sure where to begin with that.

Thanks for your help.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
irb require ... where does irb look? what path? anne001 Ruby 1 06-27-2006 12:07 PM
irb question - variable definitions when calling irb from a script problem Nuralanur@aol.com Ruby 1 10-26-2005 09:13 PM
[ANN] irb-history 1.0.0: Persistent, shared Readline history for IRB Sam Stephenson Ruby 1 06-18-2005 08:56 AM
How to map Project directories to Production sub-directories Joel Finkel ASP .Net 0 09-12-2003 06:47 PM
Using virtual directories for common directories (scripts, images, styles, etc.) Jeffry van de Vuurst ASP .Net 2 07-30-2003 07:00 PM



Advertisments