Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Monthly Archives: September 2012

JT Archie

[Standup][NYC] 09.24.2012 Moral support for the pub and sub

JT Archie
Monday, September 24, 2012

Interestings

ActiveSupport::Notifications implements Pub/Sub

iOS6 Safari Caching POSTs

Workarounds needed until bug is fixed.

http://arstechnica.com/apple/2012/09/developers-claim-safari-in-ios-6-breaks-web-apps-with-aggressive-caching/

Events

Tuesday: NYC.rb Hackfest

Tuesday: Brown bag on ThreeJS (WebGL)

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Tyler Schultz

[Standup][SF] 09/21/12: Get older faster

Tyler Schultz
Friday, September 21, 2012

Interestings

  • Timecop#lens

We just made this pull request to Timecop:

“Add Timecop#lens where time can go FASTER”

Create a new mock_type, :lens which will let time continue, like :travel, but the first argument is a scaling factor which will make time move at an accelerated pace.

https://github.com/jtrupiano/timecop/pull/42

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Desmond Bowe

Avoid using fixture_file_upload with FactoryGirl and Paperclip

Desmond Bowe
Friday, September 21, 2012

Joe Moore and I are using FactoryGirl and Paperclip for file attachments. The factory for building our Attachment model looked like this:

 factory :attachment do
   supporting_documentation { fixture_file_upload('test.pdf', 'application/pdf') }
   # ...
 end

Yesterday our test suite began raising the following error:

 Failure/Error: let(:attachment) { FactoryGirl.create(:attachment) }
 Errno::EMFILE:
   Too many open files - /var/folders/3q/_15370v96jlbnxsk3whsks5c0000gn/T/test20120920-4004-7c2o9y.pdf

It turns out that Rails’ fixture_file_upload method does not close the temporary file it creates. We found a suggestion to prevent leaking file handles by adding an after_create block that manually closes the file. We tested this fix by looping through the model spec 1000 times. More tests passed, but it eventually blew up with the same error.

Using fixture_file_upload needlessly exercises Paperclip’s file uploading functionality instead of just creating the models we care about for our application. Instead, explicitly set the attributes Paperclip needs:

 factory :attachment do
   supporting_documentation_file_name { 'test.pdf' }
   supporting_documentation_content_type { 'application/pdf' }
   supporting_documentation_file_size { 1024 }
   # ...
 end

…and all of our tests passed.

Conclusion: in model factories, set the Paperclip attributes directly and don’t use fixture_file_upload.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Tyler Schultz

Ah, ah, ah. Now, that was silly. Wouldn’t you agree, my bats? Ah, ah, ah.

Tyler Schultz
Thursday, September 20, 2012

Helps

  • Slow count after delete_all of millions of records?
  • font icons, Ajax, and IE8

Our application is using Font-Awesome to display some of our icons. One of our modals that has its content loaded via Ajax is rendered in IE8 without any of these icons visible. Clicking any element that contains these icons will make them instantly appear.

Is there a known issue with IE8 not properly applying CSS :before rules to content fetched with Ajax? Or could it be a known issue with how it handles fonts? Any ideas?

Events

  • Ember.js talk @ Zendesk – Tuesday 6:00pm

http://www.eventbrite.com/event/4213815636/efbnen

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Tyler Schultz

[SF][Standup] 09/19/12: ActiveAdmin vs. RailsAdmin… Arrrggg!

Tyler Schultz
Wednesday, September 19, 2012

Interestings

  • ActiveAdmin after_save

If you are using ActiveAdmin, beware that the after_save callback gets fired both when the model gets saved, and when there are validation errors on the model.

It really behaves like a callback after the model save method gets called, regardless of its return value.

  • Testing RailsAdmin custom actions

Let’s say you’re writing a RailsAdmin custom action, and you want to test it with a request spec.

If the test passes when guard is on, but fails when guard is off, then you’ve forgotten that the RailsAdmin initializer does not run when loading a rake task. It does run as part of bundle exec guard start.

This is a performance ‘optimization’ that RailsAdmin adds.

To turn it back on, so you can test custom actions:

task :default => [:load_rails_admin_initializer]
task :load_rails_admin_initializer do
ENV['SKIP_RAILS_ADMIN_INITIALIZER'] = ‘false’
end

  • International Talk Like a Pirate Day!

Arrrgggggg me mateys! To your pairs you scabrous dogs!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Will Read

Experience Report: Engine Usage That Didn’t Work

Will Read
Sunday, September 16, 2012

On the project I’m currently working on we have a main portal that provides a user registration system and a generic billing mechanism. It also has several sub applications which need to know some information about the user and be able to publish billing events. With a fairly easy to articulate boundary, we thought it might make sense to be deliberate in how we organized our code – we came up with three main solutions:

  1. One big app, just use namespaces
  2. Create the portal and expose API endpoints over HTTP to get user data and set billing data.
  3. Create the portal, and have each sub application contained in a Rails Mountable Engine.

Our Boulder office had been making some noise about Rails Mountable Engines for some time, gave a presentation in the SF office, and I had experience working with engines both in the dark times of engines in Rails 2.x and the markedly improved days of Rails 3.x, and even better still in 3.1+. We had need to scale one sub-component of one of the applications independently, but not entire apps as the primary usage of the system would be low-volume. We set off down the engines path…

It worked pretty well. Two months in to the project we had a retrospective specifically about how engines were working. We agreed that we had felt some pain, but overall they drove out interesting decoupling and that the cost to pull them out could potentially outweigh the little pain we might encounter in the future.

Then our team size doubled. We had multiple epics that had high priority and deadlines associated with them. We also needed to ramp up four new people which led me to reassess our choice of engines once again, not to mention that we eventually will be handing over the code to developers who haven’t seen much Rails.

The conclusion I came to was that engines had to go. Here’s the list of why:

  • Asset pipeline already feels magical, with engines you have to think even harder about what you’re doing and what to include in your application.js or application.scss.
  • Testing. Writing an RSpec request spec didn’t make sense in the engines where certain styles were expected, or a specific layout – we found ourselves stubbing out a whole lot, or putting more and more into a gem that contained shared code between the portal and the engines.
  • Running Tests – We had to have multiple instances of RubyMine open to get the correct load paths for the engine and the portal, constantly trying to remember “Is this in the shared gem, or in the engine?” or “Oh wait, this is specific to the engine, but it is a request spec so we need to go back to the portal to re-run that” was not unsolvable, but felt like a tax on our choice every time I fumbled.
  • Migrations everywhere – You write the migration in the engine, then it has to be copied to the dummy app for testing, and also back up to the main app for running request specs, now you have three copies of the same migration, all with different timestamps. Not fun when you realize you also needed to change that string column to a text column.
  • Everything still had to be namespaced anyway for the engines so we had the folder explosion we were trying to avoid from the One Big App solution.
  • Confidence – It got to the point where I found myself asking “Is this broken because I wrote it wrong, or because there’s something I misunderstood about engines?”. I could never be sure of why something had gone wrong.
  • Documentation – Rails Mountable Engines documentation is a small subset of the knowledge available on StackOverflow for example. If we want to make the ramp up and handoff as smooth as possible, we want to do the most vanilla thing possible so that things are intuitive or at least Googleable.

None of this was impossible, or even difficult to solve. It’s just that it wasn’t intuitive, not what a well seasoned Rails developer was expecting out of the box. It would have been a waste of our client’s time to bring a whole new team up to speed on all that we had learned about engines, rather than having one big application.

This is especially true since the only semi-real-payoff was that it made us isolate our sub-application code from the portal code. I say “semi-real” because the boundary was artificial – the reality was that the sub applications needed to know about the user and his account, and anything we built out for billing was really a dependency of each of the apps. This was different from a great engine like rails_admin that really is a drop in and has no domain-specific dependencies. Here we had nothing but domain-specific dependencies and now, by removing engines, our code and our domain are back where they belong: together.

  • UPDATE *
    Engines really are great and there’s lots of situations where they can be really powerful. Boulder Pivot, Stephan Hagemann, had these additional tips that I wanted to share with you.

  • Regarding RubyMine and running specs: there is a simple way to make RubyMine run all specs in all engines. It will make all engines modules with their own “RubMine root”, which fixes spec runs. http://pivotallabs.com/users/shagemann/blog/articles/2008-intellij-modules-in-rubymine-

  • Regarding migration duplication: You can have an engine or app that requires others run their migrations. Check out the migrations run by the main app in this sample app: https://github.com/shageman/the_next_big_thing

  • Regarding testing: If an engine is relying on some layout or style to be around, it should depend on it and include it (potentially by way of another engine).

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Matthew Parker

Preparing for LicenseFinder 1.0

Matthew Parker
Friday, September 14, 2012

I worked with Ian Lesperance and Paul Meskers this week preparing LicenseFinder for its 1.0.0 release. In addition to performing some much needed refactoring on the codebase, we also added the following new features:

  • Support for more license types (we now detect Apache2, BSD, New BSD, Simplified BSD, MIT, LGPL, ISC, Ruby, and GPLv2).
  • A new HTML report with tons of useful information for your non-technical product owners (including links to license text, color coding of approved v. unapproved dependencies, listing the parent/children dependencies of gems).
  • A simplified text report (also suitable for non-tech product owners)
  • A simplified command-line interface (there’s now just a single command license_finder, though we still offer an equivalent rake task (rake license_finder) if you want to use it for a CI build)
  • A completely rewritten README with clear usage instructions
  • An cucumber integration test suite that outlines all of the license finder features
  • Continuous integration via travis-ci.org

While developing the integration test suite, we had the need to shell out and run bundle outside the context of the license finder bundle. It turns out that in order to do this, you have to wrap your system calls inside a block passed to Bundler.with_clean_env:

  Bundler.with_clean_env do
    `cd somewhere && bundle`
  end

If you ever find yourself bootstrapping applications from a ruby script that you need to bundle, keep this little-documented bundler feature in mind.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Ash Hogan

Case Commons is looking for a DevOps Engineer

Ash Hogan
Friday, September 14, 2012

At Pivotal Labs, one of the services we provide our clients is helping them interview and hire. Pivotal Labs and our clients place a strong emphasis on Agile development and its many aspects: Pair Programming, Test-Driven Development, rapid iterations, and frequent refactoring.

Below is the job description for a DevOps engineer with Case Commons. Case Commons’ mission is to transform public sector human services through user-centered design & technology. They’re pursuing this vision through the development of Casebook – the first collaborative, family-centered case management system for child welfare, enabling workers serving the most vulnerable families and children to be more effective and efficient via new web-based software tools.

Case Commons is hiring – here’s why you want to work there:

DevOps Engineer at Case Commons

Our product positively impacts lives

We want to help kids who are at risk. We also want to help the people who are trying to help those kids. We accomplish these goals through web-based, user-centered software via our product, Casebook.

Help us solve real problems

This is not your average informational or e-commerce Ruby on Rails application. It is a distinctive application with deep workflows, intricate modeling and statistical analysis. We’re as Agile as they come. Our platform is written utilizing 100% Open Source frameworks and tools.

What you will do

  • Maintain the health, stability and security of our growing production cluster
  • Produce, enhance and execute our deployment automated scripts
  • Install, upgrade and augment server and application monitoring
  • Work in concert with the development teams to troubleshoot production issues
  • Collaborate with development and QA to tune our production cluster
  • Maintain the health and stability of our continuous Integration cluster

What you will enjoy

  • Pair programming
  • Pair with Pivots (Pivotal Labs is our partner)
  • Agile work environment
  • Working on one of the largest Ruby on Rails applications in the world (seriously!)
  • Daily catered breakfast
  • Stocked beer fridge as well as micro-brew from our own aficionados
  • Full kitchen
  • Ping pong and other work/life balance tools
  • Brown bag presentations
  • Open work environment, shoes optional
  • Opportunity to creatively solve difficult problems
  • Union Square location
  • Full benefits package, 401k matching, 20 vacation days, 11 company holidays, 4 personal days, 5 sick days
  • The opportunity to work on a product that will transform lives
  • Not only work on cutting-edge and innovative technology but feel good about what we’re doing as a company (food for the soul)

What you will have

  • Bachelor’s degree (or equivalent work experience)
  • Minimum of 3+ years experience in Systems Administration or 2+ years in DevOps
  • Software deployment experience
  • Strong Linux/Unix system administration
  • Chef
  • Capistrano
  • Ruby
  • Rails
  • Git
  • PostgreSQL and replication strategies
  • Resque
  • Strong Network Administration
  • HA-Proxy
  • NGINX
  • Unicorn
  • HA-NFS and replication strategies
  • Fundamental understanding of cryptography and security best practices
  • M/Monit

To be considered, please click here.
www.casecommons.org

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Jonathan Berger

Fixing broken keyboard shortcuts in Adobe Illustrator

Jonathan Berger
Friday, September 14, 2012

Keyboard commands are essential to using Adobe applications like Illustrator or Photoshop. Unfortunately, some of the most important, cross-application commands occasionally break —the ones that are the most ingrained, because they work the same way in Photoshop, Illustrator, and other apps. I’m looking at you, hold-the-space-bar-to-get-the-Hand-tool, and you command-and-space-to-Zoom-in, and yes you, command-option-space-to-Zoom-Out. They break randomly, with no explanation and no warning, and it’s as if someone pried the ‘e’ key off your typewriter: sure, you can write a novel), but it’s pretty inconvenient.

Every time these keyboard commands break I curse for a bit and then google around to try to find the solution. Support boards show similar complaints, but no definitive solutions. Wishful, cargo-culty suggestions abound including “reset your preferences”, “restart”, “quit Chrome”, “no—quite FireFox!”, some of which work occasionally, but none of which work for everyone.

I think I found the answer.

It’s not the app that’s broken; it’s the document. Try creating a new document. (You may need to restart Illustrator or your whole machine).

I believe the keybindings break because the .ai file is corrupted. When I noticed that keyboard shortcuts were working on one file but not another, I junked the broken file (try reverting from a backup or copy-and-pasting your work into a new file) and was able to use my keyboard shortcuts again. I’m not sure how the file gets corrupted, but this is a start.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Desmond Bowe

Friday Hugs!

Desmond Bowe
Friday, September 14, 2012

Events

  • Saturday: NYC PyLadies Meetup- 8PM

http://www.meetup.com/NYC-PyLadies/

A group for Python ladies of all levels of programming experience, in the NYC metro area.

Pyladies is an international mentorship group with a focus on helping more women become active participants and leaders in the Python open-source community. Our mission is to promote, educate and advance a diverse Python community through outreach, education, conferences, events and social gatherings.

PyLadies also aims to provide a friendly support network for women and a bridge to the larger Python world. Anyone with an interest in Python is encouraged to participate!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (780)
  • rails (113)
  • testing (88)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (55)
  • techtalk (44)
  • rspec (38)
  • ironblogger (32)
  • productivity (30)
  • activerecord (29)
  • gogaruco (29)
  • git (28)
  • nyc (27)
  • rubymine (26)
  • bloggerdome (23)
  • mobile (22)
  • process (21)
  • pivotal tracker (20)
  • cucumber (20)
  • jasmine (19)
  • design (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • css (13)
  • tdd (13)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • api (10)
Subscribe to Community Feed
  1. ←
  2. 1
  3. 2
  4. 3
  5. 4
  6. 5
  7. 6
  8. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >