The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
FastRI 0.2.0: full-text searching, smarter search strategies

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eigen Class

Posts: 358
Nickname: eigenclass
Registered: Oct, 2005

Eigenclass is a hardcore Ruby blog.
FastRI 0.2.0: full-text searching, smarter search strategies Posted: Nov 16, 2006 10:28 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eigen Class.
Original Post: FastRI 0.2.0: full-text searching, smarter search strategies
Feed Title: Eigenclass
Feed URL: http://feeds.feedburner.com/eigenclass
Feed Description: Ruby stuff --- trying to stay away from triviality.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eigen Class
Latest Posts From Eigenclass

Advertisement

FastRI is an alternative to the ri command-line tool (used for browsing Ruby's stdlib and third-party API docs). It is much faster, and also allows you to offer RI lookup services over DRb. FastRI is smarter than ri, and can find classes anywhere in the hierarchy without specifying the "full path". FastRI can perform full-text searching. Its RubyGems support is better than ri's, and it knows which gem a method/class definition came from.

0.2.0 introduces full-text searching and method lookup in superclasses for core classes and modules. In case you're interested, I've described how FastRI's (custom) full-text search engine works here (the core takes a couple hundred lines of pure Ruby).

Getting it

FastRI can be downloaded here. You can also install it with RubyGems:

 gem install fastri

Examples

Intelligent searches

 $ fri File.inject
 ------------------------------------------------------ Enumerable#inject
      enum.inject(initial) {| memo, obj | block }  => obj
      enum.inject          {| memo, obj | block }  => obj
 ------------------------------------------------------------------------
      Combines the elements of enum by applying the block to an 
      accumulator value (memo) and each element in turn.
 ...

Full-text search

 $ fri -S HTTP request
 42 hits
 ========================================================================
 Found in system  Net::HTTP
   
 ... HTTP Request Classes
 ...       Net::HTTP::Delete
 ... jects belong to its own response class which indicate HTTP result
 status. For details of response classes, see section 'HTTP Response
 Classes'.
 [...]
 $ fri -S open file mode
 8 hits
 ========================================================================
 Found in system  IO
  
 ... , it should be one of the operating system specific constants
 (O_RDONLY, O_WRONLY, O_RDWR, O_APPEND and so on). See man open(2)
 for more information.
 ... perating system conventions if possible. For instance, on a Windows
 system the filename ``/gumby/ruby/test.rb'' will be opened as
 ``\gumby\ruby\test.rb''. When specifying a Windows-style filename in
 a Ruby string, remember to escape the back
 ... I/O ports may be opened in any one of several different modes, which
 are shown in this section as mode. The mode may either be a Fixnum
 or
 ... ning of file.
 ...   'r'  |  Read-only, starts at beginning of file  (default mode).
 ... mand line (or STDIN if no files are mentioned). ARGF provides the
 methods #path and #filename to access the name of the file currently
 being read.
 ...   'a+' |  Read-write, starts at end of file if file exists,
 ...   'a'  |  Write-only, starts at end of file if file exists,
 ...   'w+' |  Read-write, truncates existing file to zero length
 ...   'w'  |  Write-only, truncates existing file
 ...    'b' |  (DOS/Windows only) Binary file mode (may appear with
 ...   'r+' |  Read-write, starts at beginning of file.
 ... ill convert pathnames between different operating system conventions
 if possible. For instance, on a Windows system the filename
 ``/gumby/ruby/test.rb'' will be opened as ``\gumby\ruby\test.rb''.
 When specifying a Windows-style filename in a
 [...] 

Summary of changes since version 0.1.1 (2006-11-10)


Read more...

Read: FastRI 0.2.0: full-text searching, smarter search strategies

Topic: Announcing QCon, March 12-16th in London Previous Topic   Next Topic Topic: Designing a DSL

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use