[ANN] Wirble 0.1.1: Irb Enhancements for the Masses

Hi Paul,

Hi, it should be one of the following forms:

> ri 'Object#object_id'
> ri Object.ri 'object_id'

Unfortunately, I still get the same error message with those 2 lines. Any idea?

···

--------------------------------------------------
Eric Torreborre
LTG - Product Manager
LEIRIOS
tel: 33(0)6.61.48.57.65/33(0)3.81.88.62.02
e-mail: etorreborre@yahoo.com
blog: http://etorreborre.blogspot.com
--------------------------------------------------

----- 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:

  http://pablotron.org/files/gems/wirble-0.1.2.gem
  http://pablotron.org/files/gems/wirble-0.1.2.gem.asc

(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! :slight_smile:

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

Paul Duncan wrote:

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. :wink:

Hal

Hmm... Maybe it's not just the 4am thing :wink: Maybe you have a mental
block dealing with gems and urls?

I pretty much just have a mental block. I don't think it's constrained
to gems or urls, either.

<cough>
> http://pablotron.org/files/gems/wirble-0.1.1.gem
> http://pablotron.org/files/gems/wirble-0.1.1.gem.asc
</cough>

Here we go:

    http://pablotron.org/files/gems/wirble-0.1.1.gem
    http://pablotron.org/files/gems/wirble-0.1.1.gem.asc

The only way I got those out was to copy and paste yours :D.

Thanks!

···

* William Crawford (wccrawford@gmail.com) wrote:

:wink:

--
Paul Duncan <pabs@pablotron.org> pabs in #ruby-lang (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

I got colors to work on my XP box by installing win32_console.

http://raa.ruby-lang.org/project/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

Paul Duncan wrote:

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. :wink:

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

···

On Sep 8, 2006, at 8:01 PM, Hal Fulton wrote:

Hal

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

Am I doing this wrong? ...

benjohn # sudo gem instal wirble --source http://pablotron.org/files/gems/wirble-0.1.2.gem
ERROR: While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 404
benjohn #

Thanks,
  Benjohn

···

On 8 Sep 2006, at 19:04, Paul Duncan wrote:

* Surendra Singhi (efuzzyone@netscape.net) wrote:

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.

http://raa.ruby-lang.org/project/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

Hi,

I have been using win32console (with Ruby 1.8.2 and 1.8.4) and I had some errors with the ansi.rb file:

-there's a name conflict with IO: I corrected that with
class AnsiIO < IO

-there's an error "private method sub! called" in _PrintString, and I corrected that with s = t.dup.to_s (line 88)

After doing that, I suppressed the warnings by adding a -W0 option in my irb.bat file and finally got colors with irb!

I hope this can help someone having the same troubles as me (or is there something that I missed?).

Eric.

···

--------------------------------------------------
Eric Torreborre
LTG - Product Manager
LEIRIOS
tel: 33(0)6.61.48.57.65/33(0)3.81.88.62.02
e-mail: etorreborre@yahoo.com
blog: http://etorreborre.blogspot.com
--------------------------------------------------

----- 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.

http://raa.ruby-lang.org/project/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