February 26, 2008 at 8:37 pm
· Filed under Ruby
What else?
(Note: Charles Oliver Nutter is helping when he tells us that Thread#raise, Thread#kill, and timeout.rb are broken.)
Permalink
February 21, 2008 at 9:36 am
· Filed under Pyre, Ruby
I’ve released version 0.3.0 of Pyre, an alternative ruby library for interacting with Campfire from 37signals. Pyre now supports uploading files to a room! Observe:
require 'rubygems'
require 'pyre'
Pyre::Campfire.new('pyre') do |campfire|
campfire.login('bot@seriouslyreal.com', '12345')
campfire.room('Hot Chat') do |room|
room.upload('/path/to/animated.gif')
room.speak('What a cat!')
end
end
Also, now there’s a contrib directory which will hold examples of things to do with Pyre. Currently, the only thing in there is a Subversion repository post-commit hook for putting really nice messages about commits into a Campfire room. It’s really nice. Out of the box they look like this:
cms commited revision 104
*************************
Fixed all spelling mistaeks in the README
*************************
U pyre/trunk/README
I’m hoping to expand that contrib dir. I’m hoping people will help too.
Anyway, get it and use it.
sudo gem install pyre
Permalink
February 17, 2008 at 7:21 pm
· Filed under Pyre, Ruby
I’ve recently had reason to use 37signals’ Campfire, and thus a need for a Campfire bot. Tinder does a fine job, but I was running into issues (minor annoyances), so of course I decided to write my own library for interacting with Campfire.
And Pyre was born.
As of right now, you can log in, log out, join and leave rooms, speak and paste to rooms, and that’s it. But for something like a svn post-commit hook, that’s all you need. Pyre uses Mechanize (as opposed to Tinder’s ActiveSupport, Hpricot, and regular expressions combo) to deal with Campfire, so it was pretty easy to throw together.
Sample code? Here’s what the end of an svn post-commit hook might look like (after the message has been built):
Pyre::Campfire.new('subdomain', :ssl => true) do |campfire|
campfire.login('bot@email', 'botpassword')
campfire.room('Development') do |room|
room.paste(message)
end
end
Pretty straightforward.
For the most part I tried to stay close to Tinder’s interface so that porting to Pyre would be easy, but this block style is new (and, I think, nice).
I’ll be implementing listening in a room soon enough I wager.
So go ahead and get it!
sudo gem install pyre
Permalink
February 11, 2008 at 10:02 pm
· Filed under Ruby
I finally ponied up the meager $100 for my spot at MountainWest RubyConf. Last year was good, and it looks like this year will be better. Pat Eyler says, “One of the sponsors has let me know that they’re planning something really special for attendees.” I’m looking forward to receiving this “special” mousepad. (It’s going to be a mousepad, right?)
If you need to harass me in person about how GuessMethod and CSSes aren’t suited for production, I’ll be wearing two hooded sweatshirts and a Baltimore Orioles cap. See you there.
Permalink