giant robots smashing into other giant robots

We are thoughtbot. We make web & mobile apps.

Tagged:

Comments (View)

This Week in Open Source

clearance

Gabe Berke-Williams (gabebw - that’s me!) cleaned up the clearance Rakefile a bit (4f016db).

factory_girl

Joshua Clayton (joshuaclayton) released version 3.1.0 of factory_girl (f1d3018). For the full list of changes, see the NEWS file. Josh updated a few dependencies too (20becc9, 29157d6). Kristian Mandrup (kristianmandrup) added the ability to alias sequences, just like you can alias factories (f387e38, 178a7ab). To see how to use it, see the documentation (f013335) he added for it. I love documentation pull requests.

factory_girl_rails

Joshua Clayton (joshuaclayton) bumped factory_girl_rails to version 3.1.0 (4259e4c) to match factory_girl’s new version.

paperclip

Prem Sichanugrist (sikachu) released version 3.0.2 (240147e) of paperclip. Unfortunately, the NEWS file hasn’t been updated for 3.0.2 yet. Prem removed an obsolete generator, then added a test for it (a2a4c7a, 03700c8). Preston Guillory (pguillory) fixed a typo (853595a). Typo fixes are always welcome! Michael Galero (mikong) pluralized the table name in the migration generator to follow Rails convention (28e2d1b). And Rafael Mendonça França (rafaelfranca) removed init.rb, since plugins will be deprecated in Rails 4.0 (ae7b7c5).

shoulda-matchers

Gabe Berke-Williams (gabebw - me again!) finally released a new version of shoulda-matchers! Version 1.1.0 has a bunch of changes that you can see in the NEWS file. One of the noteworthy changes is that shoulda-matchers now depends on ActiveSupport >= 3.0.0 (c65e43a), meaning it’s Rails 3-only. We’ve been only testing against Rails 3 for a while, so this just makes it official. Gabe made a couple of documentation fixes (9203275, 8fcc3d2, a4edff0) and also cleaned up the code (5873502, 41088bc, 3039cc6, 820f216, 2e73b35, 457be62). Brendan Loudermilk (bloudermilk) added an accept_nested_attributes_for matcher (ee74222).

this-week-in-open-source

Finally, Gabe Berke-Williams (gabebw) fixed a little bug in this-week-in-open-source (which I used to generate this post!) to print missing directories before doing anything else (564c7c9).

Tagged:

Comments (View)

This week in open source

laptop

I was reminded that I’ve been missing out on our sweet laptop script, which is a program we maintain to get a Rails environment set up on OS X as quickly as possible. So over the past week, Antonio Salazar Cardozo (Shadowfiend) fixed our capitalization of Qt (b667280), Prem Sichanugrist (sikachu) fixed our capitalization of JavaScript (87fe88f), and Dan Croak (croaky) removed the deprecated Heroku Labs plugin (842cd0d) and gave instructions on installing the command-line XCode tools (a177cca).

suspenders

The suspenders gem, which has helped many people start a Rails app, now shows that the build is broken. Gabe Berke-Williams (gabebw) added that (76e42eb).

shoulda-matchers

The shoulda-matchers gem is a collection of RSpec matchers for various Rails things. Gabe Berke-Williams (gabebw) went to town on it this week, cleaning everything up in an effort to make it more pleasant to hack on (2b98e49, 09544fa, 7b3d6d0, 96df0b1, 36006d8, 4ff1344, 3b3181b, 4574f51, 1c517d2, bd52483, e70e1bf, 41bccc8). Having done that, he added a :primary option to the have_db_column matcher (68e65b2). Matthew Daubert (MDaubs) fixed a JRuby failure and also added support for Rails 3.0 (d85503f).

bourne

Due to my complaining last week, the bourne gem now has a NEWS file (8dfb077), thanks to Gabe Berke-Williams (gabebw).

paperclip

So we have this gem named paperclip. You might have heard of it. This week, Tony Brewerio (tony-brewerio) fixed the :content_type validator (c4c22f8).

Prem Sichanugrist (sikachu) released version 3.0.1, which breaks backward compatibility (d61ddd5, 51bb0f9, 7088f5b, e1951ed, 9ea4a9b, 36d1289, 8390516, b3f9690, 8e80310, ee4107a, b3a63ed, 8a758c2, 84d2d08, fe706c6, b54904e, d3a7427, da5d716, ee42b19, e83f88f, 03f777f, 5232b19, 19aedbc).

Jon Yurek (jyurek) merged in something he has been working on: adapters for different types of I/O (6c5fe19, e10edcd, f4b6d48, 78cfebd, 89c8d11). Adding new file-like things is now easier, including URLs that act like files. Yeah, that’s right.

Jon is so going to write a blog post about this with more explanations, after he updates the README.

factory_girl

A bunch of fun commits to factory_girl this week. Chris Griego (cgriego) used pull requests as a forum to promote his ActiveAttr gem (81c9f2c and 4e2a672). Joshua Clayton (joshuaclayton) added a before_create callback (24d417d).

Vasiliy Ermolovich (nashby) used ActiveSupport for deprecation warnings (bca13f1 and 28e3c25) and also made use of the singleton_class method in Ruby 1.9 (08d01c1).

Mike Subelsky (subelsky) fixed a typo in the docs around the name FactoryGirl::Syntax::Methods (266b1d6), Dan Croak (croaky) mentioned the supported Ruby versions in the README (bed50ec), Josh renamed Changelog to NEWS because that’s exactly what it is (4f5b775) and also renamed *rb files to *erb to handle yardoc better (a6ccbcb).

capybara-webkit

I totally dropped the ball on releasing a new version of capybara-webkit this week. Sorry about that! Joe Ferris (jferris), however, refactored some of the C++, which is very welcome (c2a2bd0 and 4531f65).

appraisal

Some news in our appraisal gem this week: Gabe Berke-Williams (gabebw) added a contribution guideline (fd05fdf), then osheroff fixed appraisal to handle weird filenames (1d4fa93, b21220a, and 75a4970).

Tagged:

Comments (View)

This week in open source

bourbon

As a programmer I love the change that made it into version 1.3.6 (10f978d) of bourbon: Phil LaPier (plapier) added to work done by Frank (frankzilla) to add a monospaced font family, $monospace—with support for Bitstream Vera Sans Mono, my favorite monospace typeface (3467fe3 and c86e5687). Nice.

paperclip

Friday saw a new release of paperclip (1cb40e3), in accordance with the prophecy. It contains Windows support, a bug fix, and two new features.

Prem Sichanugrist (sikachu) has been working on handling characters that are not URL-safe; to this end he added a :restricted_characters option to has_attached_file, with a default value of &$+,\/:;=?@<>\[\]\{\}\|\\\^~%# , which specifies characters to replace with an underscore, _ (8353518 and 604304e). Benjamin Hüttinger (maxigs) added the ability to pass a block, evaluated at runtime, for :fog_host, :bucket_name, and :fog_credential options (e049ec5, 2b562a9, 8742615, and 1c88a72).

The gem itself had problems installing on Windows because a bundled test made sure that filenames with question marks were handled fine; turns out this simply breaks on Windows. Even though no actual programmers use Windows, we removed the offending file (ed5cd9f). Jon Yurek (jyurek) fixed a long-standing bug where the RSpec matchers (validate_attachment_content_type, validate_attachment_presence, and validate_attachment_size) didn’t handle the :if argument they were supposed to handle (5d4ba62).

capybara-webkit

A new release of capybara-webkit is in the works, and this is what you’ll see in it: Matthew Mongeau (halogenandtoast) added the ability to trigger mousedown and mouseup events (51c4dfe and 16c1637) while Joe Ferris (jferris) has commands block until the page finishes loading (18607d0).

clearance

Oh sweet, a new version of clearance is out (6c0c070)! In it you’ll find support for Rails 3.2 from Gabe Berke-Williams (gabebw), mostly in following deprecation warnings (6e57d10). Some prodding from Matthew Daubert (MDaubs) prompted us to upgrade cucumber-rails to 1.1.1 (691e867 and 91f4675). Dan Hodge (danhodge) dropped a totally awesome change on us, abstracting out the User class into Clearance.configuration.user_model, which can be changed at runtime (085a9b6, a582eec, and fc6af70). Dude, that’s awesome.

fake_braintree

Holy cow it’s version 0.2.0 of fake_braintree (0be2aea). In this Gabe Berke-Williams (gabebw) gave us the ability to specify a constant amount for a transaction (783719c), and mimics the behavior around customers with failing credit cards (a2ceb58).

factory_girl

No big news in factory_girl this week. Carlos Antonio da Silva (carlosantoniodasilva) updated the docs to mention that .stub is now .build_stubbed (08018f6). Michael Klishin (michaelklishin) fixed the build on Travis CI for Rails 3.2 by updating rubygems first (850116d). Joshua Clayton (joshuaclayton) found a spec that was not appropriately named, and fixed it (0d67a42).

kumade

While kumade did not see a deploy this week, it did see some feature improvements, some of which come with an API change.

The hook for running code just before deployment was originally run_predeploy_task but is now run_pre_deploy_task (764aebe). Chad Boyd (hoverlover) made this change so he could introduce the run_post_deploy_task, which is further exposed as kumade:post_deploy to Rake (da74087, f68a487, and 9679018).

Kumade now works with more stuff: Jammit 0.6.5 (ec63310) thanks to Vesa Vänskä (vesan), and Ruby 1.9.3 (8e73b90) thanks to Gabe Berke-Williams (gabebw).

Gabe also fiddled with some source code (7e0e11e, bb695b9 and 92aa8f4).

copycopter_client

A small documentation update occured in copycopter_client by Joe Ferris (jferris), reminding us that you can leave the name of the controller or model off of the translation key only when using t from a view (6416897).

Tagged:

Comments (View)

This week in open source

Deprecations

We have officially stopped maintaining the following open source products: limerick_rake, trout, shoulda-context, and jester. Do you want to take over any of them? Let us know!

kumade

The kumade Heroku deployer now has a rake task hook for running code before the deployment (8bd2824). This was done by Joshua Clayton (joshuaclayton) in the new version: 0.8.2 (52a9348).

paul_revere

The paul_revere notification gem has this sweet button to hide a notification. Ben Orenstein (r00k) changed the duration of this hiding from one day to one year (5a773d4).

bourbon

Phil LaPier (plapier) has released version 1.3.1 of bourbon, the much-loved collection of sass mixins (e90113c). In this version we have a new syntax for animation shorthands, which means the old shorthands are deprecated (e6dcbf5, a6d3a32, 89cc340). Get it while it’s hot!

pacecar

We have a gem that generates scopes for ActiveRecord objects, named pacecar, which you would love if you also love methods that magically appear. Matt Jankowski (mjankowski) released version 1.5.3 (06b5e8e) with support for Rails 3.1.3 and 3.0.11 (dcc30d4) and which treats decimals as numeric column types, giving you all the methods that you need for those, too (ff7bc67).

paperclip

The oft-used paperclip file uploader gem hit version 2.5.0 (071c938) with a NEWS file describing the changes, written by Mike Burns (mike-burns). That’s me. I like writing about changes.

Jim Ryan (jimryan) changed paperclip to process any :original style before all others, which can be useful in case order matters (f56e863 and d3db7a1).

Nathan Hyde gave us a performance gain by only generating the file’s fingerprint if it can be persisted (9fb9255 and 4e07681).

Alexander Greim (iltempo) landed a feature on us: S3 headers can be set at runtime by passing a block as the value of the headers instead of a static hash (a83de65 and 7a8d1e6).

Steve Madsen (sjmadsen) found an edge case where if you set an attachment, save it, set a new atachment, save it, then refresh the missing styles using the rake task, it will crash. And he fixed it (dc53432).

And Jon Yurek (jyurek) finally fixed Paperclip::Attachment such that it no longer overrides the Ruby hash method with an unrelated one (3fd4c96).

factory_girl

As usual, factory_girl got way more commits than I want to read over in one sitting. For example: Simone Carletti (weppos) added a ruby version dependency to the Gemspec (e6e4d8b). He also fixed the link to our blog (11a79a0 and 30e13dd).

Things like that.

So on the feature front, Evan Larkin (elarkin) made it such that factories still work if you define a class that overrides the to_s class method (8b3ee85). Dmytrii Nagirniak (dnagir) added support for neo4j (5246fda and 591ec7a). Joshua Clayton (joshuaclayton) made it such that you can call methods that are on the object from within a factory definition (d918c1d).

More wishy-washily, Josh made a bunch of refactorings, the most important of which speeds up the whole product (f2e4138). You can read the rest of the refactorings as code with good commit messages: 2e2d490, 40242e9, 32ff41f, ac1df1d, a022dda, 1c7eab1, d9e0372, and b734b58.

The README was improved with the status of all the dependent gems (768dfaa), by Steve Richert (laserlemon). Daniel Schierbeck (dasch) fixed the formatting of sample code (1e82889).

In the end, Josh released version 2.4.0 (69957ea).

capybara-webkit

Matthew Mongeau (halogenandtoast) had fun taking in pull requests on capybara-webkit. Joe Fiorini (joefiorini) added the requested_url method that produces the URL after a pushState (7f907a0). Niklas Baumstark (niklasb) added submit and path methods (352823d, d07cf3d, 21f4b84, 83905bb, 4ceb874).

John Hume (duelinmarkers) added support for JRuby (0979db4). Pete Gieser (pgieser) fixed a double-escaping bug in URLs (fccb444).

Matthew Mongeau (halogenandtoast) fixed the link to the Capybara README (e2c103c) and linked to the mailing list (d8c640d), and Jo Liss (joliss) recommended bundle exec in more places (7fe06e9).

clearance

Our authentication system aptly named clearance got some love from Chad Pytel (cpytel) and Joe Ferris (jferris), resulting in the release of clearance 0.14.0 (5471159, 214d1dd, and 0dc43a6). The big deal is that the deny_access RSpec match and the flash messages were totally borked. They fixed it (2085f03, 23df300, and 160366e).

fake_braintree

Version 0.1.1 of fake_braintree was released, in which Gabe Berke-Williams (gabebw) fixed a bug in the failure message for the have_accessor_for matcher (9d97aa6) and also refactored everything (0a45900, 59a7b60, 3daf2aa, 0f955c6, 3e8745f, bb1f339, 6d7d90c, ac0d550, d2f470e, 3c66129, 8cf7d9c, 157b2a7, 8f21376, 29429ef, e4cef67, 9928436, 94cca24, 7bd4e20, 2dde9ed, e775167, a72e31b, 57f3623, d580024, ad82f0e, 3385e12, cacb537, ae86ebe, c6cead6, a352f33, f7a6cf5, 9f1fb3b, 124706d, ef8b13a, and b20e318).

Tagged:

Comments (View)

Not so flashy

Clearance 0.12.0 was released last week with a continued focus on better user and developer experiences.

For users

We took a hard look at small details: flashes and redirects.

We removed redundant flash messages like “Signed in.”, “Signed out.”, and “You are now signed up.” because it was visually obvious when you completed those actions.

I think we used those flashes more to follow typical Rails convention (in controllers, successes get a flash and a redirect, failures get error messages and a render template) than thoughtfulness about the value of those flashes.

When you reset your password, you used to get redirected to the sign in page with a flash message that said “You will receive an email within the next few minutes. It contains instructions for changing your password.”

We changed that to render a create.html.erb template with the same text because the sign in form is not what you want to see when you don’t know your password. We also want to make it clear that you have to leave the app to continue.

These changes became more obvious as we started to use sexy CSS3 flashes, which displays the flash for a few seconds, then hides itself without breaking a layout.

For developers

Clearance now works with Rails 3.1 release candidates. We know it works because we use Appraisal to test against these versions of Rails:

appraise "3.0.9" do
  gem "rails", "3.0.9"
end

appraise "3.1.0.rc4" do
  gem "rails", "3.1.0.rc4"
  gem 'sass-rails'
  gem 'coffee-script'
  gem 'uglifier'
  gem 'jquery-rails'
  gem 'turn'
end

We simplified the Cucumber features so that you don’t have to type a password at all. I hated writing steps like:

Given I am signed up as "email@example.com/password"

Then, having to reference them later like:

When I sign in as "email@example.com/password"

We defaulted the factories so they always create users with password of “password” so now the features are less noisy:

Given I am signed up as "email@example.com"
When I sign in as "email@example.com"

Lastly, there’s a legit deny_access matcher. Since the earliest versions of Clearance, there was an old-style “Shoulda macro”, which has fallen out of favor in place of matchers. This Clearance matcher only depends on Ruby and “should” work with any test framework like RSpec or Test::Unit.

Happy coding.