RubyConfX: Awesomesauce!? Hells Yes!

November 18th, 2010

RubyConf X in NOLA last week was epic.

Epic.

Seriously though, I had a rocking time. I gave part of a talk, I talked to an amazing amount of awesomely smart people and just generally enjoyed my ass off.

It was the first RubyConf I’d been to, and I think the biggest conference I’ve gone to yet as a developer(ALA doesn’t count). I liked being in New Orleans again, surrounded by Jazz and a culture that contains people who think it is perfectly reasonable to drive around playing a trombone out of a car window. It’d be awesome if RubyConf was there next year.

My talk went pretty well I think, though I wish I’d taken more time to practice. It didn’t help that I hadn’t met my co-speaker, Bob Aman before the conference. But, it worked out pretty well, I think (speakerrate may or may not say otherwise). And we got some good feedback on twitter.

New Orleans, as I well know, is a great place to experience. I mean, look at this Po’Boy:

A Large Dressed Roast Beef Po'Boy

Running in the  RubyConf Xk(I ran the 5k) was fun. I totally expected to be unable to jog the whole way, but I did. And, I upped my pace on the second lap coming in at a respectable 29:41. Not bad for someone who has not gotten enough exercise in recent months. Oh, and @tenderlove ran too, in spandex no less:

Heroic Race Finishers

I definitely need to up my silliness for the next Ruby conference I go to. I feel out classed.

All in all, I had a freaking blast.

RubyConf X and Associated Activities

November 10th, 2010

Tomorrow RubyConf begins. And, I will be there. I’m speaking, though not listed in the schedule yet(I’m filling in for John Woodell again). I’ll be talking about Dubious, a web framework written in Mirah, along with Bob Aman, who will be talking about AppEngine and Google’s new discoverable APIs.

I’ll also be doing some ruby processing + DRb stuff like we had at mountain.rb. See video:

I think this is the biggest conf I’ve been to so far, and I’m really looking forward to it.

It should be awesome and a lot of fun.

Mountain.rb

October 20th, 2010

Mountain.rb At The Boulder Theater

My first local conference, right here in Boulder. I had a lot of fun. Thanks Marty for a great conf.

R2 Droid 2 Unboxing

October 19th, 2010

I got a new phone a couple weeks ago. w00t. Behold the unboxing photos!

The Box

Opening the box

Look At All The Wonderful Accessories

Behold the R2D2esque Back

It Even Comes With a Dock

Why Not YAML?

October 17th, 2010

I enjoyed Joe O’Brien’s recent post Why Yml?. He asked why we use external config files when we have an dynamic language like Ruby. Yeah, Ruby is more expressive and it would be simpler to use only one language, but to me it makes sense to use YAML for config data. And I think YAML is used a lot because it can represent config data more clearly.

So, why would you store data outside of code when Ruby is so
freaking expressive?

  1. Interoperability — When you have applications in different languages that use the same configuration, then having a separate file makes a lot of sense. For example, when writing a JRuby on Rails app that  has bits of Java code (i.e. servlets w/ JDBC) that share the DB, you want to centralize your DB config to avoid having to do something nasty like generating properties files from database.yml.
  2. Security — Keeping config details, like DB login information out of the source is a good idea. It’s more secure because you often have a lot of sensitive information in your config files. The less places that information appears, the better. They should, ideally, not be checked into source control. For some reason, I feel more uncomfortable with the idea of not checking in source files than I do yaml files.
  3. Convention — Rail’s database.yml has a very stable structure. Keeping it as a YAML file encourages developers to not muck about with it. Why do this? There are times when having less expressivity is better because it’s harder to shoot yourself in the foot that way. It makes adding unnecessary behaviors more awkward. For database connections, this makes a lot of sense because they should not usually have a lot of logic around configuring them.

I generally agree with Joe on the ugly use of ERB in yml files, at least for things like data store configuration. When I see that or find myself doing it, I have a little a sense of “you’re doing it wrong!” Code smell, indeed.

I also think that the YAML vs XML vs JSON discussion is important here, because YAML as a language has some interesting properties that make it well suited to config type situations. In particular, I’m thinking of the ability to name chunks of the document and substitute them in other parts of the document in an override-able manner.

For example, in YAML, a set of configurations where one inherits from another might look like

development: &default
  adapter: foo_store
  port: 1337
  database: base_development
production:
  <<: *default
  database: base_production

The equivalent in Ruby could be represented something like

#using 1.9 syntax, so it looks more yamlish
config_hash = {
  development: {
    adapter: 'foo_store',
    port: 1337,
    database: 'base_development'}
}
config_hash['production'] = config_hash['development'].merge(
                                                database: 'base_production'
)

Which I don’t think is quite as easy to scan.

I guess my point is that while Ruby is very expressive and powerful, sometimes a more constrained language can better express config information in a declarative manner.

Right Scale API gem

October 10th, 2010

I was frustrated with the client libraries available for the RightScale API, so I wrote my own. It’s reasonably complete, but doesn’t currently have tests.

Mostly it arose out of a need to automate things and my desire to make something pretty clean.

I didn’t like the API’s of the existing libraries much, so I wrote my own.

It is fairly bare bones at this point, but I have been using it for a few months and it works for me.

Check it out:

github.com/baroquebobcat/right-scale-api

Further reading/References(Others’ Right Scale API gems & libraries):

github.com/robertcarr/RightAPI — not a gem yet

github.com/moneypools/right_api — little in the way of docs, feels pretty raw

github.com/joshuabates/rightscaler — pretty neat, activeresource based, have not tested though

github.com/dmichael/rightscale-api — uses httparty, missing most of the objects available

github.com/ktheory/rightscale_api_wrapper — not gemified, not great

github.com/stewartmckee/Rightscale-API-Gem — fuller implementation, but since it doesn’t use httparty, restclient, or activeresource, the source is really verbose

Mountain.rb

October 7th, 2010

Today and tomorrow I’m going to be hanging out at the mountain.rb conference.

First up today is Jim Weirich doing a talk called To Infinity and Beyond. It should be fairly epic.

In other news I got a smart phone finally. It’s R2D2.

A New Gem For People Who Can’t Use HTTP Methods Other Than POST

September 28th, 2010

Itch:

I needed to be able to look at query params in the URL for the _method parameter Rails uses to fake different types of POST-like requests. Rails currently doesn’t do this for you as it uses Rack::MethodOverride, and that doesn’t look at GET parameters. It only looks at the X-Http-Method-Override header and POST form params. Some Rails users filed a ticket awhile ago about it, and it is an ongoing concern(see #2289).

Scratch:

Being a go getter, active, knows his way around a gemspec sort of person, I whipped up a library so if you run into this problem, you can fix it easily. Rack::MethodOverrideWithParams is the result. It is a drop-in replacement for Rack::MethodOverride, so all you have to do is replace Rack::MethodOverride in your stack with it and you’ll be rocking query param method overriding goodness.

“How easily”, you might ask. Let me show you. It’s just a couple of code additions:
Gemfile
gem "rack-methodoverride-with-params", "~> 1"
config/environment.rb
config.middleware.swap Rack::MethodOverride, Rack::MethodOverrideWithParams

Done.

What do you think?

Links

github.com/baroquebobcat/rack-methodoverride-with-params

rubygems.org/gems/rack-methodoverride-with-params

Rails ticket #2289

Wildfire near Boulder

September 8th, 2010

I’m okay, but it’s pretty big.

Here is the map:


View #boulderfire in a larger map

Speaking at Ruby|Web Conference on Friday

September 8th, 2010

On Friday morning I am speaking at the Ruby|Web Conference at Snowbird in Utah. I’ll be giving a talk entitled “Extreme Performance with Mirah and Dubious“. I’ll be talking about a project I’ve been helping out with called Dubious, which is a web framework written in Mirah.

Check out the source:

http://www.mirah.org/

http://github.com/mirah/dubious