From: Andrew Johnson Date: 2005-01-28T05:20:54+09:00 Subject: Re: ruby resources On Fri, 28 Jan 2005 04:18:49 +0900, Jeff Davis wrote: [snip] > rdoc is not interactive like perl or python, and requires a path to the > actual ruby file and not just an arbitrary class name (can you rdoc a > built-in class?). It does great html output, however. Docs on the built-ins can be brought up with ri (part of the included rdoc stuff) -- though you'll have to make sure you build/install the docs (make install-doc), or download them from ruby-doc. ri works like this from the command-line $ ri Enumerable ------------------------------------------------------ Class: Enumerable The +Enumerable+ mixin provides collection classes with several traversal and searching methods, and with the ability to sort. The class must provide a method +each+, which yields successive members of the collection. If +Enumerable#max+, +#min+, or +#sort+ is used, the objects in the collection must also implement a meaningful +<=>+ operator, as these methods rely on an ordering between members of the collection. ------------------------------------------------------------------------ Instance methods: ----------------- all?, any?, collect, detect, each_with_index, entries, find, find_all, grep, include?, inject, map, max, member?, min, partition, reject, select, sort, sort_by, to_a, to_set, zip Want to know what the #partition method does? $ ri Enumerable.partition --------------------------------------------------- Enumerable#partition enum.partition {| obj | block } => [ true_array, false_array ] ------------------------------------------------------------------------ Returns two arrays, the first containing the elements of _enum_ for which the block evaluates to true, the second containing the rest. (1..6).partition {|i| (i&1).zero?} #=> [[2, 4, 6], [1, 3, 5]] > It's also hard to find modules or classes that aren't built in. I think > I found the 'postgres' module in the RAA, but it isn't exactly an > application, it's more of a library. > > I have some idea about what "gems" are but it's confusing how they fit > into the big picture. RAA is the main registry for Ruby projects/modules/libs -- it is searchable, and categorized. RAA doesn't actually host projects though, but rubyforge does (most things there are registered on RAA). Gems and RPA are two packaging schemes that try to make it easier to automate package retrieval and installation (along with other goals). RPA operates more like Perl's CPAN.pm install shell, it has 150+ packages at the moment. http://raa.ruby-lang.org/ http://rubygems.rubyforge.org/wiki/wiki.pl?RubyGems http://rpa-base.rubyforge.org/wiki/wiki.cgi?RpaBase > I really like the language and community, but perhaps the community > resources put off some of the less determined people from getting into it. There have been some hints that ruby-lang may get a face-lift to help address this issue. regards, andrew -- Andrew L. Johnson http://www.siaris.net/ Where the hell are my fries, kid? -- Tom Christiansen, on comp.lang.perl.misc