From: Michal Suchanek Date: 2011-01-13T00:22:43+09:00 Subject: Re: ripl - an irb alternative - 0.3.0 released On 12 January 2011 06:30, ghorner wrote: > On Jan 11, 7:08 am, Michal Suchanek wrote: >> On 11 January 2011 10:40, ghorner wrote: >> >> > On Jan 9, 6:17 am, Michal Suchanek wrote: >> >> On 8 January 2011 16:40, Gabriel Horner wrote: >> > Thanks for the feedback. bond 0.4.0 comes with a --without-readline >> > and fails hard. >> >> Yes, this now works perfectly for me. >> >> >> >> >> > Did you try gem install bond -- --with-readline-lib=/path/to/your/lib >> >> > --with- >> >> > readline-include=/path/to/your/include ? >> >> >> Don't need that. Readline is detected correctly when present. >> >> > So I'm guessing autocompletion works correctly withriplfor your >> > readline? >> >> Yes, with readline autocompletion works. > > Great. > >> > If it doesn't, there's a pure ruby readline you can use withripl: >> >> >    gem installriplrb-readline -- --without-readline >> >> > Then, add to your ~/.riplrc: >> >> >    Ripl.config[:readline] = 'rb-readline' >> >    Ripl.config[:completion] = {:readline => :ruby } >> >> However, I still cannot interrupt printing of output with either >> libreadline5 or rb-readline. > > I don't think that's a readline issue. There is ctrl-c/ Interrupt > support(https://github.com/cldwalker/ripl/blob/master/lib/ripl/ > shell.rb#L57-58) but apparently it's not working for you. To debug > your problem, I would override Shell#loop_once as a plugin and try > some of these suggested ways of capturing ctrl-c: > http://stackoverflow.com/questions/2089421/capturing-ctrl-c-in-ruby Have you even tried? For me it does not interrupt printing long result unless I put something like this in shell.rb: def puts_iter str while str.length > 100 STDOUT << str[0...100] str = str [100..-1] end STDOUT.puts str end # Prints result using #format_result def print_result(result) puts_iter(format_result(result)) unless @error_raised end > >> BTW is it possible to have both ruby completion and file completion? > > Any completion setup you want (and setup) is possible with bond. By > default, ruby and file completion are enabled. > > It works for me with C readline: > >    >> File.read '[TAB] > > If file completion is not working, try: > >    >> Bond.spy "File.read '" > > What do you get back? Is this not working for C readline or rb- > readline? Either. It does not like to complete absolute paths: >> Bond.spy 'File.open "/' Matches completion with condition /[\s(]["']([^'"]*)$/. Possible completions: [] Matches for /[\s(]["']([^'"]*)$/ are [" \"/", "/"] => nil Thanks Michal