Brian's Waste of Time

Mon, 10 Apr 2006

Metaprogramming All Over!

So, Martin released a first showing at his wicked cool Atom binding library for ruby:

require 'atom'
require 'net/http'
require 'uri'

str = Net::HTTP::get(URI::parse('http://blog.ning.com/atom.xml'))
feed = Atom::Feed.new(str)

feed.entries.each { |entry|
  puts "'#{entry.title}' by #{entry.authors.first.name}"
}

I like this example more, though ;-)

Meanwhile, Obie apparently leaked ActiveMessagingM-Del a13g. Woot! It's good to see Stomp getting wider usage.

class HelloWorldProcessor < ActiveMessaging::Processor
 
 subscribes_to :hello_world
 publishes_to :hello_world
 
 def on_message(message)
   puts "received: " + message.body
   publish :message => "Hello world!"
 end
 
end

Cool stuff all around!

0 writebacks [/src/ruby] permanent link