Colorized irb on JRuby Windows?

Does anyone have any tips on getting colorized output on irb sessions
through JRuby on Windows? I have used Wirble in the past for CRuby (
http://pablotron.org/software/wirble/) but since that seems to spew
really
ugly output to the console on Windows for JRuby, I wasn’t sure if there
were
better options out there.

PS C:\mydocs> jruby -S irb -f
irb(main):001:0> require ‘rubygems’
=> true
irb(main):002:0> require ‘wirble’
=> true
irb(main):003:0> Wirble.init
=> nil
irb(main):004:0> Wirble.colorize
=> ←[0;32mnil←[0;0m
irb(main):005:0> x = false
=> ←[0;32mfalse←[0;0m
irb(main):006:0> true
=> ←[0;32mtrue←[0;0m
irb(main):007:0> array = [3, 5, 6, 1]
=> ←[0;32m[←[0;0m←[0;36m3←[0;0m←[0;34m,←[0;0m
←[0;36m5←[0;0m←[0;34m,←[0;0m
←[0;36m6←[0;0m←[0;34m,←[0;0m ←[0;36m1←[0;0m←[0;32m]←[0;0m

-Nick K.

=> true
←[0;36m6←[0;0m←[0;34m,←[0;0m ←[0;36m1←[0;0m←[0;32m]←[0;0m
Haven’t tried it yet with wirble, but have you tried
http://adoxa.110mb.com/ansicon/index.html to see if they play well
together?

Jon


blog: http://jonforums.github.com/
twitter: @jonforums

Trying your suggestion, that doesn’t seem to affect the output at all.
I’ve
also tried installing some gems with 1.6.0RC1 to see if they can compile
down for me (win32console, for one) but that doesn’t seem to work with
the
DevKit or Jruby 1.6.0.

-Nick K.

Trying your suggestion, that doesn’t seem to affect the output at all.

Did you do something like open a new Command Prompt, type “ansicon -p”
(assuming it’s on PATH), and then fire up jirb?

I do something similar to get a colorized plink (SSH) session to a linux
server and thought it might have worked straight away. Downloading
wirble now…

Jon


blog: http://jonforums.github.com/
twitter: @jonforums

Trying your suggestion, that doesn’t seem to affect the output at all.

Did you do something like open a new Command Prompt, type “ansicon -p” (assuming
it’s on PATH), and then fire up jirb?

I do something similar to get a colorized plink (SSH) session to a linux server
and thought it might have worked straight away. Downloading wirble now…

It seems to be working for me on 1.6.0.RC1 in 1.8 mode.

open new Command Prompt
ansicon -p
gem install wirble
jirb
irb(main):001:0>require ‘rubygems’
irb(main):002:0>require ‘wirble’
irb(main):003:0>Wirble.init
irb(main):004:0>Wirble.colorize

and then started playing with arrays and hashes and got colorized
results

Jon


blog: http://jonforums.github.com/
twitter: @jonforums

…I’ve also tried installing some gems with 1.6.0RC1 to see if they can compile
down for me (win32console, for one) but that doesn’t seem to work with the
DevKit or Jruby 1.6.0.

If you’re talking about JRuby’s new native C extension support, please
start another thread for that topic.

I’m guessing you’ve already checked out
http://jonforums.github.com/ruby/2010/11/30/devkit-jruby-c-extensions.html
which is a bit old but maybe helpful.

I’m fairly sure you’ll need to first build the
lib/native/i386-Windows/jruby-cext.dll before things have a chance of
working. IIRC it’s not included by default in the
jruby-bin-1.6.0.RC1.tar.gz download.

Jon


blog: http://jonforums.github.com/
twitter: @jonforums

I’m going to have to dig into this a bit more. I’m not able to get
anything
colorized to output on JRuby, even following your walkthrough. However,
since it works for you, I’m sure there’s something goofing up my
environment, so back to the workshop I go.

-Nick K.

gem install wirble
jirb
irb(main):001:0>require ‘rubygems’
irb(main):002:0>require ‘wirble’
irb(main):003:0>Wirble.init
irb(main):004:0>Wirble.colorize

and then started playing with arrays and hashes and got colorized results

forgot the link to the screenshot
https://www.dropbox.com/gallery/3269968/1/examples?h=65c73e

Jon


blog: http://jonforums.github.com/
twitter: @jonforums

On Mon, Feb 7, 2011 at 7:35 PM, Nick K. [email protected] wrote:

I’m going to have to dig into this a bit more. I’m not able to get anything
colorized to output on JRuby, even following your walkthrough. However,
since it works for you, I’m sure there’s something goofing up my
environment, so back to the workshop I go.

Try cmd.exe instead of PowerShell.


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.