From: Piergiuliano Bossi Date: 2004-12-23T01:47:01+09:00 Subject: Re: [ANN] Help 0.1: access ri from irb (using the ri library) Newbee question: where should I put help.rb? I have put it in C:\Apps\ruby18\lib\ruby\1.8 (where C:\Apps\ruby18 is ruby home) and it works, but I wonder what other people do, especially considering future upgrade. Btw, nice job! :-) Ciao, Giuliano Ilmari Heikkinen wrote: > Bit the bullet and finished this little straggler. > If you find bugs, let me know (refactorings also welcome.) > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/91614 is > similar but bound by ri's > default behaviour. Which this one overrides by doing lookups in > ancestors and > instance/class methods. Maybe ri should work like this one does (or vice > versa)? > > > -Ilmari > ======== > > Download: > http://fhtr.org/code/help.rb > > Requirements: > Ri in working order. Works in 1.8.2 at least. > > ======== > > # Ri bindings for interactive use from within Ruby. > # Does a bit of second-guessing (Instance method? Class method? Try both > # unless explicitly defined.) > # Goal is getting obj.methods.find_all{|m| not obj.help_yaml(m)} empty. > # > # require 'help' > # > # 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 > # > # > # 10 points and a duck drawing for the person who makes the Ri database > # word/regexp/fuzzy/synonym-searchable and integrates this with that. > # Maybe something like this: > # search_help("file open|close") > # => ['IO.open', 'IO.close'] > # NOTE: There is NO search_help. Yet. Write it. ]^| > # > # > # License: Ruby's > # Author: Ilmari Heikkinen > # Date: 2004-12-22 > > > -- If you want to send me an email address should be 'p', then a dot, followed by 'bossi' at 'quinary', another dot and 'com' at last