----- Message d'origine ----
De : Paul Duncan <pabs@pablotron.org>
À : ruby-talk ML <ruby-talk@ruby-lang.org>
Envoyé le : Vendredi, 8 Septembre 2006, 8h00mn 51s
Objet : Re: Re : [ANN] Wirble 0.1.1: Irb Enhancements for the Masses
* Eric Torreborre (etorreborre@yahoo.com) wrote:
Hi Paul,
I take it that the windows masses are not concerned,...
Any problems on Windows are a direct result of sloth and incompetence on
my part, rather than intentional malice. I haven't done much console
development on Windows, and I don't have easy access to a Windows
machine for testing.
I have tried wirble on my windows laptop:
-the gem install doesn't work
The URL in the original email was wrong and the gem had an accidental
dependency on Rubilicious. I've fixed the latter and regenerated the
former. Here's the URL:
(Note: This version doesn't address the two issues you have below)
-the Object.ri sample brings an exec error
>> Object.ri 'object_h'
Errno::ENOEXEC: Exec format error - ri 'object_h'
from c:/ruby/lib/ruby/site_ruby/1.8/wirble.rb:465:in ``'
from c:/ruby/lib/ruby/site_ruby/1.8/wirble.rb:465:in `ri'
from (irb):1
Hi, it should be one of the following forms:
ri 'Object#object_id'
ri Object.ri 'object_id'
It should definitely have a more graceful error message. I'll add that
to my list of stuff to fix.
-the coloring alters the output line
>> p "hee"
"hee"
=> ???[0;32mnil???[0;0m
-The persistent history works! Yes!
One out of three ain't bad!
I am not used to the internals of the windows console. Do you think it
is possible to have wirble working on both Unix and Windows
plateforms?
I'm not familiar with the Windows console either. I'll follow up on
some of the other URLs in this thread and see what I can find out.
--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC) http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562
I looked into highlighting the input in Irb, too. It's a lot more work,
but it might be doable. At a minimum, I'd need to write, borrow, or
steal a full-blown Ruby lexer. I'd probably need a more terminal-
friendly replacement for readlines (probably curses).
You can use the lexer built into irb. I forget how it's
done, but I did it two years ago.
I looked into highlighting the input in Irb, too. It's a lot more work,
but it might be doable. At a minimum, I'd need to write, borrow, or
steal a full-blown Ruby lexer. I'd probably need a more terminal-
friendly replacement for readlines (probably curses).
You can use the lexer built into irb. I forget how it's
done, but I did it two years ago.
You certainly can steal irb's lexer. Here's an example from some code I've been kicking around for a while, so you can see how it works:
(This code understands a very minimal set of ruby and turns it into a sort of Sexpr)
require 'irb/ruby-lex'
module RubyMerge
class ParseSkeleton
def initialize(io) @io = io
end
def skeleton
lexer = RubyLex.new
stack =
results =
lexer.set_input( @io )
while current = lexer.token
case current
when RubyLex::TkDEF, RubyLex::TkMODULE
if stack.empty?
results << current.name.to_sym
ident = nil
1 while ( ident = lexer.token ).kind_of? RubyLex::TkSPACE
results << ident.name
else
if results.last.kind_of? Array
results.last << current.name.to_sym
ident = nil
1 while ( ident = lexer.token ).kind_of? RubyLex::TkSPACE
results.last << ident.name
else
results <<
results.last << current.name.to_sym
ident = nil
1 while ( ident = lexer.token ).kind_of? RubyLex::TkSPACE
results.last << ident.name
end
end
stack.push current
when RubyLex::TkEND
stack.pop
end
end
results
end
end
end
after that I just added:
require 'win32/console/ansi'
Paul Duncan wrote:
> * Surendra Singhi (efuzzyone@netscape.net) wrote:
> > Hi Paul,
> > When I tried it on Windows XP, I get this wierd error:
> > I don't have rubilicious
>
> I've fixed this bug and packaged up an 0.1.2.
>
> Here's the URL(s):
>
> http://pablotron.org/files/wirble-0.1.2.tar.gz
> http://pablotron.org/files/wirble-0.1.2.tar.gz.asc
> http://pablotron.org/files/gems/wirble-0.1.2.gem
> http://pablotron.org/files/gems/wirble-0.1.2.gem.asc
>
> All I did was remove the accidental rubilicious depencency and
> regenerate the gem.
>
> By the way, some other people have had problems with the color codes
> under Windows, so I make no promises about how well that will work for
> you :).
>
> --
> Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
> http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562
>
> --/LSm8UPTCLHL4o89
> Content-Type: application/pgp-signature
> Content-Disposition: inline;
> filename="signature.asc"
> Content-Description: Digital signature
> X-Google-AttachSize: 190
--
"Nothing will ever be attempted, if all
possible objections must first be
overcome." - Samuel Johnson
"Luck is what happens when
preparation meets opportunity." - Seneca
----- Message d'origine ----
De : Tom Jordan <tdjordan@gmail.com>
À : ruby-talk ML <ruby-talk@ruby-lang.org>
Envoyé le : Samedi, 9 Septembre 2006, 2h46mn 50s
Objet : Re: Re : [ANN] Wirble 0.1.1: Irb Enhancements for the Masses
or even better
gem in -y win32console
On 9/8/06, Gordon Thiesfeld <gthiesfeld@gmail.com> wrote:
I got colors to work on my XP box by installing win32_console.
after that I just added:
require 'win32/console/ansi'
Paul Duncan wrote:
> * Surendra Singhi (efuzzyone@netscape.net) wrote:
> > Hi Paul,
> > When I tried it on Windows XP, I get this wierd error:
> > I don't have rubilicious
>
> I've fixed this bug and packaged up an 0.1.2.
>
> Here's the URL(s):
>
> http://pablotron.org/files/wirble-0.1.2.tar.gz
> http://pablotron.org/files/wirble-0.1.2.tar.gz.asc
> http://pablotron.org/files/gems/wirble-0.1.2.gem
> http://pablotron.org/files/gems/wirble-0.1.2.gem.asc
>
> All I did was remove the accidental rubilicious depencency and
> regenerate the gem.
>
> By the way, some other people have had problems with the color codes
> under Windows, so I make no promises about how well that will work for
> you :).
>
> --
> Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
> http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562
>
> --/LSm8UPTCLHL4o89
> Content-Type: application/pgp-signature
> Content-Disposition: inline;
> filename="signature.asc"
> Content-Description: Digital signature
> X-Google-AttachSize: 190
--
"Nothing will ever be attempted, if all
possible objections must first be
overcome." - Samuel Johnson
"Luck is what happens when
preparation meets opportunity." - Seneca