Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

the bizarre love triangle of rbot, subversion, and drb

Posted by Thu, 15 Sep 2005 05:27:00 GMT

In our pursuit to get stuff ready for the PDX.rb hackfest this weekend, Ben Bleything and I decided that it would be a cool idea to get rbot to monitor the groups subversion repositories.

We asked around a few IRC channels and people had different ways of handling this. The easy route looked to be to parse a RSS feed from Trac. (boring!)

So, in an effort to make it interesting and allow for a little creativity with rbot-and potentially open the doors to other ideas-we opted to build 2 pieces. One would be a post-commit script that would run after a svn commit and the other would be a new plugin in rbot, which started an instance of DRb.

The basic idea…

rbot starts drb on start

svn commit calls drb client, sends notifcation

Yes! I managed to sneak DRb somewhere else that it probably didn’t need to be. It was actually a good way to figure out how to properly tame the crazy lion that is DRb. It’s so sexy, but I am so afraid that it will scratch me if I get too close. It scratched a little tonight, but then the kind folks in #ruby-lang gave me a band-aid and I was on my way. Guess what? I tamed the lion!

The sad part is that I got the thing to properly work about 25 seconds after Ben logged off of IRC and here I am a few horus later amusing myself with test svn commits and telling the whole world. That’s right… he’s sleeping… and dreaming about how the lion is still out to attack him and you all know that the lion is nicely tucked away.

Thread.new { 
  # the lion is here 
}

We couldn’t have the lion holding the rbot in a headlock the whole time.

So, the lion is nice and it is our new friend. We now have instant notifications of when our repositories get commits in #pdx.rb.

Once we get it to format everything nice and pretty (color-wise), we’ll make it available for all of you rbot and subversion folks.

RubyURL meets rbot

Posted by Wed, 14 Sep 2005 01:48:00 GMT

1 comment Latest by sdgsdg Mon, 21 Aug 2006 08:56:03 GMT

I was asked to submit the small plugin that I created for rbot so that we can do fun stuff like this in #pdx.rb (irc.freenode.net).

21:42 < robbyonrails> ?help rubyurl
21:42 < pdxrbot> rubyurl <your long url>
21:43 < robbyonrails> ?rubyurl http://www.google.com/
21:43 < pdxrbot> Your RubyURL: http://rubyurl.com/hbGjx

It’s nothing complex and uses the plugin example as a foundation. I just popped in my ShortURL requires and modified what it replies with.

We’re almost at 2,000 unique URLs in RubyURL. :-)

You can pick up the plugin here in the trac for rbot. I don’t know if it will be accepted in the default plugins or not, but you can download the file there and start using it today!

Have fun!

CollectionClosureMethod

Posted by Tue, 13 Sep 2005 22:40:00 GMT

Last month, Martin Fowler posted an entry on his bliki that discussed the CollectionClosureMethod. He showed examples in Smalltalk, Lisp, and… Ruby!. It’s worth the read and he updates his bliki fairly regularly-so, I would suggest that you add his RSS feed to your RSS reader. :)

sortedEmployees = employees.sort {|a,b| a.lastname <=> b.lastname}

Enjoy!

Why’s (Poignant) Guide to Ruby in PDF form!

Posted by Tue, 13 Sep 2005 10:57:00 GMT

The famous, Why’s (Poignant) Guide to Ruby has been released as a nicely formatted PDF.

Thanks to Leon Spencer for providing the world with this PDF.

leon++

rbot is cool

Posted by Sun, 11 Sep 2005 21:17:00 GMT

This weekend, I found myself helping the Portland Ruby Brigade get setup with a new mailing list and while in our IRC channel (#pdx.rb on freenode), I was reminded that we never setup a bot in the channel. So, I went and tried to get Eggdrop running but didn’t like that the configuration file is a whopping 1342 lines long. Seriously… it’s long. I am a busy person right now and this was instantly a turn-off. So, i looked around for ruby based ones… found a few python ones and found rbot

yes… a ruby-based irc bot!

SVN checked it out… added the few deps and the configuration file…


--- 
irc.nick: pdxrbot
core.address_prefix:
  - "?"
irc.user: pdxruby
server.name: irc.freenode.net
auth.password: ******
irc.join_channels:
  - "#pdx.rb"       

Yes! YAML!

It ran right away…and I was sold. Nice work. (and only about 1330 lines less of configuration!)

So, it was up and running and then I looked at the plugins api. (huge grin)

I’ve added two plugins to the #pdx.rb bot already. One for rubyurl (uses shorturl) and one that shows the last 5 entry titles from the planet rubyonrails site. :-)

We’re already scheming how we’ll make it work with meeting reminders, subversion, and other random fun. I’m quite impressed so far.

Check it out here

PostgreSQL cheat sheet

Posted by Thu, 08 Sep 2005 12:44:10 GMT

Pete Freitag has posted a nice little PostgreSQL Cheat Sheet

Older posts: 1 2 3