Robert Klemme
3/6/2007 8:15:00 AM
On 06.03.2007 00:09, Kyle Schmitt wrote:
> I think I chose a bad example, I don't want to just find things :) but
> it looks like that's the problem people have aimed at.
>
> The %x{} is very useful for some things I admit.
>
> I've got some areas where a pipe-to-ruby would be really nice. I'm
> sure if it's there I'll find other uses for it too.
>
> Good point about the choice of which irb to send it to though. I was
> planning on looking into how screen finds screens to attach to. If
> only one is open that belongs to that user, it automagically attaches
> to that one, if there is more than one, it politely coughs and
> requests that you specify one. Sadly that does make things a little
> more complex.
>
> Lets just settle on, I'm going to write this since it doesn't exist in
> the form I want to use. And I'm going to write it as an object the
> client has to open.
>
> Now, moving on... Would something like this seem bad (style in ruby,
> in general, or in functionality)
> in irb-----------
> require 'silly/Kpipe'
> mine=Kpipe.new
> puts mine.id
>> 1701
>
> then in the shell (a non find example!)-----------
> #*nix> mpg123 silly.mp3 -s |toruby 1701
>
> then back in irb-----
> mine.each_byte{|i| likeiknowwhattodowithwavdata(i) }
Yeah, you could use the port number (probably using Unix domain sockets)
as that id.
Btw, how do you want to deal with multiple submissions? Do you want to
treat them in IRB as a single stream or as individual streams? The
first is probably easier with a pipe or a file, the latter seems easier
with a socket.
Have fun!
robert