RailsConf2007 - A time of questions

Posted by Rob Kaufman
on May 21, 07

Last years RailsConf was a time of answers. Answers like: Do REST, use Mongrel, Solr can be huge, yes we're really doing this and making money at it, yes this will scale up. Even _why's performance was a sort of affirmative statement about Rails itself. Dave Thomas's infamous keynote was full of questions, but those all got answers with in the first few days after we all went home. This year was different...

As I take a moment to reflect on the whirlwind of information that a conference like this always brings, I find we are left with a lot of questions. How will the core team handle the multitude of open bugs? How will we bring reasonable gender balance to our community? How will we handle the fractioning that we can all feel starting? How do we leverage the power of just in time compliers? How do we rewrite core Ruby so that more of it is in Ruby? How did some decorator get away with putting pictures of waterfalls over each of the men's urinals in the Oregon Convention Center? How are most of us going to be able to afford coming next year, and if it grows 3x bigger, will we want to? For every one of these questions (except the urinals) it will take some time for answers to unfold. I heard DHH talking about a voting system for patches. Not just "Yeah I like that" but "Yes, I applied it and it worked great". But that will take time to come to shape, and I am not really sure I feel about becoming more of a democracy and less of a benevolent dictatorship. We also need to address the communities growth with new strategies. I think that the regional conferences will help this a lot, and so will the new IRC channel. I felt that DHH's keynote was more humble and inviting to newer members this year, and was delighted to see him open to what the JRuby guys, among others, had to say.

A lot of really great talks happened. My vote for the most engaging was hands down Ze Frank. He managed to be poinent while being hilarious. I thought Avi's keynote on Smalltalk and the Doing Rest Right talk by Scott Raymond tied as being the most thought provoking. I also really enjoyed Josh Susser on getting patches accepted in Rails core. The most common complaint I heard people saying about the various talks was that they felt that we needed some indecator as to the skill level for each talk. Some felt overwhelmed by talks that they thought would be entry level, but where in depth and some felt bored by hearing the basics in what they thought was a deep dive. This seems like a pretty easy thing to fix.

Testing responds_to

Posted by Rob Kaufman
on May 20, 07

I was having an issue after adding some RJS on one of my apps. After looking at this page I was surprised that respond_to order is very much order dependent, which only really matters in your test cases. Then I found a post on Singlecell that 'solves' this testing problem. It wasn't quite a 'whole' solution, but it did handle POST and GET. I've expanded it to the following:

#Much like the #get and #post methods we're all so fond of, but with an additional 'type'
# argument which may be any type supported by
#response_type_to_mime_type (currently :js, :html or :xml)

["get", "post", "put", "delete"].each do |kind|
  code = <<CODE
    def #{kind}_with(type, action,  params={}, headers={})
      accept type
      #{kind} action, params, headers
      # Reset the request to accept HTML after
      accept :html
    end
  CODE
  eval code
end

# Helps out with response testing, by letting to assert that the most recently-made request responded with one of
# :html, :js or :xml
def assert_responded_with(s)
  assert_match @response.headers['Content-Type'], "#{response_type_to_mime_type(s)}; charset=utf-8", 
               "Response did not match expected. Expected #{s} but was #{@response.headers['Content-Type']}"
end

# Switches the request object's Accept header to a new type, one of :html, :js or :xml
def accept(type)
  @request.accept = response_type_to_mime_type(type)
end

def response_type_to_mime_type(s)
  case s
    when :html
      'text/html'
  when :js
   'text/javascript'
  when :xml
    'application/xml'
  else
    raise ArgumentError("Unsupported content type in response_to_mime_type: don't know how to turn :#{s.to_s} into MIME type")
  end
end

now you can do

post_with
get__with
put_with
delete__with

and couple that with

assert_responded_with

Big Stinking Piles (of Data)

Posted by Rob Kaufman
on May 20, 07

First off I felt my talk at RailConf2007 went great. Thank you to everyone who attended and to the RailsConf organizers. Even after loosing my voice on Saturday morning, I was able to squeak my way though the talk. I haven't really spoken a word since, but that will pass. For those that suggested tea and honey, it worked well enough to get me the 50 minutes I needed. I would love to see some constructive feedback in to comments. You can download my presentation in ODP and in PDF. The slides are licensed under a Creative Commons Attribution 3.0 United States License.

Creative Commons License

I really feel that this was a really good experience for me and I hope to do more presenting in the future.

I'm SPEAKING at RailsConf

Posted by Rob Kaufman
on May 11, 07
I recieved an email confirming my speaking time at RailsConf. I was a little confused, because my segment had been declined (very politely btw). When they added the 4th track a month ago, I snagged a ticket, so I have a flight and was planning to go. Aperently I am back on now, which is awsome. Guess I need to work on my presentation now.... *gulp*

Going to Rails Conf

Posted by Rob Kaufman
on May 03, 07

I have more to say but right now, I'll just say "YEA!!!!". Oh and I've been looking through the schedule and making my plan