the joy of apartment hunting in nyc

Posted by jacqui maher on June 14, 2008 at 10:45 AM

While I don’t have to start looking for a new place just yet, I am going to be moving out of my current digs pretty soon. There’s just something about NYC real estate that I find captivating, and I know I’m not the only one who thinks so.

I really would prefer not to continue paying the high rents of Park Slope, so I’ve started to look in other neighborhoods. This morning I went out on my bike and checked out Prospect Lefferts Gardens, Crown Heights, Bed-Stuy, Clinton Hill and Fort Greene. I came home and decided to look up some places to see what the rents were like, and how the brokers’ descriptions gelled with what I saw and thought.

Then I saw this:



I think 90% of the brokers in NYC are on mind altering drugs. Seriously, the suspension of disbelief is remarkably strong with them!

In other news, I’ve been busy and distracted lately and not doing anything with this site. I’m hoping - really - to fix this up before I leave for Africa. In fact, I’m going to be setting up a separate section for updates from East Africa; I’m not sure what my internet connectivity will be like there, especially as I plan on being in some rather remote areas, but I bet I’ll be able to post at least once or twice from there.

Til then, thanks for all the replies on my previous post. I’m taking all the advice into consideration for when I finally sit down and work on brighter.

Comments: 0 (view/add your own) Tags: nyc

where'd my css go? or: a call for advice

Posted by jacqui maher on May 07, 2008 at 08:55 AM

Huh, I somehow lost my custom CSS for this site. Probably when I was updating Simplelog… I don’t (obviously) have a very good, backed-up setup for my SliceHost. Argh!

This brings me to several questions I’ve been wanting to ask the world of talented developers I know (yes you!):

What are you guys using?

I’m curious about directory structures - should I put my sites in my home directory? /usr/local? /www?

What about version control? When you’re using third party apps (like SimpleLog) that are themselves hosted in version control systems like svn or git, do you then export or clone them and stick them in your own local SCM, or perhaps github?

Web servers? Is everyone on Nginx? What are your configs like for it? Did you use ErrTheBlog’s Nginx config generator to start off? I know some people who use LightSpeed and that looks snazzy.

And how about your dot files? I’m talking about .vimrc, .irbrc, .bashrc/.tchsrc/etc. I made a repo in my github acct for these, but it seems like overkill. How should I deploy that anyway? A lot of dotfiles go into their own directories, and I’m not sure how best to structure my repo for it.

There’s a lot of ground to cover here, I guess. Help :)

Comments: 4 (view/add your own) Tags: advice

I love bike riding

Posted by jacqui maher on May 01, 2008 at 03:07 PM

and now I’m going to blog about it. Riding in NYC is a bit tricky - while it’s great to be able to pass tons of traffic and feel the breeze in your hair along the Hudson River Park path, it also sucks to have tourists driving SUVs and insane cab drivers almost kill you, sometimes several times in a single block. The dangers come from both obliviousness and malevolence on the part of (mostly) drivers and (somewhat) pedestrians, and, yes, rarely, other bicyclists.

I started riding into work because I found, upon returning to NYC after 4.5 years in California, that the quality and reliability of the subway system had taken a severe turn for the worse. (seriously, wtf happened in so short a time? am I being nostalgic, or has it really gotten a lot worse?) Now that I’ve known the fun and fresh air of commuting by bike, though, the subway is pretty much intolerable.

I just hate standing around, waiting. The one thing I miss is the amount of time I’d have to read books… but I try to do that at night now; it’s a nice way to wind down from the day.

That’s it for now, expect more news as I learn good routes, which I’ll post via mapmyride.com, and find useful or just cool gear.

my bike, a fuji crosstown 3.0 hybrid:

Comments: 0 (view/add your own) Tags: bike

Single table inheritance strangeness

Posted by jacqui maher on April 29, 2008 at 10:19 PM

I suppose “special” is a word for this behavior. I would have expected a constraint used in find_by_id to also be used in find. Right.


>> Asset.find_by_id(params[:id])
# => nil

log: Asset Load (0.009816) SELECT * FROM assets WHERE (assets.`id` = ‘8515’) AND ( (assets.`class_name` = ‘Asset’ ) ) LIMIT 1

>> Asset.find(params[:id])
# => #“IdamAsset”, “updated_date”=>”2008-04-14 20:49:58”, “restrictions”=>nil, “idam_iud”=>”19013896”, “name”=>”6da9.jpg”, “hide”=>”0”, “is_pending”=>”0”, “is_administrative”=>”0”, “created_date”=>”2008-04-14 20:49:58”, “security_level”=>”1”, “media_type_id”=>”10”, “id”=>”8515”, “description”=>”“, “filename”=>”6da9.jpg”, “last_synced_at”=>nil, “uploaded_by_id”=>”448”}>

log: BaseAsset Load (0.000528) SELECT * FROM assets WHERE (assets.`id` = 8515)

Comments: 0 (view/add your own) Tags: rails, sti

print out a controller's expected actions

Posted by jacqui maher on April 26, 2008 at 04:59 PM

Ever want to see a list of actions defined on your controller and what methods over http they expect?

try this in your console, where “users” is your controller’s name:

   1  ActionController::Routing::Routes.routes.select do |route|
2 route.defaults[:controller] == "users"
3 end.uniq.each do |route|
4 puts "#{route.defaults[:action]} expects http method: #{route.conditions[:method]}"
5 end;nil

Comments: 0 (view/add your own) Tags: meta, ruby

model_stubbing in Rails 1.2.x

Posted by jacqui maher on April 18, 2008 at 03:58 PM

I really like technoweenie’s plugin model_stubbing. It’s a nice alternative to fixtures, and an even nicer way to create stubs in your tests and specs.

Unfortunately the StreetEasy codebase is still on Rails 1.2.x which caused compatibility problems with the plugin. Rails 2 refactored Fixtures and database statements a bit.

I had to modify the plugin to get it to work with older versions of Rails. I forked the project on github and post about it to help anyone who’d like to use the plugin but is not upgraded to Rails 2 yet.

github homepage: forked model_stubbing
public clone url: git@github.com:jacqui/model_stubbing.git

[edit] btw, simplelog was munging the href for the public clone url; it seems to like prepending http:// to links, so i just removed the anchor tags from it.

make localhost

Posted by jacqui maher on April 15, 2008 at 12:58 PM

Hey Rails developers: I bet you do the majority of your development locally, but work in an environment where you have various other development, staging, testing, and production servers.

I often have to check the same URL locally and on our staging or production servers. I got tired of selecting the hostname and changing it to “localhost:3000” and vice versa, so I made myself a bookmarklet. It is *really* easy to make a bookmarklet.

Here’s a bookmarklet that will replace everything up to the gTLD (I took this list from wikipedia) with “localhost:3000”. Drag it to your bookmarks toolbar, and the next time you’re on a url in your application that you’d like to view locally, just click it.

make localhost

here’s the source. enjoy…

   1  <a href="javascript:var current_url = location.href; var new_url = current_url.replace(/.*?(\.com|\.net|\.org|\.mil|\.info|\.gov|\.biz|\.jobs|\.int|\.pro|\.ae    ro|\.asia|\.cat|\.coop|\.edu|\.mobi|\.museum|\.name|\.travel|\.tel)\//, 'http://localhost:3000/'); location.href = new_url; ">make localhost</a>


I viewed that in my browser and dragged the link to my bookmarks toolbar. Now I can be on any of our servers ending in “.streeteasy.com” and in a single click view the page locally.

I found myself having to reverse logic in some code I wrote recently due to the wants of the client doing a 180. I had been using reject! to remove elements in an array, and realized that I now wanted to use select! - only there is no select!

I started to write:

arr = arr.select{|a| some.method.here }

when it occured to me that was a little clunky. I wanted select in place.

Here’s my version of it:

   1  class Array
2 def select!(&block)
3 selected = self.select(&block)
4 if selected.size > 0
5 replace(selected)
6 else
7 nil
8 end
9 end
10 end


Usage:

   1  >> arr = ["Ren", "Easy-E", "Ice Cube", "DJ Yella", "Dr Dre"]
2 # => ["Ren", "Easy-E", "Ice Cube", "DJ Yella", "Dr Dre"]
3
4 >> arr.select!{|a| a =~ /^D/ }
5 # => ["DJ Yella", "Dr Dre"]
6
7 >> arr.select!{|a| a =~ /^J/ }
8 # => nil
9
10 >> arr
11 # => ["DJ Yella", "Dr Dre"]

fixing a bad commit with git-svn

Posted by jacqui maher on March 25, 2008 at 05:28 PM

I do this fairly often, mostly because I haven’t migrated all of our svn pre-commit hooks to git. I really ought to do that..

$ git tag bad 012345 # or any other valid git reference
$ git checkout bad
$ # make changes here and update the index
$ git add
$ git commit –amend
$ git rebase –onto HEAD bad master # where ‘master’ is the branch in question
$ git tag -d bad

thanks to sebastian delmont for this.

Comments: 2 (view/add your own) Tags: git, svn

speedy browsing

Posted by jacqui maher on March 20, 2008 at 07:45 PM

I’ve been using the Firefox 3 beta for about a week now and I’m really happy with it so far. It’s a lot faster and less of a memory hog in OSX than its predecessor. The one thing I was wishing for was the beautiful, extremely useful, firebug extension… I kept opening Firefox 2 whenever I needed to do UI work.

Then I realized I hadn’t even checked if Firebug was compatible with Firefox 3, aside from the initial plugin compatibility check that Firefox does on its first run.

Lo and behold: the latest firebug beta works with Firefox 3 beta release 4! YES!

so what are you waiting for? install it now:
firebug beta xpi

guns don't kill people...

Posted by jacqui maher on March 20, 2008 at 09:43 AM

I saw this picture in the NYTimes today. It really appeals to my admittedly dark sense of humor:


photo credit: Stephen Crowley/The New York Times

Comments: 2 (view/add your own) Tags: heh

gadget gogo

Posted by jacqui maher on March 20, 2008 at 09:37 AM

isn’t this awesome?!



This camera is cute, small, nice-looking (hey that’s different than cute!), and really affordable. I think I’m going to get one.

Comments: 1 (view/add your own) Tags: gadget

[ERROR] Can't locate object method "install" via package

Posted by jacqui maher on March 11, 2008 at 01:14 PM

In case anyone else runs into this…

I was installing NCPL today when I ran into a missing CPAN module. I used to do a lot of Perl programming back in the day but I have to admit it’s been awhile since I’ve installed a CPAN module.

   1  [root@server NCPL-1.000050]# perl Makefile.PL 
2 ExtUtils::MakeMaker v6.31, required for 'perl Makefile.PL' via CPAN


Hrm, ok. I remember doing this with CPAN’s interactive shell…

   1  [root@server NCPL-1.000050]# perl -MCPAN -e 'install ExtUtils::MakeMaker'
2 Can't locate object method "install" via package "ExtUtils::MakeMaker" at -e line 1.


Uhmm.. ok. What the?

I googled around trying to figure out why this was causing an error on the method “install” when I suddenly realized: this is a brand new server. No one has ever run perl -MCPAN on it, I would bet.

   1  [root@server NCPL-1.000050]# perl -MCPAN -e shell
2
3 /usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.
4
5
6 CPAN is the world-wide archive of perl resources. It consists of about
7 100 sites that all replicate the same contents all around the globe.
8 Many countries have at least one CPAN site already. The resources
9 found on CPAN are easily accessible with the CPAN.pm module. If you
10 want to use CPAN.pm, you have to configure it properly.
11
12 If you do not want to enter a dialog now, you can answer 'no' to this
13 question and I'll try to autoconfigure. (Note: you can revisit this
14 dialog anytime later by typing 'o conf init' at the cpan prompt.)
15
16 Are you ready for manual configuration? [yes] yes


AHA!! It just needed to be configured. That was easy :)

better git status

Posted by jacqui maher on March 07, 2008 at 05:01 PM

My typical morning usually goes like this:

- put the laptop on desk & turn it on
- get coffee :)
- open adium/textmate/firefox/terminal/etc.
- type: git status in my project’s RAILS_ROOT
- try to recall what I did in those local modifications, and then either copied and pasted (ugh I hate having to use the mouse!) the paths for each file, or tab-completed each file path, to open it in Textmate… or opened the project, cmd-T, searching for each.

The thought had occured to me several times that there must be a better way.

This is what I came up with, and so far, it works for me.

   1  tinsel:bin jm$ ./gitstatus -h
2 Usage: gitstatus [options] [paths ...]
3
4 Specific Options:
5 -d, --diff Show git diff output for each locally modified file.
6 -t, --textmate Open each locally modified file in Textmate.
7 -h, --help Show this message


Example:

   1  tinsel:workspace jm$ ~/bin/gitstatus -d
2 [MODIFIED]: app/controllers/listings_controller.rb, app/models/listing_criteria.rb, config/environment.rb, plugins/criteria/lib/criteria/criteria.rb
3 [DELETED]: spec/rcov.opts
4 [UNTRACKED]: script/import/nnj/njtransit.rb, spec/fixtures/nyc_data_pad_addresses.yml, spec/fixtures/nyc_data_pad_buildings.yml, spec/fixtures/nyc_data_street_names.yml
5
6 ************app/controllers/listings_controller.rb************
7 diff --git a/app/controllers/listings_controller.rb b/app/controllers/listings_controller.rb
8 index 74a0e6c..4d11c1e 100644
9 --- a/app/controllers/listings_controller.rb
10 +++ b/app/controllers/listings_controller.rb
11 @@ -141,10 +141,10 @@ class ListingsController < ApplicationController
12
13 def search
14 -
15 +debugger
16 - if(@criteria[:area] && @criteria[:area].index(",") == nil)
17 + if(@criteria[:area] && @criteria[:area].index(",") == nil)
18
19
20 open in textmate? [Yn] _


If you want it, go ahead and grab it: gitstatus.rb

snippet: grab webpage and save it for future traversing

Posted by jacqui maher on March 04, 2008 at 03:47 PM

I use this method to grab a webpage and then access it later. It’s useful if you’re trying to scrape a page, for example, and don’t want to keep hitting it over the network. Note that I use this as part of a class which initializes the variable @local_dir at instance creation.

   1  def get_local_or_remote(id, webpage_uri_format)
2 html = ""
3 if File.exists? "#{@local_dir}/#{id}.html"
4 html = File.read("#{@local_dir}/#{id.html")
5 else
6 webpage_uri = if webpage_uri_format.match(/:id/)
7 webpage_uri_format.gsub(":id", id)
8 else
9 webpage_uri_format
10 end
11
12 html = insist(:delay => 60) do
13 Net::HTTP.get_response(URI.parse(webpage_uri)).body
14 end
15
16 stfile = File.new("#{@local_dir}/#{id}.html", "wb")
17 stfile.puts(html)
18 stfile.close
19 end
20
21 return html
22 end

snippet: saving data to a file to use as an input later

Posted by jacqui maher on March 04, 2008 at 01:41 PM

I find myself doing this often.

   1  >> data = Model.find_all_by_something("Something")
2 # => [... results...]
3
4 >> File.open("#{RAILS_ROOT}/db/data/somethings.yml", "w") do |f|
5 > f.puts data.to_yaml
6 > end

MySQL + Leopard: startup item pkg problems

Posted by jacqui maher on February 15, 2008 at 09:46 PM

I recently did a clean installation of Leopard after finding that my upgraded-to-leopard mac was having all sorts of issues - basically things got really slow. It got to the point that it was close to impossible for me to get any work done between the ever-present pinwheel and my growing frustration.

Things are a lot better now with Leopard. However, I’ve had to do some things differently while getting setup with the various programs and servers I need for development.

Here’s a relatively minor one that I dind’t find too many blog posts about, so I figured I would write one up quickly in case anyone else runs into this issue.

The MySQL disk images don’t install the startup program in the same place on Leopard that they did in previous versions of OSX. According to the docs:


If you want MySQL to start automatically during system startup, you also need to install the MySQL Startup Item. It is part of the Mac OS X installation disk images as a separate installation package. Simply double-click the MySQLStartupItem.pkg icon and follow the instructions to install it. The Startup Item need be installed only once. There is no need to install it each time you upgrade the MySQL package later.

The Startup Item for MySQL is installed into /Library/StartupItems/MySQLCOM. (Before MySQL 4.1.2, the location was /Library/StartupItems/MySQL, but that collided with the MySQL Startup Item installed by Mac OS X Server.) Startup Item installation adds a variable MYSQLCOM=-YES- to the system configuration file /etc/hostconfig. If you want to disable the automatic startup of MySQL, simply change this variable to MYSQLCOM=-NO-.


(from http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html)

I installed MySQL using the mysql-5.0.51a-osx10.4-i686.pkg and the MySQLStartupItem.pkg, along with the MySQL.prefPane. I noticed that MySQL was not starting up when I booted my computer. I also noticed that the prefPane wasn’t starting or stopping the server.

The problem? The startup item is not being installed by that MySQLStartupItem.pkg - I’m not sure that installer does anything at all to be honest. The MySQL server installer, otoh, installs the startup item in /usr/local/MySQLCOM

Here’s what to do to fix it:



1. move the MySQLCOM directory into right location:
   1  $ mv /usr/local/MySQLCOM/ /Library/StartupItems/


This will get MySQL starting up when your OS does. The prefPane start/stop button still won’t work though, so…

2. You can try downloading an alternate prefPane. I grabbed this one: http://creativeeyes.at/tools/mysqlpp.php

However, I couldn’t get it to install. The prefPane isn’t that important to me though, as I’m fine with starting up the server from the command line. If you moved your startup item to the /Library/StartupItems directory, you can just do this:

   1  $ /Library/StartupItems/MySQLCOM/MySQLCOM start
2 Starting MySQL database server


You can make an alias to that command for brevity’s sake too:

   1  alias start_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM start"


Stick that in your .profile, source ~/.profile, and you’re set.

Hope this helps.

Comments: 2 (view/add your own) Tags: mysql

no time like the present

Posted by jacqui maher on February 07, 2008 at 11:47 AM

regretfully - in terms of getting my gems and adhering to the schedule described in my previous post - life has been especially busy for me, mostly with regards to my full time job and my (recently acquired) freelance gig. when i have so little time that the choice is basically to walk my dog or to finish writing a ruby gem, well, there is no choice, obviously!

it’s going to have to wait. i’ve worked on it a little bit in pockets of five-to-ten minutes over the week. i’m really just trying to get high test coverage on it, as it does wipe out your test directory (with backups… and one should always backup, and use an SCM ffs, but still) and is my first to-the-public gem.

anyway. more later.

Comments: 0 (view/add your own) Tags: (none)

mini-update

Posted by jacqui maher on January 30, 2008 at 11:12 AM

I have been really busy lately, and this blog has been awfully quiet. However! I am working on stuff.

Like what?

- testunits2rspec converter gem released by the end of the week.

- decision on wtf to do with my nelson mock creation automation framework, as there’s only so much one can do automagically in a dynamically-typed language

- hopefully will be releasing my fixtures2factory plugin (or maybe a gem) next week

- fixtures2mocks to follow

In the meantime, the awesome artist Shephard Fairey has made two posters recently that I like. I’m starting to consider voting for Obama, now that I finally have allowed myself to read what he stands for and compare it to what Clinton stands for. Mostly it’s their voting records that have me more in favor of Obama. Plus he’s a new face and I think that, more than anything, is what America needs to regain footing with the rest of the world. Because really, in the end, I don’t think any one politician that could get elected into the office of the president of the US can be that much different than another one.


So… come on people, at least, you american people reading this who are 18 and older:


… perhaps even vote for:


but no matter what you vote for, do vote.

damn, people love nostalgia

Posted by jacqui maher on January 12, 2008 at 05:46 PM

TechCrunch reports that AOL is discontinuing Netscape Browser Development.

Check out all the comments on this. Close to 100 people remember the “good ole days” of using Netscape Navigator. I’m a total geek, and I remember when Marc Andreesen and company came out with Netscape. In fact I even hung out at the Netscape offices down in Mountain View a bit; I had friends working there.

However!! the amount of nostalgia displayed on the TechCrunch post is kind of gross.

Plus, this is news? I was actually more surprised to read that AOL was doing *any* development on the Netscape browser at all.

Nostalgia is death. Let’s move on.

getting things done

Posted by jacqui maher on January 09, 2008 at 11:54 PM

As a sometime contributor to the open source project Tracks - a Ruby on Rails application that helps you follow the GTD philosophy of managing your life - you’d think I wouldn’t get overwhelmed very often.

Not so much.

Today I found myself doing the following tasks all at once:

1. installing thrudb
2. setting up config files for the new mysql slave server in puppet
3. installing innodb hot backup, reading the docs on it
4. chatting with my friend mike - a rockstar dba - about best practice in mysql replication
5. fixing one of our scrapers at streeteasy
6. reading about earthclassmail.com
7. rsync’ing master db data and schema dumps to the new slave server
8. responding to someone in an irc channel
9. remembering to make a payment on my credit card
10. reserving a table at les halles.
11. reading my email (streeteasy)
12. reading my email (brighter)
13. trying to remember to open NNW to see if it really was free
14. trying to remember to look up docs on couchdb
15. instead remembering a great line in the book I was reading on the subway this morning - Life Is Elsewhere by Milan Kundera - and posting it to my tumblog.

It was while I was flipping between opentable.com, developers.facebook.com/thrift/, my IM client, my IRC client, my mail client, and so on and so forth that I found myself staring at an empty google search box wondering wtf I was doing.

I realized I was getting overwhelmed and trying to do too much at once. Of course us humans are generally smart and able to juggling lots of things at once, and of course I was actually juggling a lot more than listed above in the 15 points. This doesn’t make me a genius or anything like that - ok, a little ambitious sure - in fact, I’ve found that it’s making me more scatter-brained and distracted than anything else.

In trying to be good at everything one ends up being only “alright” in general. Who wants to be so blandly ordinary and dull?

My next thought was that I should go check out what tips the blog lifehacker.com has for managing one’s time and productivity…

.. when I realized that was just yet another item to add to the list, and that wouldn’t help me.

So to my fellow multi-tasking information hunting and new application writing programmers and friends: how the hell do you get so much done every day?

Sincerely,
me.

Learning StoryRunner

Posted by jacqui maher on January 06, 2008 at 02:53 PM

in which I try to get done with my mockamator already by writing stories describing what it should do, learning how to work with Story Runner in RSpec along the way.

references:
* What’s in a Story by Dan North
* Great step by step example driven tutorial for Rspec on story runner
* RSpec docs on mock objects

This is my first attempt at a story. I already find this helpful as it forces me to make decisions and figure out what it is, exactly, that I’m trying to accomplish. And how.

The Nelson plugin should automagically create mocks (valid or invalid) for any given controller



Narrative:

As a developer
I want to easily write controller specs
So that I’m not spending hours on hundreds of LOC making mocks with the right expectations

Acceptance Criteria:

Scenario 1: writing a new controller spec
Given the UserController
   And that I want to use valid mocks that won’t throw errors
When calling Nelson.generate_mocks(UserController, {:valid => true})
Then a site instance object should be mocked out
   And a get request, for example, on the signup form should not raise an error

Ok, so that’s my story and it’s useful in that it’s already helped me get a better idea of what I’m doing… but how do I translate this into Ruby code that can be run through rspec?

One of the tutorials I’m following gives an example of a story, so I am just going to copy and paste it and change it to be appropriate for my narrative:

   1  Story "The Nelson plugin", %{
2 should automagically create mocks
3 that are valid or invalid
4 for any given controller
5 }, :type => RailsStory do
6
7 Scenario "in the before block of a controller spec" do
8 When "calling Nelson.generate_mocks" do
9 Nelson.generate_mocks(UserController, {:valid => true})
10 end
11
12 Then "a site mock should be generated" do
13 @site.should_not be_nil
14 @site.should be_a_kind_of(Site)
15 end
16
17 When "I request the UserController signup action in a get request" do
18 get '/user/signup'
19 end
20
21 Then "response should be successful" do
22 response.should be_success
23 end
24 end
25 end


That was my first attempt. While writing this a few questions came up, namely…

- does the context get preserved between different When events? that is, will instance variables that are created in one event be accessible in a subsequent event context?
- am i breaking up my tasks correctly?
- what’s up with that array of phrases in the Story block anyway?
- does the When have to be mapped to a controller request?
    (from the vaporbase.com tutorial: “The “When” clause is the meat of the scenario. It is a controller action, and its spec gets done next… “)

Only one way to find out: time to run this through the story runner. I foresee some errors… :)

   1  jm:~/se/app/workspace (master) $ ruby stories/nelson_should_create_mocks.rb 
2 Running 1 scenarios
3
4 Story: The Nelson plugin
5
6
7 should automagically create mocks
8 that are valid or invalid
9 for any given controller
10
11
12 Scenario: in the before block of a controller spec
13
14 When calling Nelson.generate_mocks (FAILED)
15
16 Then a site mock should be generated (SKIPPED)
17
18 When I request the UserController signup action in a get request
19
20 Then response should be successful
21
22 1 scenarios: 0 succeeded, 1 failed, 0 pending
23
24 FAILURES:
25 1) The Nelson plugin (in the before block of a controller spec) FAILED
26 NoMethodError: undefined method `generate_mocks' for Nelson:Class
27 stories/nelson_should_create_mocks.rb:28:in `calling Nelson.generate_mocks'
28 stories/nelson_should_create_mocks.rb:27
29 stories/nelson_should_create_mocks.rb:20


Whoa! That actually went a lot better than I expected. I haven’t written the method “generate_mocks” in my plugin yet, so naturally it would fail.

I love the output of the Story Runner. I think I might be sold. Time to write the methods in my Nelson plugin that will generate the mocks, I guess.

I’ll be posting my stories - when they’re closer to being finalized - here as examples for other people to reference.

In the meantime, here are some:

* from pastie
* from evang.eli.st (scroll down)
* plain text stories from david chelimsky’s blog

Ultraviolet gem issues resolved!

Posted by jacqui maher on December 30, 2007 at 01:19 PM

I finally figured out what the problem was with Ultraviolet. If you get this error message:

   1  Textpow::ParsingError 
2 (Parsing error in ^to \w+: wrong number of arguments (2 for 0)):


It is probably due to incompatibilities among some combination of your oniguruma C library, oniguruma, textpow, and ultraviolet gems, rubygems, and ruby the language itself.

Here’s my setup, running in Ubuntu, that works:

   1  jacqui@brighter~ $ ruby -v
2 ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux]
3 jacqui@brighter~ $ gem -v
4 1.0.1
5 jacqui@brighter~ $ gem list # snippet
6 oniguruma (1.1.0)
7 textpow (0.10.0)
8 ultraviolet (0.10.1)
9 jacqui@brighter~ $ onig-config --version
10 5.9.1


I’ll fix the overflow problem (related to code spilling out behind the sidebar) later.

ultraviolet

Posted by jacqui maher on December 28, 2007 at 11:28 PM

No one knows how to fix my ultraviolet/simple highlight issues? Really?

Ugh!

hello to my non-techie friends!

Posted by jacqui maher on December 28, 2007 at 11:04 PM

I was hanging out with my friend Kerry a few days ago when she mentioned reading this blog and not really knowing what the hell I was talking about in all of the posts.

So…

I thought I’d write to say hi to my friends who aren’t programmers or in a similar line of work. I like keeping this blog technical as delving into other areas (read: personal) of my life is a bit… well, I’d just rather not write about it in a public forum. It gets complicated really quickly. Plus, I think it’s tacky.

Anyway, the readers who remember my “some girls wander by mistake” blog might be bored with this one, but that just means you should hang out with me in person and stop being so freaking creepy and voyeuristic :) *

Til then, yours in ruby, rails, and testing,

Jacqui

* Of course even then you wouldn’t know the half of it, but…

Comments: 0 (view/add your own) Tags: (none)

quick script to move your test::units to specs

Posted by jacqui maher on December 25, 2007 at 01:25 AM

this isn’t drop dead gorgeous or anything, but it worked ok for what i needed to do in the amount of time i felt like spending on it. i’d love to see how someone would make it better though, as usual.


and argh, i really need to spend some time on the css here. it’s hard to read code i post, and i apologize about that. lame!

download it: teststospecs.rb

view it