Archive for January, 2007
Recap: Boston Web Innovators Group
We had a fantastic night last night at the Boston Web Innovators Group. Yesterday we briefly debated whether it made sense to lug two laptops and two large displays to the event. We brought it all and it turned out to be the right decision. Aron and I each gave and evening-long, non-stop demo to a constant crowd of visitors. I don’t think I’ve ever spoken so much, so continuously (and that’s saying something.) I hope my throat stops hurting by noon.
The photos are of Aron during setup. We didn’t get a chance to take any during the event.
A big thank you to David Beisel and the folks at the Web Innovators Group: thanks for having us. Another thank you to all of the people who kept Aron and me busy all night sharing their energy, enthusiasm, and ideas.
The next WebInno is slated for March 28, 2007, location TBA. See you there.
Update
Ben Saren of Citysquares and Your Suspect sums up his experience from the previous WebInno here. It is surprisingly similar to ours (except I didn’t get a beer and a burger after!) Greg Peverill-Conti at Over the River also covers the event here. C.C. Chapman also gives us a mention. Barbara Heffner chimes in as well.
2 commentsSome questions about a lamp post
The photo over there is of a non-functioning lamp post in Olmsted Park, not too far from where I live, in Brookline, MA. Its just sitting there, a little ruin in the woods by the walking path and the Muddy River. That is pretty much all I know, but I wonder.
When was it put here? Was it part of Olmsted’s original design? When did it stop functioning? It looks like its electric, but was it ever powered by gas? It has a wood post, but another such lamp in the park has a metal one–is the wooden post a replacement? What did the glass diffuser at the top look like? Was there more metal decoration on top of that? Though all of the old broken lamps in the park look similar, they are all of a differing design. Why? Were they installed at different times? These are just the questions I can think of now.
These are the sort of questions I ask when I come upon artifacts like this–and they’re everywhere in a city like Boston. I’m sure there are many people out there with a real passion for Olmsted, parks, the Emerald Necklace, Brookline and Boston history, or lamps who would joyfully tell me more than I ever wanted to know. At the very least, I’m sure a few answers would be forthcoming.
I’d like a way to reach these folks so they can answer the questions of people like me and give them a way that they can share their knowledge and passion. I don’t mean to limit it to “lamp people”: I have non-lamp related interests as well! Plus, I am generally interested in discovering new and unexpected things either where I live or travel.
No commentsIsolated fixtures: separate fixtures for each of your tests
I’d like to describe and provide code for what I’m calling “isolated fixtures”. Isolated fixtures allow you to have an independent and separate set of fixtures for Test::Unit::TestCase in your Ruby on Rails project.
I’d already run into the situation a couple of times where adding info for my new test into existing fixtures broke existing tests, either due to assumptions of about the fixture data, or because multiple tests “borrowed” fixtures from previous test.. According to some other pieces I’ve read on the net, the situation would only get worse as our test suite grew (and ours does grow). So, instead of becoming adept at the sort of limbo-dancing required to finesse new tests into the testsuite, I decided to come up with a way to let each set of tests have their own fixtures.
Now, I don’t know if this is considered a hack, or another demonstration of the flexibility and power that is Ruby on Rails. I’m sure you’ll all let me know.
This works for me with Rails 1.1.6. I have no idea if it will work in 2.0. (2.0 might even have this built in for all I know!)
Usage
Let’s assume you have a test class called AccountControllerTest. In this test where you normally use fixture instead user isolated_fixture instead:
isolated_fixture :customers, :accounts
Instead of putting the fixture data into test/fixtures it will create a subdirectory there based on the name of the test class. In this case the path of the directory and the fixture data will be:
test/fixtures/account_controller/accounts.yml test/fixtures/account_controller/customers.yml
Code
Here is the code. Put it in your test/test_helper.rb, or do what I did and put it in test/test_helper/fixtures.rb and require it into test_helper.rb.
class Test::Unit::TestCase
## Each subclass needs its own copy 'fixture_path' so replace
## the existing single class variable.
remove_class_variable :@@fixture_path
class << self
remove_method :fixture_path
remove_method :fixture_path=
end
class_inheritable_accessor :fixture_path
self.fixture_path = RAILS_ROOT + "/test/fixtures/"
## Add specialized fixture class methods and alias them.
def self.standard_fixtures(*table_names)
self.fixture_path = RAILS_ROOT + "/test/fixtures/"
self.fixtures_without_fixture_path(table_names)
end
def self.isolated_fixtures(*table_names)
fixture_subdir = self.to_s.ends_with?("Test") ? self.to_s[0..-5].underscore : self.to_s.underscore
self.fixture_path = RAILS_ROOT + "/test/fixtures/#{fixture_subdir}/"
self.fixtures_without_fixture_path(table_names)
end
class << self
alias_method :fixtures_without_fixture_path, :fixtures
alias_method :fixtures, :standard_fixtures
alias_method :original_method_added, :method_added
end
def setup_with_fixtures_and_with_fixture_path
setup_with_fixtures_and_without_fixture_path
end
## Provide a default 'setup' method.
alias_method :setup_with_fixtures_and_without_fixture_path, :setup_with_fixtures
alias_method :setup, :setup_with_fixtures_and_with_fixture_path
## Handle the case where the user provides a 'setup' method for the tests.
def self.method_added(method)
case method.to_s
when 'setup'
unless method_defined?(:setup_without_fixtures_and_without_fixture_path)
alias_method :setup_without_fixtures_and_without_fixture_path, :setup
define_method(:setup) do
setup_with_fixtures_and_with_fixture_path
setup_without_fixtures_and_without_fixture_path
end
end
else
self.original_method_added(method)
end
end
end
Drop a line and let me know if you found this useful, or if you found a bug. I’ll post any updates.
Update
Here is a slide presentation covering the same material.
3 comments
Upcoming: Boston Web Innovators Group, January 30th
We’ll be demoing spotstory at the Boston Web Innovators Group on Tuesday, January 30 at the Royal Sonesta Hotel in Cambridge, MA. Details and registration can be found here. Come by, see the site, and say hello!
No commentsI think this is funny.
Now, I’ve never considered myself a cat person, but man I find something hilarious about this.
Aron, however, does not think it is funny at all.
If you were amused click on the photo for a whole bunch more.
No commentsEverything should be back …
All of the spotstory sites should again be available (blog, www, etc.) and mail is flowing through our new provider. For those of you using our beta site, please let us know immediately if you notice anything out-of-sorts.
Thanks again for your patience as we shifted hosting providers yesterday.
No commentsSite outage today
We’re moving, so the site has been missing most of the day. We should be back in business by tomorrow January 14, 12:00 PM ET.
The story: we decided to move up a hosting change we’d scheduled for the end of January after a string of service losses over this past week.
Our apologies for the inconvenience and lack of warning.
No comments5 Mile Stone
I spent some time this morning photographing an old mile stone dating from 1729 that sits in some bushes on Washington Street in Brookline, MA. It was cold, but fun.
The milestone sits right next to the sidewalk. I’ve walked by it many times while walking between Brookline Village and Coolidge Corner and back again.
Yesterday, while browsing photos on the Library of Congress web site, I came across photos of two mile stones in Brookline which were taken in 1940. I recognized one of them as the stone on Washington Street, so I decided to shoot some photos.
It is interesting to look at the two photos. Much has changed, much is the same. I let you discover that for yourself.
Equally interesting were the reactions of passers-by on this cold January day. The people passing my little photo expedition who expressed a reaction fell into two groups.
Group one were people who were clearly wondering what I was doing blocking the sidewalk. Their reactions turned to surprise as they realized there was something in the bushes they hadn’t seen before. It occurred to me that there are people who walk by the mile stone daily, but have still not seen it.
The second group of people went out of their way to let me take photos. For some reason, the sight of me photographing this rock made them happy.
I’ll go hunting for the other stone sometime next week.
No commentsPinebank is disappearing
Pinebank is a 19th century mansion that stands (for a few more days) overlooking Jamaica Pond in the Emerald Necklace. It is currently undergoing its first phase of demolition: the removal of its facing brick and terra cotta decorations.
Pinebank was built in 1868 by the Perkins family, a Boston family of note which had made its fortune in the China Trade. There were three Pinebanks, all on the same location, the first being erected in 1806.
The current Pinebank was purchased by the city around 1890 as it accumulated properties for what would become Jamaica Park (later renamed Olmsted Park.) The building was severely damaged by fires in 1978 and 1982. As it resided in the woods on the Jamaica Plain border it suffered substantial vandalism as well.
Though slated for restoration along with the efforts to restore all of the Emerald Necklace in the mid-1990s, the improvements never occured. Sometime last year, the City of Boston took the decision to demolish the building. It will be gone by the end of next week.
There is talk of a full restoration, or letting the woods reclaim the spot, or some sort of interpretive structure making use of the building foundation, thought nothing specific is yet planned.
A nice writeup of this spot can be found here.
No comments



