[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] fxirb 0.2.0 - Multiline Edit (and request for help

Martin DeMello

4/10/2005 4:28:00 PM

available at http://rubyforge.org/proje...

Finally got around to my 0.2 milestone, proper multiline editing.

You can now:

1. Paste in a multiline block of code and edit it immediately using all
four arrow keys

2. Enter a multiline block line by line, and have it occupy a single
multiline slot in the history once it's done

3. Edit a multiline history item using all four arrow keys

Associated behaviour change:

Up/Down arrows now only scroll history if not in multiline mode
PgUp/PgDn always scroll history

The other major change is the ability to pass in an on_exit block, which
is instance_evaled by the FxIRB widget when its internal IRB thread
exits. Usage:

fxirb = FXIrb.init(window, nil, 0,
LAYOUT_FILL_X|LAYOUT_FILL_Y|TEXT_WORDWRAP|TEXT_SHOWACTIVE)
fxirb.on_exit {exit}

This should make it possible to embed fxirb in another application, and
not have the whole application exit when IRB exits.

The target for the 0.3 and 0.4 milestones are a menu-and-button frame in
standalone mode, and an implementation of 'gets' (I really would like
some help with the latter - I don't know enough about IRB internals or
FOX to see what I need to do. To see the problem, just start up FXIrb
and type in "a = gets")

martin

Changelog:

0.2.0 - Martin DeMello - 2005/04/10
* Multiline edit
* Settable on_exit proc

0.1.4 - Martin DeMello - 2005/02/19
* Minor code cleanup
* Dedentation on ], } or end
* Ctrl-D, Ctrl-U and Ctrl-K keys bound

0.1.3 - Martin DeMello - 2004/03/21

* Added ability to select text, and return the cursor to the proper position
* Changed font to Lucida Console
* Added indentation

0.1.2 - Frailis - 2003/01/10

* Fixed commands history

0.1.1 - Frailis - 2003/01/07

* Removed IOEmulate module because it redirects every "p" operation in a program which embeds FXIrb

0.1.0 - Frailis - 2003/01/02

* Tested on ruby 1.6.7 and 1.7.3
* Added commands history and terminal behaviour

19 Answers

B. K. Oxley (binkley)

4/10/2005 5:01:00 PM

0

To use fxirb I need fox12 but am having difficulty using gem to install
it on Cygwin. What is the suggestion for getting fox ruby support for
Cygwin?


Cheers,
--binkley


Martin DeMello

4/10/2005 5:27:00 PM

0

"B. K. Oxley (binkley)" <binkley@alumni.rice.edu> wrote:
> To use fxirb I need fox12 but am having difficulty using gem to install
> it on Cygwin. What is the suggestion for getting fox ruby support for
> Cygwin?

Sorry, I've never tried this - I just use the one-click installer.

http://www.fox-toolkit.org/in... suggests that fox compiles
cleanly under cygwin, at least.

Also, I'm not using any fancy fox features, so it should be possible to get
this running under Fox 1.0 if that is less problematic than 1.2. Let me
know if you need to go down that route, and I'll help port it back to
1.0 (IIRC porting it to 1.2 in the first place was trivial, but I don't
have a Fox 1.0 install around any more to check it).

martin

Peter Suk

4/10/2005 6:21:00 PM

0

On Apr 10, 2005, at 12:00 PM, B. K. Oxley (binkley) wrote:

> To use fxirb I need fox12 but am having difficulty using gem to
> install it on Cygwin. What is the suggestion for getting fox ruby
> support for Cygwin?

Binkley,

Would you be interested in getting together sometime? Feel free to
give me a call. 713-807-9023.

--Peter


--
There's neither heaven nor hell, save what we grant ourselves.
There's neither fairness nor justice, save what we grant each other.



Peter Suk

4/10/2005 6:22:00 PM

0

On Apr 10, 2005, at 12:00 PM, B. K. Oxley (binkley) wrote:

> To use fxirb I need fox12 but am having difficulty using gem to
> install it on Cygwin. What is the suggestion for getting fox ruby
> support for Cygwin?

Drat, I didn't mean to send to that address!

--Peter


--
There's neither heaven nor hell, save what we grant ourselves.
There's neither fairness nor justice, save what we grant each other.



Its Me

4/11/2005 3:07:00 AM

0


"Martin DeMello" <martindemello@yahoo.com> wrote


in message news:Wtc6e.953812$8l.185173@pd7tw1no...
> available at http://rubyforge.org/proje...
>
> Finally got around to my 0.2 milestone, proper multiline editing.

Thanks! I'm getting quite a nice flow between my editor and fxirb now!

btw, on XP some messages (streams?) seem to come out on the command window,
not the fx window e.g.
(irb):14: warning: parenthesize argument(s) for future version
(irb):14: warning: parenthesize argument(s) for future version



Csaba Henk

4/11/2005 4:23:00 AM

0

On 2005-04-10, Martin DeMello <martindemello@yahoo.com> wrote:
> available at http://rubyforge.org/proje...
>
> Finally got around to my 0.2 milestone, proper multiline editing.

That sounds cool. I wanted to give it a try under Linux, but with my
existing fxruby installation (1.2.2) it segfaulted; then I upgraded my
fxruby to 1.2.5, which just hanged upon pressing enter.

> The target for the 0.3 and 0.4 milestones are a menu-and-button frame in
> standalone mode, and an implementation of 'gets' (I really would like
> some help with the latter - I don't know enough about IRB internals or
> FOX to see what I need to do. To see the problem, just start up FXIrb
> and type in "a = gets")

What's the problem? As you can see, I can't try this now.

Csaba

Martin DeMello

4/11/2005 4:27:00 AM

0

itsme213 <itsme213@hotmail.com> wrote:
>
> "Martin DeMello" <martindemello@yahoo.com> wrote
>
>
> in message news:Wtc6e.953812$8l.185173@pd7tw1no...
> > available at http://rubyforge.org/proje...
> >
> > Finally got around to my 0.2 milestone, proper multiline editing.
>
> Thanks! I'm getting quite a nice flow between my editor and fxirb now!
>
> btw, on XP some messages (streams?) seem to come out on the command window,
> not the fx window e.g.
> (irb):14: warning: parenthesize argument(s) for future version
> (irb):14: warning: parenthesize argument(s) for future version

Can you paste in a sample session? Not seen this happen on Win2k.

martin

Martin DeMello

4/11/2005 6:33:00 AM

0

Csaba Henk <csaba@phony_for_avoiding_spam.org> wrote:
> On 2005-04-10, Martin DeMello <martindemello@yahoo.com> wrote:
> > available at http://rubyforge.org/proje...
> >
> > Finally got around to my 0.2 milestone, proper multiline editing.
>
> That sounds cool. I wanted to give it a try under Linux, but with my
> existing fxruby installation (1.2.2) it segfaulted; then I upgraded my
> fxruby to 1.2.5, which just hanged upon pressing enter.

I've not tested this at all under linux - I based it off Marco Frailis's
win32 fxirb. I should make that my next priority, actually - it's
somewhat more useful than a menu and button frame :).

martin

Martin DeMello

4/11/2005 7:06:00 AM

0

Csaba Henk <csaba@phony_for_avoiding_spam.org> wrote:
> > FOX to see what I need to do. To see the problem, just start up FXIrb
> > and type in "a = gets")
>
> What's the problem? As you can see, I can't try this now.

The whole thing just hangs up (windows says 'this application is not
responding'). I thought it might be infinitely recursing
FXIRBInputMethod#gets, but it isn't, so I'm at a bit of a loss as how to
even debug it (no stack trace).

martin

Csaba Henk

4/11/2005 7:36:00 AM

0

On 2005-04-11, Martin DeMello <martindemello@yahoo.com> wrote:
> Csaba Henk <csaba@phony_for_avoiding_spam.org> wrote:
>> > FOX to see what I need to do. To see the problem, just start up FXIrb
>> > and type in "a = gets")
>>
>> What's the problem? As you can see, I can't try this now.
>
> The whole thing just hangs up (windows says 'this application is not
> responding'). I thought it might be infinitely recursing
> FXIRBInputMethod#gets, but it isn't, so I'm at a bit of a loss as how to
> even debug it (no stack trace).

A line read by irb is evaluated in an IRB::Irb instance (that class is
defined in irb.rb). As I can read fxirb.rb, you didn't overwrite #gets
anywhere seeked by IRB::Irb upon method lookup. So what happens is that
the good old Kernel#gets is called.

Csaba