Almost a month ago we made two exciting announcements – the first was that will be hosting an Intro to Ruby1 course on December 10-11, 2010. The second announcement was that we would be giving away one free ticket to a local college/university student and another free ticket away to the co/founder of a local startup company.
Well, we upped the ante and have decided to give away a total of FOUR free tickets. We received a total of 40 submissions and were really encouraged by all of the enthusiastic responses. Without further ado:
We are pleased to announce that we’ll be hosting an December 10-11, 2010. The course will be offered by and taught by our friend . Jumpstart Lab offers computer science training – for normal people.
The course will be held in our incubator at ETC Canton and will cost $375 for early bird tickets (purchased before November 20) or $450 for normal-priced tickets.
But wait! There’s more. We’re giving away two free tickets to the course: one for a co/founder of a business located in the Greater Baltimore area (you can be a “technical” or “non-technical” cofounder) and another for a student at a local college or university. Read the rest of this entry »
I’ve been thinking about ways to simplify rails integration testing. I wanted to see how well I could do it without cucumber and rspec. I decided to go pure minitest with capybara to help out. What emerged was the TestPilot pattern. Let’s check it out. Read the rest of this entry »
If you want real end-to-end testing of a page with functioning AJAX, use Selenium. But I was interested in doing just a bit of JS speccing to make sure that the AJAX routes I called worked and that the data that came back fit the JS that I had written.
So, I figured with a little and a little , I could test my javascript with real route calls. Let’s check it out. Read the rest of this entry »
I attended and spoke at Windy City Rails. I tried to take more notes this time. Out of 6 talks an lightning talks, I have ~500 lines of notes. Enjoy!. Read the rest of this entry »
I recently attended and spoke at Lone Star Ruby Conf 2010. I took notes on anything technical I thought would be useful to bring back and use day-to-day at SmartLogic. Keep in mind there were many excellent talks that aren’t on this list, it’s just a snippet of things I wanted to look into more.
After an exhilarating week of hosting the Rails community in Baltimore for , I thought it’d be helpful to share the lessons that we learned organizing .
Community Code Drives Rock!
We had a strong showing of open source authors including , , , , and various members of . Wayne () and Greg () in particular raved about the contributions they were able to make to their projects. Hey, I even got a new release of out thanks to a patch from . Other well known OSS authors that dropped by included , , and . If you were there and we missed you, please drop us a line in the comments!
I just wanted to make a quick note about directory conventions for rack middleware gems. For all gems you should follow the convention of housing all of your code inside a single file and directory of the same name as your gem within lib, e.g.
$> ls -l ~/projects/timecop/lib
drwxr-xr-x 5 john staff 170 Jan 14 20:31 timecop
-rw-r--r-- 1 john staff 82 Jan 14 20:31 timecop.rb
The reason for this is related to how RubyGems hijacks Ruby’s require method. When a gem is activated its lib/ folder is added to the load path. This means that anything inside that directory is now accessible via the require method. In order to avoid file naming collisions across gems, you must name these exactly the same as your gem. (see for a more complete discussions of this)
However, this is slightly different with rack gems. The convention for naming rack middleware is by using a dash, e.g. rack-rewrite. The convention for requiring rack middleware though is to replace that dash with a slash, e.g. require 'rack/rewrite'.
The convention I’ve adopted for structuring rack middleware within a gem is to include a file by the same name as the gem and a rack directory in lib/, and then to include the second part of the middleware name as a subdirectory under that.
~/projects/rack-rewrite (master) $> ls -l lib/
total 8
drwxr-xr-x 4 john staff 136 Apr 17 18:02 rack
-rw-r--r--@ 1 john staff 22 Apr 17 18:02 rack-rewrite.rb
~/projects/rack-rewrite (master) $> ls -l lib/rack
total 8
drwxr-xr-x 3 john staff 102 May 13 11:09 rewrite
-rw-r--r--@ 1 john staff 827 Apr 17 18:02 rewrite.rb
This allows my users to use either require 'rack-rewrite' or require 'rack/rewrite'.
Rack::Rewrite 1.0.0 has just been released. To install simply run: gem install rack-rewrite.
Rack::Rewrite is a web-server agnostic rack middleware for defining and applying rewrite rules. In many cases you can get away with Rack::Rewrite instead of writing Apache mod_rewrite rules.
Documentation is hosted at . The source code is hosted at .