[Vit-discuss] Top Ruby Projects algorithm?

why the lucky stiff ruby-talk at whytheluckystiff.net
Fri Aug 25 16:59:03 EDT 2006


On Fri, Aug 25, 2006 at 03:32:00PM -0400, John W. Long wrote:
> Suggestions?

Some short list samples would be nice:

  >> [14, 37, 25].max
  => 37
  >> ['www', 'ruby-lang', org'] * '.'
  => 'www.ruby-lang.org'
  >> ['donkeys', 'trucks', 'spades'].include? 'monkey'
  => false

Or reading over HTTP:

  # Ruby comes with OpenURI, a library for reading
  # files over the web easily.  Watch:
  >> require 'open-uri'
  >> open("http://ruby-lang.org/en/license.txt") do |file|
  ..   puts file.read
  .. end

Or a little Builder demo:

  # Builder, a library offered for Ruby, lets
  # you describe RSS in ordinary Ruby!
  >> feed.rss :version => '2.0' do
  ..   feed.title 'The Ruby Homepage'
  ..   feed.link  'http://www.ruby-lang.org'
  ..   feed.item {}
  .. end

You know, since many people visiting the site may be interested in how to
generate RSS.  It might even be cool if each of the rotating examples had a
brief (six paragraph or so, like you'd see on a blog) tutorial getting into more
detail.

_why


More information about the vit-discuss mailing list