giant robots smashing into other giant robots

Written by thoughtbot

calebjthompson

It’s for the orphans!

Too often, I come across GitHub Pages branches (gh-pages) branches that are simply forks from the master branch of the repository. This is not ideal.

Commit History showing Merge master into gh-pages on GitHub

There are several problems with this strategy:

  • Unless you manually update the gh-pages branch every time you add a commit to master, you will be out of date.
  • It makes for a much more difficult to understand source folder for the jekyll or HTML site, since people have to mentally categorize every file and folder into either “part of the site” or “an artifact from the master branch”.
  • It introduces the need to have lines like this in _config.yml to prevent unrelated files from being included in the gh-pages site:

    exclude: ./app, ./lib, ./project.gemspec, ./Gemfile, ./LICENSE, ./Rakefile, ./readme.md, ./features, ./spec

Little Orphan Annie

git checkout --orphan gh-pages

When it comes time to create a GitHub Page for your project, use the above command. This creates a branch that is completely separate from the history of the rest of the repository. You will need to delete the files by running “git rm -rf .”:

If you want to start a disconnected history that records a set of paths
that is totally different from the one of <start_point>, then you                                                           
should clear the index and the working tree right after creating the 
orphan branch by running "git rm -rf ." from the top level of the 
working tree. Afterwards you will be ready to prepare your new files,
repopulating the working tree, by copying them from elsewhere,
extracting a tarball, etc.

git checkout --help

After you have an empty branch, you’re ready to get started on your jekyll or HTML site with a clean history and a clear conscience.

Written by

Episode 38: Standing out from the pack

This week Ben Orenstein is joined by Jeremy McAnally, employee at GitHub, author of Ruby in Practice, Rails 3 Upgrade Handbook, MacRuby in Action, and more. Jeremy and Ben discuss teaching and organizing conferences, remote working for GitHub, the and the company summits, GitHub workflows, their internal tools team. They also talk about standing out from the pack in work, life, and getting accepted to conferences, selecting people to speak at conferences, self-publishing, Jeremy’s writing process and future writing plans, work-life balance, how to get a job at GitHub, and much more.

lolconomy

This week in open source

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, 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) was releasing 0.3.2 (40690ae) he also made sure to document the --heroku and --clearance flags (02a8bb0). Gabe Berke-Williams (gabebw) added a missing bundler/setup to the Rakefile, tying everything together neatly (d09ee5b).

shoulda-matchers, shoulda, high_voltage, bourne, pacecar, flutie, shoulda-context, factory_girl-rails

Above I mentioned how Gabe Berke-Williams (gabebw) added bundler/setup to the Rakefile of suspenders. He also did it to shoulda-matchers (9d79124), shoulda (8054563), high_voltage (ec656e1), bourne (9d21677), flutie (7863d14), shoulda-context (75a8384), factory_girl_rails (797a985), and pacecar of all things (fb972c0).

Wild.

bourbon

Version 1.2.0 of bourbon is out, bringing more Sass mixins into your life. Phil LaPier (plapier) added support for the CSS3 appearance (e888e0a) and background-size (4588c5c) properties, and added $georgia, $helvetica, $lucida-grande, and $verdana variables (4ba1cff). He also updated the docs to reflect this (d23064b), cleaned up some warnings (99946bb), and made the release (93beb25).

paperclip

The past two weeks saw an improvement for gem authors in paperclip: Mike Burns (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).

Prem Sichanugrist (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).

factory_girl

In the past two weeks factory_girl has seen three releases: 2.3.0 (85d4735, 2fdabdb, and 89b9a82), 2.3.1 (e15ae8d), and 2.3.2 (17eacf0). Joshua Clayton (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 (1eb7e1b and 65e5e25). Also, traits can be added to factories dynamically, when creating an object (442ba18). For example, if you have an :admin trait you can make an admin user on the fly with FactoryGirl.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, f47c03c, and d3a7b7e), cleaning up the require statements (9472a14), consolidating and documenting all exceptions in the FactoryGirl class (c46c090), handling nil blocks when running a factory (2bf5cea) and when creating it in general (86f971b), delaying the sorting of attributes until the last minute by using a lighter-weight array instead of hash (d563b94), making bold claims about inheritance that some blog post authors disagree with (557cce6), moving Proxy::Stub#next_id into the private namespace (0c31b6e), taking an ignored argument to a block so some versions of Ruby don’t complain (c93dea5), defaulting the creation method to save instead of nil (5bbbcb9), singularizing Attribute#aliases_for? into Attribute#alias_for? (f247968), using his beloved Null Object pattern to reduce some conditionals (fba404a and b339c8f), adding a common #to_proc method across all attributes and then invoking methods with #[] instead of #call (fba6f33 and 3282eea), straight-up removing dead code from the AttributeList (56a6f67), and passing overrides through to the runner class (5fc57da).

Gotta break a lot of eggs to make an omelette. Speaking of, Gabe found a broken version.rb and fixed it (1e47af0).

clearance

Another doc week for clearance where Gabe Berke-Williams (gabebw) observed that we test it against Rails 3.1.0 (f7c5e3b) and Matthew Burket (Mab879) noted that you must migrate the database before running rake, when testing (39a6ac5 and 8b9e89b).

fake_braintree

New features in our Braintree fake object, appropriately named fake_braintree! Gabe Berke-Williams (gabebw) added support for FakeBraintree.generated_transaction (d1bbcb7, 917a235, 4fc470d, and 4cb5cb0), Braintree::Subscription.update (fab3c92), and Braintree::Customer.delete (c2aa516). Joe Ferris (jferris) started work on add-ons (312cfac).

Gabe also did some lovely documenting; now you can learn about how to use this in Cucumber (c163c4d), how to avoid calling FakeBraintree.activate (dff3e51), whether the build is broken (499cb05 and 1b1a532), and what the difference is between declining and verifying a card (625993a). Additionally the Subscription class was refactored (3ed090e), the tests were made more explicit (a23a61c), and the tests pass (0a12182).

cpytel

Introducing Trajectory GitHub Integration

Today I’m pleased to announce the availability of one of our most requested Trajectory features, GitHub integration.

We’ve never really used the GitHub integration in any of the previous tracking/planning software we used because it’s so hard to use it consistently and well. When we set out to implement GitHub integration we set the bar high by insisting that it be something we would actually use. I believe we have done that with a new feature that I don’t believe has ever been done before for GitHub integration.

Now, when you start a story, Trajectory will indicate an auto-generated feature branch name (you can change the branch name, if you want). Any commits against this branch in GitHub will automatically be associated with the story. There is no need to include the story URL in the commit message, unless you are issuing a command to Trajectory (such as to Finish the story).

This functionality solves a real problem with the integration with GitHub while embracing the way many of you are probably already working with feature branches in your repos.

In addition to the feature branch integration, you can also include a link to stories in individual commit messages. When you do this, Trajectory will associate the commit to the story. Finally, you can issue commands to Finish a story in Trajectory from your commit.

You can read more specifics about this new functionality on our support site. If you’re already using Trajectory, go ahead and give it a try. If you’re not using Trajectory, sign up for a free trial and give it a try. You can even get started quickly by importing your Pivotal Tracker projects.

hyperbuddha

Last Week In Open Source

Mike Burns, the usual author of this post, was out last week so I’m filling in. Sorry it’s a little late. As usual we had a ton of activity around our open source projects.

Paperclip

Paperclip, our popular gem for image attachments, got a few bug fixes. Jeff Dutil (jdutil) changed the travis-ci build image to use https so that Github wouldn’t cache it (c0c9b69) meanwhile, David Faber (faber) fixed a bug with the :fog_public attachment option. Evgeniy Dolzhenko (dolzenko) pointed out a typo in one of the matchers (9f38928). To top it off our own Prem Sichanugrist (sikachu) configured Travis CI to test against REE (ab7db5a).

Factory Girl

Factory Girl, the gem that provides factories for readable tests, got a ton of love this week.  Jeff Dutil (jdutil) fixed the travis-ci images yet again (40d08ee). Our own Josh Clayton (joshuaclayton) and Thomas Walpole (twalpole) colaborated to add traits. Josh pushed out a new release too. Read the blog post or look at the commits to find out more. Ken Collins (metaskills) fixed a bug with the way overrides dealt with attribute definition order (4b83b1e). Thomas also fixed another attribute related bug (2ccbf45). Josh also fixed some issues with dynamic attributes of file attributes (8012d3d). Josh also bumped the version to 2.0.4 (be14aa) and replaced rr with mocha for mocks (554e6ab).

Capybara-Webkit

Cappybara-Webkit, the headless browser that runs your tests at lightning speed, got a few bug fixes too. Joe Ferris (jferris) disabled custom fonts to prevent crashing on OS X (82ae0c2). 

Paul Revere

Paul Revere, the gem that lets you easily add one off announcements to rails apps, got some documentation love this week from Matt Jankowski (mjankowski) He added usage documentation (810f6aaf09b757) and fixed some existing documentation (2758eb1).

Bourbon

The fabulous vanilla sass mixins gem got some care from thoughtbot’s Phil Lapier (plapier). He changed the file extensions from .css.scss to .scss (2465a17) and released version 0.1.4 (920785d).

Kumade

Lots of changes in Kumade! It now uses a deploy branch for committing assets (2e11258), which means that those ugly Jammit compilation commits for Heroku don’t show up in your github repo. It no longer requires the deploy subcommand, so you can just do kumade staging instead of kumade deploy staging. It no longer detects the Cedar stack by default (bce4682), since heroku stacks requires permissions that you may not have, even if you can push to it. Instead, use the “-c” flag to indicate that your app uses the cedar stack. And just today, it got better integration tests (39fd463, f5902ae, 657f63d). None of these changes are released in a gem yet, but you can get it via git: gem "kumade", :git => "git://github.com/thoughtbot/kumade.git".

Laptop

Last but not least is Laptop, thoughtbot’s one stop shop for setting up a development environment. thoughtbot’s Dan Croak (croaky) changed the readme to recommend a standalone install of GCC instead of xcode (38d2458). He also added tmux (531645d) and updated the default ruby from 1.9 to 1.9.2 (a29cbe7). John Deerhake (jdeerhake) chipped in with a fix for ack on ubuntu (557736b).

Want to see your name on this list? Fork one of our projects and submit a pull request (with tests).