This week in open source

Mike Burns

bourbon

So this bourbon gem…people seem to like it: there was a RailsCast about it and the principle author (Phil LaPier) will be speaking at Frontend United about it.

This week people cleaned up the obsolete CSS attributes: Thibaut (Thibaut) removed -moz-inline-block ([d73ea46](http://github.com/thoughtbot/bourbon/commit/d73ea468afcfe8b0a08fb0a2d397bf61f4b51e4e “Merge pull request #67 from Thibaut/inline-block

-moz-inline-block is obsolete")), Chad Mazzola removed both `-ms-border-radius` and `-o-border-radius` ([10a5908](http://github.com/thoughtbot/bourbon/commit/10a5908c39c007a1c0ebafc2a30a75924c52186d "Remove -ms and -o border-radius definitions.")), and Phil LaPier ([plapier](http://github.com/plapier)) removed `-moz-box-orient` ([6331e26](http://github.com/thoughtbot/bourbon/commit/6331e2626b2ff42486a70d28d919742f125bf091 "Removed -moz-box-orient")). Gabe Berke-Williams ([gabebw](http://github.com/gabebw)) fixed support for Rails 2 ([eacd5ee](http://github.com/thoughtbot/bourbon/commit/eacd5eeee6fbe25e06984660a225470be6329445 "bourbon:install task doesn") and [e9347e7](http://github.com/thoughtbot/bourbon/commit/e9347e7119ad64d6bc432dccd1e77bf8ae94dd6b "Don")) and, lesson learned, removed `Gemfile.lock` ([671ad33](http://github.com/thoughtbot/bourbon/commit/671ad33e3ce997e7ac0b981055edd07d7d87260e "Remove Gemfile.lock")).

factory_bot1

Version 2.6.3 of factory_bot is out, all y'all. In this action-packed version we got a cucumber step named e.g. Given the following post exists (note the lack of : at the end), via cj (cj) (d4b8cac and 48afe24). Barun Singh (barunio) fixed a bug where the factory’s traits weren’t compiled in the very first time the factory was used (68ca50f), plus a factory can use all the traits on any ancestor (f14a8cf). Joshua Clayton (joshuaclayton) is now listed as an author (07d2834), so congrats to him and his hard work. As part of that hard work he discovered that the vintage syntax broke in MRI 1.9.2-p318, and then fixed it (a7acc3e).

This just in! Version 3.0.0.rc1 is now public! It breaks everything, again! Please try it and open issues with what breaks:

gem 'factory_bot', '3.0.0.rc1'

bourne

Oh hey version 1.1.1 of bourne is out (650afb0)! Bourne is an extension to mocha that adds test spies so your tests can read like normal tests. Tristan Dunn (tristandunn) added support for mocha 0.10.5 (286d8f9) and fixed a long-standing error message that occurs when you forget to stub a method before spying on it (17dc7d2).

Gabe Berke-Williams (gabebw), who pushed the release, also did some maintainance: adding Travis CI notifications to the README (7d6eb37), removing Gemfile.lock (950a445), and some general code cleanups (4bbe610 and b0f1f99).

shoulda-matchers

The big deal in shoulda-matchers over the past week was when Fujimura Daisuke (fujimura) added the ability to specify the key for the flash message in the set_the_flash matcher (0e0339e, ef866e2, and fd4aa53):

it { should set_the_flash[:alert].to("Password doesn't match") }

Gabe Berke-Williams (gabebw) did his usual maintainance of converting the docs to use Markdown (85c37c4), cleaning up the ModelBuilder that’s used in the tests (31595b0), and showing off how often our build is broken in the README using Travis CI (eebb806), which he also did to shoulda proper (7d805d0).

cocaine

Also victim to the Travis CI treatment was cocaine, via Gabe Berke-Williams (gabebw) again (ac47b6f and 490c406).

paperclip

The paperclip project is gearing up for a groundbreaking (maybe app-breaking?) release, but in the meantime Mike Boone (boone) fixed an infinitely-growing PATH environment variable (06d69af) while Mike Burns (mike-burns)—also known as: me—totally broke backward compatibility by changing the default :path and :url configuration setting ([ ”:rails_root/public/system/:attachment/:id/:style/:filename", :url => “/system/:attachment/:id/:style/:filename”“>26f4d40](http://github.com/thoughtbot/paperclip/commit/26f4d409b2a585c7708b4b33a007eb4c86b175c1 "Change the default :url and :path to avoid conflicts. Closes #727.

The new default :path and :include include the name of the model and also nests the model ID under a series of subdirectories, improving filesystem access speed when more than 1024 models have saved attachments.

The easiest way to upgrade is to add an explicit :url and :path to your hasattachedfile calls:

has_attached_file :avatar,
  :path =")). These new settings avoid overwriting files on different models and also scales to more than 1024 instances of the same model.

capybara-webkit

In capybara-webkit news, Joe Ferris (jferris) controversially allowed the user to interact with invisible elements (02f2a8a), and caught the fact that Capybara.timeout is deprecated (4d954b7).

Project name history can be found here.


  1. Looking for FactoryGirl? The library was renamed in 2017.