> I am currently redesigning a program that shall accept input
> from both a GUI and from a terminal window that runs irb.
>
> In reaction to the input, some output will be written to the
> terminal or/and some controls in the GUI will change.
>
> I need help on the basic architecture of such a system.

Do you know the model view controller design pattern? Also look at
tiered designs where persistence is at the bottom, business logic is on
top of this, and "presentation" is on top of the "business logic".

If you factor out your models and the kinds of changes that it's
possible to make to your system, you should be able to quite cleanly
place a GUI and a command line "presentation" of the underlying system
in to a seperate module. In fact, you should be able to bolt on
arbitrary presentations (web based too, say) without too much trouble :)

You'll probably want some kind of concept of transactions and
synchronisation in the model to allow for different active parties to
make concurrent changes.

Cheers,
  Benjohn