buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Toulme <anto...@lunar-ocean.com>
Subject Re: Redirecting RJB output
Date Tue, 15 Sep 2009 17:38:00 GMT
So, I would have a .class file for the Java code needed, that I would add to
buildr.The .class would be added to the RJB classpath, and the manipulation
itself would be done on Java.load.
I can probably to do this in a pluggable way (read: as a separate project).

Thanks,

Antoine

On Tue, Sep 15, 2009 at 17:53, Alex Boisvert <alex.boisvert@gmail.com>wrote:

> It should work fine and I don't see a better approach.
>
> alex
>
>
>
> On Tue, Sep 15, 2009 at 6:41 AM, Antoine Toulme <antoine@lunar-ocean.com>wrote:
>
>> Hi everyone,
>> I'm trying to find a nice way to redirect the RJB output. I have some
>> output
>> made directly from Java that I would like to reformat and eventually
>> colorize.
>>
>> From what I read, the best solution would be to replace the PrintStreams
>> used in System.out and System.err by something that would pipe to $stdout
>> and $stderr respectively.
>>
>> From the RJB doc, I see RJB can bind a Ruby object to a Java interface.
>> That
>> sounds like the right deal...
>>
>> but PrintStream is a class.
>>
>> The workaround is to have some Java code exposing an interface, with a
>> PrintStream implementation that delegates everything to said interface,
>> and
>> have RJB instanciate the interface and pass output along to stdout and
>> stderr.
>>
>> Was this attempted before ? Any advice on this ?
>>
>> Thanks,
>>
>> Antoine
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message