From: Piyush Ranjan Date: 2010-11-01T19:42:00+09:00 Subject: Re: create a shell within an app --e0cb4e3856661ddcfa0493fb759f Content-Type: text/plain; charset=ISO-8859-1 check out hijack http://github.com/ileitch/hijack On Mon, Nov 1, 2010 at 3:35 PM, Robert Klemme wrote: > On 01.11.2010 07:19, Rahul Kumar wrote: > >> I have a client application - often i am needing to explore/inspect the >> classes that I get from the server. Loading the client each time with a >> logger.debug statement is cumbersome and takes time due to server >> connections and getting data. >> >> I'd like to be able to expose the insides of the client to a shell >> (could be inside the client) or could connect to the client. It's an >> ncurses app, I can always prompt the user on clicking some key. >> >> However, my query is: how does one expose the environment to this shell. >> On the prompt given, I should be able to query objects just as in irb. >> e.g >> >>> x.class >>>> x.public_methods >>>> x.name >>>> >>> > IIRC you can embed IRC pretty easily. The issue then might be how you > limit access to areas of your application that should stay unchanged. > > > Alternatively, is there already some existing gem which allows me to >> expose the internals to a port, so another irb-like client can connect >> and query the state ? >> > > You might just listen on some port with TCPServer and implement a > rudimentary command line interface which then can be connected to via > telnet. That shouldn't be too hard. Depends on your requirements for > security though. > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > > --e0cb4e3856661ddcfa0493fb759f--