Dyepot, Teapot

Entries categorized as ‘ruby’

FOSCON III: Really Radical Ruby

July 19, 2007 · No Comments

Once again, the Portland Ruby Brigade has organized a fine evening of Ruby geekery to occur during OSCON. We’re having it next week, Tuesday July 24th, at Holocene. The event is free (but you have to be over 21 thanks to OLCC rules) and we’re serving pizza. Maybe someone will even offer to sponsor a round of drinks. There’s also still time to sign up to give a lightning talk, if you have an interesting Ruby project to show off. More details here: FOSCON III.

Categories: event · foscon · oscon · portland · ruby

Upgrading to Rspec 1.0

May 24, 2007 · 2 Comments

I just upgraded one of my Rails projects to Rspec 1.0.2, ran all my old specs to see what would happen, and … crunch. It turns out there are a few gotchas if you were using an older version (instead of starting from scratch–I think they’ll be picking up some new users with this release).

First thing to change in your specs:
context "a model or controller or whatever" do
specify “behavior” do

end
end

is now

describe "a model or controller or whatever" do
it “has behavior” do

end
end

The description for model blocks should look like:
describe Apple, "with fixtures loaded" do

end

The string after the model name is optional.

For controller blocks it’s:
describe ApplesController do

end

You can also use a string in place of the controller name, in which case you’ll need to declare the controller name explicitly.
describe "Submitting new apple description"
controller_name :apples

end

The setup block is now before(:each).
before(:each) do
[setup actions of some sort]
end

The syntax for ’should’ functions has changed.
I had several examples of:
User.should_respond_to(:authenticate)

This is now:
User.should respond_to(:authenticate)
Note the lack of an underscore after ’should’.

The exception to that is the should_not function.
This is correct:
@feed.posts.should_not be(nil)

With these changes, all of my specs are passing again. Did I miss anything that broke for you? Leave a comment.

Links to further documentation:
Writing specs for Rails
General Rspec instructions

Categories: bdd · programming · rails · rspec · ruby · testing · tips · upgrade

Where are the other women?

November 14, 2006 · 3 Comments

I don’t personally know a single female Ruby or Rails developer. The only one I’ve even heard of is Amy Hoy, and I didn’t really get a chance to talk to her at FOSCON, so it would be stretching things to say we’ve met.

I’m not talking about professional developers, even. I’m looking for anyone who has started a Rails app or played around with Ruby for a weekend or two. And I’m active with the local Ruby Brigade, I read other developers blogs, I search through lists of conference and event attendees.

Nothing. What’s going on here? Ruby is a rapidly growing field, as demonstrated by how quickly the conferences sell out, the number of new books released just in the last year, the number of businesses who know little about web development frameworks but are actively looking for Rails development because they heard it was good. This is an area where the interested developer can get in and have so many opportunities to do neat things. If there isn’t room for women here, then where?

Don’t take this to mean that I really think there are no other women in my field (even “the only female Ruby developer in Oregon” seems pretty drastic). But I don’t know where to find them. I’m sure that the number of developers in any area who are active in their local tech community is a small part of the total, and the number who become visible in a national or global arena, even online, is even smaller. Still, this suggests that women are such a small portion of the total field that by the time you filter down through these other criteria, they essentially disappear.

I think at least part of what I’m seeing is likely to occur in any part of the tech industry that hasn’t hit the corporate mainstream. This is an environment that weeds women out at all levels, to the point that the number who stick around long enough (or get involved deeply enough) to learn that there’s more out there than just Java or C++ is tiny, especially compared to those who enroll in beginning programming classes.

I’m very frustrated when I start to think about this too long, because I believe I belong here. And if I do, other women should be here too. Software is too big a part of modern life to let it be created by only one segment of the population.

[as a footnote, I stole the "where are the women" tag from Anne Zelenka, who has been using it on her blog and on del.icio.us to talk about women in blogging, the tech industry, etc.]

Categories: gender · programming · ruby · where are the women

The new job

October 28, 2006 · 3 Comments

As of Wednesday, I’ve been working for Planet Argon as a Ruby on Rails developer. They do contract work for a wide range of other companies, so I’m very happy to have the chance to hone my Rails skills on a variety of projects.

Tags: , , ,

Categories: new job! · planet argon · rails · ruby · work

The people on the bus are drunk

October 8, 2006 · 2 Comments

I finally managed to pick a weekend coding project that was actually weekend sized: I wrote a little program in Ruby to simulate bus passenger loads during rush hour. You can grab the code for it on my website. It’s just a rough draft, but it’s kind of fun to run a couple of times, changing the rates of people getting on and busses being added to the route.

I started this because I was thinking about how annoying it is that people living closer to downtown (like me) often have to watch a bus or two go by in the morning, before one with enough room finally stops. It seems like you could avoid this by either increasing the frequency of buses (though with the other traffic, anything more than the current ~7 minute spacing is likely to result in clumps of buses rather than a steady flow) or by adding an express bus every so often to pick up passengers from the more active stops. My model is still too simple to show any of this accurately, but if you add more than one person per stop per cycle, the people closest to the end of the route rarely find room on a bus.

Changes that would improve the simulation:

  • Currently each bus moves down the route every cycle, and passengers are also added to stops at the same time. It would work in a more realistic manner if I made the cycles more like minutes, and used that to provide more flexibility to move each bus and add waiting passengers at different rates.
  • The output is just four lines of text, representing the stops, people waiting, bus locations, and bus passengers. I could create a better graphical output for this.
  • The only way to change any settings for the simulation is to alter the code. It would be pretty simple to ask the user for input before starting each time, or to read in parameters from a file.
  • No one is getting off the bus. The rate of people leaving the bus in the last few miles to downtown is small, in my experience, but there are at least a few people getting off earlier most mornings, and I should include that.

Tags: , , , , , ,

Categories: bus · code · model · programming · ruby · simulation · transit