[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] IHelp 0.3.0

Ilmari Heikkinen

2/25/2005 9:32:00 PM

Announcing the release of IHelp 0.3.0.

http://fhtr.org/proje...
http://fhtr.org/proje...doc/
http://fhtr.org/proje...releases/ihelp-0.3.0.tar.gz

This release brings with it custom help renderers, which you can
leverage to render help whenever you want, wherever you want and however
you want.

Also included are a couple experimental renderers (no guarantees):

- #rubydoc_org opens the corresponding ruby-doc.org class help file
using the program defined in IHelp::WWW_BROWSER

- #rubytoruby_src uses Ryan Davis' RubyToRuby class to print out the
source for the method.
http://blog.zenspider.com/archives/2005/02/rubyt... for more info
about RubyToRuby.

These can be used by setting the renderer-attribute to the name of the
renderer method, e.g. IHelp.renderer = :rubydoc_org. The default
renderer is :ri.

--
Ilmari Heikkinen


====

Ri bindings for interactive use from within Ruby.
Does a bit of second-guessing (Instance method? Class method?
Try both unless explicitly defined. Not found in this class? Try the
ancestor classes.)

Goal is that help is given for all methods that have help.

Examples:

require 'ihelp'

a = "string"
a.help
a.help :reverse
a.help :map
String.help
String.help :new
String.help :reverse
String.help :map
String.instance_help :reverse
String.instance_help :new # => No help found.
a.help :new
help "String#reverse"
help "String.reverse"
a.method(:reverse).help # gets help for Method
help "Hash#map"

Custom help renderers:

The help-method calls IHelp::Renderer's method defined by
IHelp.renderer with the RI info object. You can print help
out the way you want by defining your own renderer method
in IHelp::Renderer and setting IHelp.renderer to the name
of the method.

Example:

require 'ihelp'

class IHelp::Renderer
def print_name(info)
puts info.full_name
end
end

IHelp.renderer = :print_name

[1,2,3].help:reject
# Array#reject
# => nil

License: Ruby's
Author: Ilmari Heikkinen <kig misfiring net>




5 Answers

Randy Kramer

2/26/2005 2:54:00 PM

0

On Friday 25 February 2005 04:31 pm, Ilmari Heikkinen wrote:
> This release brings with it custom help renderers, which you can
> leverage to render help whenever you want, wherever you want and however
> you want.
>
> Also included are a couple experimental renderers (no guarantees):

Does help use HTML? (In other words, do any of the help renderers render
HTML?)

Randy Kramer


Ilmari Heikkinen

2/26/2005 5:33:00 PM

0

la, 2005-02-26 kello 16:54, Randy Kramer kirjoitti:

> Does help use HTML? (In other words, do any of the help renderers render
> HTML?)
>
> Randy Kramer
>

Nope, but it's doable. If anyone knows a good way to turn
RI::MethodDescription & RI::ClassDescription into HTML, speak up :)



Ilmari Heikkinen

2/27/2005 12:40:00 AM

0

la, 2005-02-26 kello 19:32, Ilmari Heikkinen kirjoitti:
> la, 2005-02-26 kello 16:54, Randy Kramer kirjoitti:
>
> > Does help use HTML? (In other words, do any of the help renderers render
> > HTML?)
> >
> > Randy Kramer
> >
>
> Nope, but it's doable. If anyone knows a good way to turn
> RI::MethodDescription & RI::ClassDescription into HTML, speak up :)
>

Made the html renderer, added a help_html -method too. And fixed some
bugs.

Releasing 0.3.1 now.




Randy Kramer

2/27/2005 2:17:00 AM

0

On Saturday 26 February 2005 07:39 pm, Ilmari Heikkinen wrote:
> Made the html renderer, added a help_html -method too. And fixed some
> bugs.

Ilmari,

Wow, thanks! Downloading now, will take a look.

regards,
Randy Kramer

> Releasing 0.3.1 now.


Randy Kramer

2/27/2005 2:39:00 AM

0

On Saturday 26 February 2005 09:16 pm, Randy Kramer wrote:
> Wow, thanks! Downloading now, will take a look.

Ilmari,

Ahh, I see--you let a (specified) web browser render the HTML. Clever!

Randy Kramer