Ben Orenstein is joined this week by Joe Ferris, CTO of thoughtbot. Ben and Joe discuss starting a new Rails project and our Rails application generator, Suspenders, test spies and breaking up your tests, and using Rails beta versions.
High Voltage is a Rails engine for static pages.
You can now use it with Rails 4 thanks to Arvid Andersson (arvida) in 176895f.
Capybara Webkit is a Capybara driver for headless WebKit so you can test Javascript web apps.
You can expect fewer bugs in it thanks to Matthew Horan (mhoran) in 7289a8e and f20d32d.
You can use it with Qt 4.8 thanks to Matthew and Joe Ferris (jferris) in 67b8a33, cbb58d0, f95e4eb, ecfa783, e9a4b77, and e531c1a, and cae5119.
You can expect nodes hidden with css rule visibility: hidden to correctly return false on visible? thanks to Timur Vafin (timurvafin) in
3bab97d.
Dotfiles are a set of Vim, zsh, git, and tmux configuration files.
You can now tab complete in Vim even faster thanks to Dan Croak in c7efed4.
You can do some awesome git things in Vim thanks to fugitive.vim in d836af8:
:Gblame for interactive vertical split with git blame output.:Ggrep to search the work tree (or any arbitrary commit) with git grep.:Glog to load all previous revisions of a file into the quickfix list so you can iterate over them and watch the file evolve.:Gbrowse to open the current file on GitHub, with optional line range (try it in visual mode) .You can safely ignore certain files in git repositories machine-wide thanks to Dan in 0060e0a.
You also now have a clear strategy for managing files with personal information like ~/.gitconfig in a shared dotfiles repo thanks to Joe and Dan in 52b2ee1.
Bourbon is a lightweight mixin library for Sass.
You can now optionally use Rails’ asset pipeline in the font-face mixin thanks to Phil LaPier (plapier) in f93cf9e.
Suspenders is a CLI for creating Rails apps with thoughtbot defaults.
When you use Suspenders-generated Rails apps, you’ll now automatically track your slowest-running specs thanks to Dan Croak (croaky) in 69c7fdd.
You will also automatically track your test coverage thanks to Joe Ferris (jferris) in 2787281 44c51c1.
The validity of your factories will always be tested first thanks to Dan in 52444eb.
Your Ruby version will be determined by your Gemfile thanks to Dan in 389ceda.
You will bundle using binstubs and the 37signals’ bin/stubs directory convention thanks to Dan in 4b7e40a.
You can format time through localization thanks to Dan in fbf3fcd.
Your Postgres database will automatically be configured to encode using UTF-8 thanks to Yi-Ting Cheng (xdite) in c2c46a7.
You can use these new features in Suspenders version 1.1.5.
Factory Girl is a library for setting up Ruby objects as test data.
You can now use a block with build_list and create_list so you can call methods on each instance of the array thanks to bbugh in 488e42d.
Bourne adds test spies to mocha.
You can now see the master Travis CI build thanks to Harlow Ward (harlow) in 74dd8f4.
Paul Revere is a library for “one off” announcements in Rails apps.
Support for Rails 2 apps will be dropped in Paul Revere versions greater than 1.1 thanks to Gabe Berke-Williams (gabebw) in e8ae883.
Lots of activity on trail-map this week. Thanks to Mike Munroe (mikepmunroe) for catching a broken link 1025a32. Adarsh Pandit (adarshpandit) added a Code Review trail e46792c and Gareth Rees (garethrees) added links for different style guides 4cf0643 47b6002. We had help from Dan Croak (croaky), who fixed some bad links d82a944 889aee8, a grammatical error 13e1335, copy-editing 6d2402c, and removed the .gitignore f2f147a.
shoulda-matchers got some refactoring from Gabe
Berke-Williams (gabebw)
7f208e7 and
Jason Draper (drapergeek) tightened up ensure_inclusion_of for array matching dc5daca.
cocaine got some help from Jon Yurek (jyurek) including removing official support for REE 6073cd0 and switching the order of pipe-reading and waiting 69d6b6c.
In paperclip, Jon Yurek
(jyurek) removed some ternary operators in favor of ifs
65f4941,
and added a test to prevent regression of the E2BIG problem 69bcf6e.
Phil Cohen
(phlipper)
added MiniTest syntax methods to the GETTING_STARTED.md page for factory_girl in 06ff258.
neat got some help from Reda Lemeden
(kaishin) including a fix for breakpoint values in the README
120ce1b and support for using both min- and max- in breakpoint() 9292467.
Our dotfiles are now more tmux compatible thanks to Joshua Clayton
(joshuaclayton) who added tab-completion to ack using the tags file
d16a4fe and
Dan Croak (croaky) who enabled better pbcopy/pbpaste and RubyMotion compatibility by using reattach-to-user-namespace in
3ef63fe.
Dan Croak
(croaky) tightened up our suspenders by replacing the style guide (most of the README file, really) with links to guides
c912961, ignoring the .env file
58c22ff, and alphabetizing the .gitignore file
884eb08.
In high_voltage, Mike Burns (mike-burns) extracted an overridable PageFinder class 8494e51 and removed the ActionMailer usage 6eee9b0. Odin Dutton (twe4ked) and Mike Burns added a config option to disable default routes 7570889.
fake_braintree was bumped to version 0.2.1 by Dan Croak (croaky) 44f62b7.
In bourbon Mike Burns (mike-burns) added command parsing using Thor ac3b318.
Our laptop script got the same reattach-to-user-namespace help from Dan Croak (croaky) as he added to the dotfiles 50a1a1e.
Is there a bundle command to tell me what would be updated with bundle update, without actually making those updates?
As it turns out there is! Bundler 1.1 introduces a new command:
bundle outdated
Show all of the outdated gems in the current bundle.
This will give you a report of gems that have newer versions available.
By itself, this will list all of the gems in your Gemfile.lock that have newer versions, and what the current and latest versions are.
This gives a good preview of what you are up against if you want to get your gems up to date. From there, use git commits to make incremental changes.
Today I created an app with the suspenders gem, and noticed it is running on Rails 3.1.1, which I wanted to upgrade to 3.2.2.
I also saw a few other gems with version attributes:
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
gem 'rspec-rails', '~> 2.6.1'
gem 'cucumber-rails', '1.1.0'
gem 'capybara-webkit', '~> 0.7.1'
First I ran rake to confirm all tests were passing, bundle update to make sure the gems were all up to date with the versions specified, and created an initial commit.
Next I upgraded to rails 3.2.2 and reran bundle update, and found out (after a couple itterations) that sass-rails and coffee-rails had to be updated too, because of there dependance on ActiveSomethingOrOther. Updating these three gems to their latest versions allowed bundle update to do it’s thing.
I reran my tests, and did ran git diff Gemfile.lock to see exactly what was new. For giggles I reran bundle outdated and rejoiced at the shrinking list. Time to commit with a message about the gem version changes.
From here it was rinse and repeat, checking rubygems.org and looking at the dependencies, making small changes, bundling, raking, committing.
At the end of the road I had a good series of commits spelling out exactly what was needed to get to my goal of a fully updated rails 3.2.2 environment.
If you run bundleoutdated and all you see is:
Outdated gems included in the bundle:
* sprockets (2.4.0 > 2.1.2)
Then you are doing it right!
Read more about what’s new with bundler 1.1 from Pat Shaughnessy.
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).
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).
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).
Due to my complaining last week, the bourne gem now has a NEWS file (8dfb077), thanks to Gabe Berke-Williams (gabebw).
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.
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).
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).
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).