The ri --help says:
Note that shell quoting or escaping may be required for method names
containing punctuation:ri 'Array.'
Okay, so let's try it:
jansen:~ mattleopard$ ri 'Array.'
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:1001:
warning: character class has `]' without escape
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:1001:in
`name_regexp': premature end of regular expression: /^Array(#|::)$/
(RegexpError)
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:762:in
`filter_methods'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:654:in
`display_method'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:695:in
`display_name'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:720:in
`display_names'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:717:in
`each'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:717:in
`display_names'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:1072:in
`run'
from
/Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/lib/rdoc/ri/driver.rb:317:in
`run'
from /Library/Ruby/Gems/1.8/gems/rdoc-3.5.3/bin/ri:5
from /usr/bin/ri:19:in `load'
from /usr/bin/ri:19
My guess is that ri is trying to be clever with some sort of regex
guesswork in case I get the command wrong, but is getting hoist on its
own petard. m.
···
--
matt neuburg, phd = matt@tidbits.com <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
Matt Neuburg’s Home Page