From: Michal Rokos Date: 2002-04-12T02:16:14+09:00 Subject: [Feature] IRB completion Hello, I like the irb/completion feature. I like it that much that I want it enabled by default, but the same moment I don't wont to hurt people that don't have realine compiled in. So this is a little workaround. Could this be accepted to official Ruby sources? Michal Index: lib/irb.rb =================================================================== RCS file: /src/ruby/lib/irb.rb,v retrieving revision 1.3 diff -u -r1.3 irb.rb --- lib/irb.rb 2001/05/08 09:28:19 1.3 +++ lib/irb.rb 2002/04/11 16:45:03 @@ -9,6 +9,16 @@ # # # + +def ext_present(ext) + $LOAD_PATH.each do |path| + if File::exists?(File::join(path, ext)) + return true + end + end + false +end + require "e2mmap" require "irb/init" @@ -19,6 +29,8 @@ require "irb/ruby-lex" require "irb/input-method" require "irb/locale" + +if ext_present("readline.so") then require "irb/completion" end STDOUT.sync = true -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michal Rokos Czech Technical University, Prague E-mail:m.rokos@sh.cvut.cz ICQ:36118339 Jabber:majkl@jabber.sh.cvut.cz -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-