---
title: This week in open source
teaser:
tags: news,open source
author: Mike Burns
published_on: 2011-12-02
---

Since last week was Thanksgiving here in the States, here's a double-whammy: everything that happened last week _and_ everything that's happened this week, in one blog post!

## suspenders

The big deal with [suspenders](https://github.com/thoughtbot/suspenders), our app app, is that version 0.3.2 is officially out! Since 0.3.1 on October 28th we've added an email validator, raised email delivery errors in the development environment, added Heroku support (try the `--heroku` flag), and switched to bundler for the gem itself.

While Dan Croak ([croaky](http://github.com/croaky)) was releasing 0.3.2 ([40690ae](http://github.com/thoughtbot/suspenders/commit/40690ae90753717a18314bed20c60df39dbc5435 "release 0.3.2")) he also made sure to document the `--heroku` and `--clearance` flags ([02a8bb0](http://github.com/thoughtbot/suspenders/commit/02a8bb003d2059c064133401a1c2777d57cc1e28 "documenting Heroku and Clearance flags")). Gabe Berke-Williams ([gabebw](http://github.com/gabebw)) added a missing `bundler/setup` to the `Rakefile`, tying everything together neatly ([d09ee5b](http://github.com/thoughtbot/suspenders/commit/d09ee5b63314d417ed5c3b0747ab64b58c926a4e "bundler/setup is important.")).

## shoulda-matchers, shoulda, high\_voltage, bourne, pacecar, flutie, shoulda-context, factory\_bot-rails

Above I mentioned how Gabe Berke-Williams ([gabebw](http://github.com/gabebw)) added `bundler/setup` to the `Rakefile` of suspenders. He also did it to [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) ([9d79124](http://github.com/thoughtbot/shoulda-matchers/commit/9d79124f56f8fa3129c2324346f5ff42ef704712 "bundler/setup is important.")), [shoulda](https://github.com/thoughtbot/shoulda) ([8054563](http://github.com/thoughtbot/shoulda/commit/80545637b957fc68a3b7be8993033d089913ac66 "bundler/setup is important.")), [high_voltage](https://github.com/thoughtbot/high_voltage) ([ec656e1](http://github.com/thoughtbot/high_voltage/commit/ec656e1bd6f1233a0b8ab3d5e8a7c4026d1db5d8 "bundler/setup is important.")), [bourne](https://github.com/thoughtbot/bourne) ([9d21677](http://github.com/thoughtbot/bourne/commit/9d216778aead69b194693623f9daa6f3b4f8cb06 "bundler/setup is important.")), [flutie](https://github.com/thoughtbot/flutie) ([7863d14](http://github.com/thoughtbot/flutie/commit/7863d141729de777b41b07fa3e8d1f413bae4d53 "bundler/setup is important.")), [shoulda-context](https://github.com/thoughtbot/shoulda-context) ([75a8384](http://github.com/thoughtbot/shoulda-context/commit/75a83844e8bee23b2dc710511d508c28c7b652de "bundler/setup is important.")), [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) ([797a985](http://github.com/thoughtbot/factory_bot_rails/commit/797a98533f6d042aa75bf6c4f245cfab0e972149 "bundler/setup is important.")), and [pacecar](https://github.com/thoughtbot/pacecar) of all things ([fb972c0](http://github.com/thoughtbot/pacecar/commit/fb972c0283a394da5554efdd39564ac58c8b1d2c "bundler/setup is important.")).

Wild.

## bourbon

Version 1.2.0 of [bourbon](https://github.com/thoughtbot/bourbon) is out, bringing more Sass mixins into your life. Phil LaPier ([plapier](http://github.com/plapier)) added support for the CSS3 `appearance` ([e888e0a](http://github.com/thoughtbot/bourbon/commit/e888e0ab6004b6d58969f1d7fe0c17e46a238afe "Added css3 appearance mixin")) and `background-size` ([4588c5c](http://github.com/thoughtbot/bourbon/commit/4588c5c9bdc941bb73a7010c2fdf75c7de99a766 "Added background-size mixin")) properties, and added `$georgia`, `$helvetica`, `$lucida-grande`, and `$verdana` variables ([4ba1cff](http://github.com/thoughtbot/bourbon/commit/4ba1cffd96dc414bf648ec8e7f79d0c825d3af13 "Added default font-family variables - helvetica, georgia, lucida-grand, verdana")). He also updated the docs to reflect this ([d23064b](http://github.com/thoughtbot/bourbon/commit/d23064bbf758459005f64efbeb3c54972b5ea4d1 "Updated readme to support appearance, background-size, font-families, columns")), cleaned up some warnings ([99946bb](http://github.com/thoughtbot/bourbon/commit/99946bbe85198b502260c7ec647d431a35c68ea5 "Removed the warning from the golden-ratio function")), and made the release ([93beb25](http://github.com/thoughtbot/bourbon/commit/93beb25236c3f2dabed77b809746aaeaa4abdd9c "Version bump 1.2.0")).

## paperclip

The past two weeks saw an improvement for gem authors in [paperclip](https://github.com/thoughtbot/paperclip): Mike Burns ([mike-burns](http://github.com/mike-burns)) removed the `Paperclip::Options` object, replacing it with a `Hash`. Any option you pass to `has_attached_file` is thus available to your underlying Paperclip extension without any extra work and with a canonical interface ([5a7769b](http://github.com/thoughtbot/paperclip/commit/5a7769b61f403b4598fa905d20e5da083dc96df2 "Remove the Options class, replacing it with a hash.")).

Prem Sichanugrist ([sikachu](http://github.com/sikachu)) continued on his quest for having Paperclip work on CI with Rubinius; he tried removing the generated `rbc` files so the CI server will generate them every time ([2c08152](http://github.com/thoughtbot/paperclip/commit/2c08152ba6d67815523a5ecff45b88e787ad449b "Remove the compiled .rbc file from Rubinius so it will regenerate

    This will fix the problem on the CI server, where some time the change occurred by ")).

## factory_bot[^1]

In the past two weeks [factory_bot](https://github.com/thoughtbot/factory_bot) has seen three releases: 2.3.0 ([85d4735](http://github.com/thoughtbot/factory_bot/commit/85d47353613e89a34a37e6b254033090e1c22312 "Bump version to 2.3.0"), [2fdabdb](http://github.com/thoughtbot/factory_bot_rails/commit/2fdabdb0c972c7dfea25dfa5dc5a46265977b0df "Bump version to 1.4.0"), and [89b9a82](http://github.com/thoughtbot/factory_bot_rails/commit/89b9a82b7eef2d0428497e87cdbcea77241d9e9d "Update dependency on factory_bot to 2.3.0")), 2.3.1 ([e15ae8d](http://github.com/thoughtbot/factory_bot/commit/e15ae8d75b58b81be13064b11faa2488a656f027 "Bump version to 2.3.1")), and 2.3.2 ([17eacf0](http://github.com/thoughtbot/factory_bot/commit/17eacf0f2805d05406046a9d54b4ff45548fe7ac "Bump version to 2.3.2")). Joshua Clayton ([joshuaclayton](http://github.com/joshuaclayton)) has been hard at work, you see.

As a result, dynamic attributes and callbacks in traits are called in the right order, closing [#247](https://github.com/thoughtbot/factory_bot/issues/247) ([1eb7e1b](http://github.com/thoughtbot/factory_bot/commit/1eb7e1bcc595692d8ee4d1bbd9b5af3ac477bdc6 "Ensure traits and dynamic attributes that are applied evaluate correctly

Closes #247") and [65e5e25](http://github.com/thoughtbot/factory_bot/commit/65e5e25fc23f5790b695bc149e8e298de41e6d70 "Ensure callbacks on traits are executed in the correct order")). Also, traits can be added to factories dynamically, when creating an object ([ [:male, :admin]
        factory :female_admin, :traits => [:admin, :female]
      end
    end

    FactoryBot.create(:male_admin)
    FactoryBot.create(:female_admin)

You could just create a user with those traits assigned:

    FactoryBot.create(:user, :admin, :male)
    FactoryBot.create(:user, :admin, :female)

This can be combined with attribute overrides as expected.

    FactoryBot.create(:user, :admin, :male,   :name => "John Doe")
    FactoryBot.create(:user, :admin, :female, :name => "Jane Doe")">442ba18](http://github.com/thoughtbot/factory_bot/commit/442ba18f14736fd5e197225b67960ac4c846555b "Traits can be added to factories when the factory creates an instance

This allows for traits to be used with normal factories without having
to name every single factory that uses one (or many) traits.

So, instead of creating male_admin and female_admin factories:

    FactoryBot.define do
      factory :user do
        trait(:admin)  { admin true }
        trait(:male)   { gender ")). For example, if you have an `:admin` trait you can make an admin user on the fly with `FactoryBot.create(:user, :admin, :name => "Frank Blank")`.

The other pile of commits from Josh are all internal refactorings. Things like removing the `Proxy#associate` method in place of using `Proxy#set` everywhere ([3ed2f62](http://github.com/thoughtbot/factory_bot/commit/3ed2f6274a8bf5d8c4efa8d3f45b16025c0bec20 "Remove associate method from all the FactoryBot::Proxy subclasses"), [f47c03c](http://github.com/thoughtbot/factory_bot/commit/f47c03c4b0a7ff5cc0c5712ceab3b73fba1553f0 "Fix spec by setting an attribute instead of a symbol"), and [d3a7b7e](http://github.com/thoughtbot/factory_bot/commit/d3a7b7e065b246c7a86865791dae4c418d0a3b3c "Remove #set_ignored altogether")), cleaning up the `require` statements ([9472a14](http://github.com/thoughtbot/factory_bot/commit/9472a144673c88b82ae933269d191d20a1908c30 "Move around requires")), consolidating and documenting all exceptions in the `FactoryBot` class ([c46c090](http://github.com/thoughtbot/factory_bot/commit/c46c090bdcf7730826c7c03a370297bb4c0146e0 "Consolidate errors into factory.rb")), handling nil blocks when running a factory ([2bf5cea](http://github.com/thoughtbot/factory_bot/commit/2bf5ceab0a61924de482180b5797557fcb3dcdb8 "Make sure a block always exists")) and when creating it in general ([86f971b](http://github.com/thoughtbot/factory_bot/commit/86f971b25f2ba0e4befe2d605f4e5322e942356a "Make sure a block exists when creating, too")), delaying the sorting of attributes until the last minute by using a lighter-weight array instead of hash ([d563b94](http://github.com/thoughtbot/factory_bot/commit/d563b94e95e35e6c2b44a4600d484b8df2ab29ee "AttributeList")), making bold claims about inheritance that some blog post authors disagree with ([557cce6](http://github.com/thoughtbot/factory_bot/commit/557cce6e10d81878b8acc113c504580048d814b8 "Inheritance is our friend")), moving `Proxy::Stub#next_id` into the private namespace ([0c31b6e](http://github.com/thoughtbot/factory_bot/commit/0c31b6e6a323ddf22ed1b95aede218501f6839d4 "Make Proxy::Stub#next_id private")), taking an ignored argument to a block so some versions of Ruby don't complain ([c93dea5](http://github.com/thoughtbot/factory_bot/commit/c93dea5ad637260ae769489f27e1f96f04b28e1a "Fix block in spec")), defaulting the creation method to save instead of `nil` ([5bbbcb9](http://github.com/thoughtbot/factory_bot/commit/5bbbcb9edfb82f83f88d57f712d123c0ce85e348 "Move logic of what to do to create an instance to the definition where it belongs")), singularizing `Attribute#aliases_for?` into `Attribute#alias_for?` ([f247968](http://github.com/thoughtbot/factory_bot/commit/f24796804695ffc9f8ec54458603e3a1bebba2f3 "Fix method name")), using his beloved [Null Object pattern](https://thoughtbot.com/blog/post/12179019201/design-patterns-in-the-wild-null-object) to reduce some conditionals ([fba404a](http://github.com/thoughtbot/factory_bot/commit/fba404adaac4e180f09fd9bc929c1b400d6b019e "Set up instance wrappers to consolidate get/set") and [b339c8f](http://github.com/thoughtbot/factory_bot/commit/b339c8f10999a88a695b7041ecf8ba710ff6244a "Move all block execution for dynamic attributes to the anonymous_instance")), adding a common `#to_proc` method across all attributes and then invoking methods with `#[]` instead of `#call` ([fba6f33](http://github.com/thoughtbot/factory_bot/commit/fba6f332fdeaa80ca31aef8f99599a8482a866bc "Attributes have a to_proc method and are lazily evaluated on an anonymous class") and [3282eea](http://github.com/thoughtbot/factory_bot/commit/3282eea6582f55896645d6c6baf607716bd40921 "Move class creation/handling to an anonymous evaluator")

This allows for Attribute#to_proc to not require a proxy to be passed to
return a Proc. It also allows for removal of Attribute#add_to")), straight-up removing dead code from the `AttributeList` ([56a6f67](http://github.com/thoughtbot/factory_bot/commit/56a6f679a772421735de238591dc0e85f6a49413 "Simplify AttributeList")), and passing overrides through to the runner class ([5fc57da](http://github.com/thoughtbot/factory_bot/commit/5fc57dacf7504d3dd32f8a092ea258fc34b47236 "Pass overrides when constructing Runner")).

Gotta break a lot of eggs to make an omelette. Speaking of, Gabe found a broken `version.rb` and fixed it ([1e47af0](http://github.com/thoughtbot/factory_bot_rails/commit/1e47af0319b71ee2da6e5fda920fb075727cc76e "Remove broken, unused version file.")).

## clearance

Another doc week for [clearance](https://github.com/thoughtbot/clearance) where Gabe Berke-Williams ([gabebw](http://github.com/gabebw)) observed that we test it against Rails 3.1.0 ([f7c5e3b](http://github.com/thoughtbot/clearance/commit/f7c5e3bab811ddf938f231936a32127552bf8c12 "We actually test against 3.1.0 proper.")) and Matthew Burket ([Mab879](http://github.com/Mab879)) noted that you must migrate the database before running `rake`, when testing ([39a6ac5](http://github.com/thoughtbot/clearance/commit/39a6ac56ccec943d220d033519e5e96c8254ed28 "Markdown, wasn") and [8b9e89b](http://github.com/thoughtbot/clearance/commit/8b9e89bc2dd58efb9a8a5223d999659f68f6a778 "Rake db:migrate is needed to get tests to start.")).

## fake_braintree

New features in our Braintree fake object, appropriately named [fake_braintree](https://github.com/thoughtbot/fake_braintree)! Gabe Berke-Williams ([gabebw](http://github.com/gabebw)) added support for `FakeBraintree.generated_transaction` ([d1bbcb7](http://github.com/thoughtbot/fake_braintree/commit/d1bbcb7d30f5d50f292ab0e3d827bdc56d241454 "Set :created_at in FakeBraintree.generated_transaction."), [917a235](http://github.com/thoughtbot/fake_braintree/commit/917a2352e8c3f25515e85e917324591dc61f92b7 "Can generate a transaction with no args."), [4fc470d](http://github.com/thoughtbot/fake_braintree/commit/4fc470d11cf369b8fe2832d723ef261d4cb080ff "Cleanup."), and [4cb5cb0](http://github.com/thoughtbot/fake_braintree/commit/4cb5cb0d30d91471ac3063786f3126fc3bbdeb36 "Add ability to generate a transaction.")), `Braintree::Subscription.update` ([fab3c92](http://github.com/thoughtbot/fake_braintree/commit/fab3c92c41a4a9c7af49513c9640b415069127d3 "Add Braintree::Subscription.update")), and `Braintree::Customer.delete` ([c2aa516](http://github.com/thoughtbot/fake_braintree/commit/c2aa516f0bf8a6a6a6bc64f65aecdd45ca6fc05d "Braintree::Customer.delete")). Joe Ferris ([jferris](http://github.com/jferris)) started work on add-ons ([312cfac](http://github.com/thoughtbot/fake_braintree/commit/312cfac4f93e312872630dc6ea83e8e7370622c0 "Basic support for add-ons")).

Gabe also did some lovely documenting; now you can learn about how to use this in Cucumber ([c163c4d](http://github.com/thoughtbot/fake_braintree/commit/c163c4dd55400d19bf5be3bcf76c8f75e4d25632 "Add Cucumber example.")), how to avoid calling `FakeBraintree.activate` ([dff3e51](http://github.com/thoughtbot/fake_braintree/commit/dff3e512fb0aeff27de0b11efe54303875c87154 "You don")), whether the build is broken ([499cb05](http://github.com/thoughtbot/fake_braintree/commit/499cb05d0ed316561d7c834adfbbdfc24f151afc "Add Travis-CI status image.") and [1b1a532](http://github.com/thoughtbot/fake_braintree/commit/1b1a5326f377f66087f9686ba86ec92a759dbfad "Configure Travis CI.")), and what the difference is between declining and verifying a card ([625993a](http://github.com/thoughtbot/fake_braintree/commit/625993aa6cfc3e810df8983019ec952fc5cb46c6 "Clarify declining vs verifying cards.")). Additionally the `Subscription` class was refactored ([3ed090e](http://github.com/thoughtbot/fake_braintree/commit/3ed090e5d16286cb2d7cd83e8451739e41dada5d "Refactor Subscription.")), the tests were made more explicit ([a23a61c](http://github.com/thoughtbot/fake_braintree/commit/a23a61c704859d9d16af76a8cd99fa026edf83d5 "Be more explicit in the test.")), and the tests pass ([0a12182](http://github.com/thoughtbot/fake_braintree/commit/0a121828d89a6d95b2bf66ced5370f0232368642 "Get to green.")).

[^1]: Looking for FactoryGirl? The library was renamed in 2017.
[Project name history can be found here.](https://github.com/thoughtbot/factory_bot/blob/master/NAME.md)
