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: April 2011

Pivotal Labs

Standup April 18th – Keeping fixtures fresh and Regex's encoded

Pivotal Labs
Monday, April 18, 2011

Help!

Jasmine fixtures
A Pivot was bothered by the occasionally stale state of Jasmine .html fixtures. If you’re following a workflow similar to the recent Jasmine Railscast then your fixture files will undoubtable deviate from the ‘reality’ of your application. JB posted a solution that address the issue of quickly generating and loading .html fixture files, but this Pivot’s concern was having to manually kick off that process. It seems like watchr would be a good tool to monitor app/views and call one’s fixture generation process.

encoding of regular expressions in 1.9
Executing regular expressions over input of unknown encodings has caused headaches for people using Ruby 1.9. When the encoding of the regex and input differ Ruby throws an Encoding::CompatibilityError. The only solution we’ve seen is to change the encoding of either the input or expression to match the other, as seen here.

Does anyone know of a double ledger accounting gem?

crickets

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Dan Podsedly

New in Pivotal Tracker: Expanding text fields, multiple file and drag/drop file uploads

Dan Podsedly
Sunday, April 17, 2011

We’ve made a few usability improvements to Pivotal Tracker related to viewing and editing of stories, as well as file attachment handling.

All of the story text fields now automatically expand based on the amount of text entered, and they’ll grow as you type. When you expand a story, you’ll now see the entire story title in one glance, even when it’s long. Text fields for story description, comments, and tasks expand as well.

Working with file attachments got a bit easier, too. It now takes fewer clicks to attach a file, and you can upload multiple files at once. In browsers that support it, you can drag files on to the story directly from your desktop. Finally, there’s now a ‘download’ link next to each file attachment, for easier access to the original file.

These are just the first few of a number of usability improvements. Much more is on the way!

As always, we appreciate your feedback. Let us know what you think in the comments here, or by email to tracker@pivotallabs.com.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Glenn Jahnke

Standup 2011.04.14 – Bustin' Caches, Pow, and Trajectory

Glenn Jahnke
Thursday, April 14, 2011

Helps

Busting JS Caches Better

How do I bust Javascript caches better? Changing the url params doesn’t always work?

The most consistent way to bust Javascript caches is to change the path to it. Sometimes transparent proxies and some browsers won’t be busted otherwise.

Busting Chrome JS Cache when running Jasmine Fixtures

Chrome is cache Jasmine fixtures and Firefox is just too slow.

No great solution. Chrome typically runs tests so fast that just mashing the refresh until your test output changes seems to work for some.

Interestings

Trajectory

Trajectory is a new product out by Thoughtbot which has been described as a cross between Tracker and Basecamp.

Pow

37Signals has come out with a native Mac app called POW. Here’s a snippet from the Readme:

Pow is a zero-configuration Rack server for Mac OS X. It makes developing Rails and Rack applications as frictionless as possible. You can install it in ten seconds and have your first app up and running in under a minute. No mucking around with /etc/hosts, no compiling Apache modules, no editing configuration files or installing preference panes. And running multiple apps with multiple versions of Ruby is trivial.

A fellow Pivot also mentioned that it makes running multiple apps on the same port, and having sub-domains easier.

Firefox cacheing

There is an option in Firefox to remember the last opened tabs so when you return to your browser, it will restore your last viewed websites.

This has the unfortunate side-effect of not deleting cookies despite the opposing setting for deleting all cookies upon session exit.

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

Standup 4/13/11 – a ruby injection vulnerability?

Matthew Kocher
Wednesday, April 13, 2011

Ask for Help

*Is sunspot vulnerable to a ruby injection attack?
Sunspot requests ruby as an output format from solr, and evals the response. One project is seeing invalid unicode being passed to solr and coming back in the response, causing the eval error on the invalid characters. The consensus was that it probably wasn’t exploitable, but is unfortunate.

  • Is there a way to put Jasmine in the test group without it causing errors on production?

This has gotten better in rails 3 but the fix has caused problems in rails 2 apps. For now you can install in every group or catch the exception when it tries to load it in production.

Interesting Things

  • You can pass an array as the value of the :join parameter in ActiveRecord finders. This lets your write clearer code instead of having one long string with multiple joins.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Glenn Jahnke

Standup 2011.04.12: Tweeting Standup and RSpec

Glenn Jahnke
Tuesday, April 12, 2011

Interestings

It was suggested that we should Tweet our standups as well as post them to our blog.

Helps

What is the overhead of an RSpec “it” block?

People seem to think the overhead is really negligible compared to Rails load time or making any DB calls whatsoever. People have seen whole codebases moved from TestUnit to RSpec with no notable speed slow-down.

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

Standup 4/11/11 – Rubygems & Things you shouldn't try

Matthew Kocher
Monday, April 11, 2011

Help

  • Is anyone getting corrupt or empty gems from rubygems?

Yes. It’s not clear what causes it, but it’s been seen. The best work around is to have bundler cache the gems in the project.

Interesting Things

  • You can define a method in ruby called return. You can send :return to an object with return defined as a function, and it will call the method. You can’t call the method normally. None of this is a good idea.
  • RVM can use most any version of rubygems you might need. just rvm rubygems 1.5.2 to get 1.5.2, for instance. Some gems are incompatible with new versions of rubygems, so this can come in handy.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 4/4-4/8

Pivotal Labs
Monday, April 11, 2011
  • “Floated selects in Chrome don’t respond to mouseclicks ??” A: There was some speculation that the size of the clickable area of the element had collapsed to zero. The answer: “try display:inline-block”.

  • Gotcha: “CSS ellipses can change the output in Capybara and cause tests to fail.” There was a general reminder to everyone that ellipses don’t work in any version of Firefox.

  • Help: “What’s a good jquery placeholder plugin?” A: Placeheld

  • GoGaRuCo 2010 Videos are finally ready – yay! This was a quality conference, props to @joshsusser et al, each of these talks is worth your time.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Rails' delegates are even more useful than I knew

Pivotal Labs
Saturday, April 9, 2011

File this under “things I wish I’d known about years ago”…

Do you use delegate in Rails? It’s a great way to avoid Law of Demeter violations. Let’s say you’re modeling people, who belong to households:

class Person
  belongs_to :household
  delegate :address, to: household
end

class Household
  # has a string attribute 'address'
end

Now we can get the address of a Person with the Demeter-friendly
person.address, rather than the trainwreck person.household.address.
When we decide suddenly that a person sometimes needs to override its
household’s address, we can change this to:

class Person
  belongs_to :household

  def address
    overriding_address || household.address
  end
end

and we don’t have to change any code which refers to person.address.

But! What about this?

class Person
  # has a string attribute 'name'
end

class Business
  belongs_to :owner, class_name: 'Person'
end

How do we get the name of a business’s owner? We could say
business.owner.name, but that’s a Demeter violation. We could delegate,
but then we’d have business.name, which would be wrong. Luckily, the
authors of delegate have thought of this:

class Business
  belongs_to :owner, class_name: 'Person'
  delegate :name, to: :owner, prefix: true
end

The prefix: true option gives us business.owner_name, which is much
better. You can also specify a custom prefix instead of true.

After doing this manually by defining methods for years, I feel silly to
learn that the prefix option has been around since 2008!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mike Gehard

Making sure you implement the ActiveModel interface fully

Mike Gehard
Friday, April 8, 2011

Rails 3 brings with it ActiveModel.

ActiveModel give you a way to make non-db backed models look like db backed models to your views and controllers. See this post for a good explanation of what using ActiveModel buys you.

ActiveModel gives you a great way to test that your class implements the minimum ActiveModel interface: ActiveModel::Lint::Tests

Check out this gist for the details for using these tests in RSpec:

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Ian Zabel

Radiating your TeamCity Builds

Ian Zabel
Friday, April 8, 2011

If you’re using a Continuous Integration tool, you should also be using an information radiator like Pivotal Labs’ CiMonitor. CiMonitor is designed to be displayed on a screen that the entire team can see. If any of your builds go red, it shows up as a big red square and the team can quickly respond.

CiMonitor has long had support for CruiseControl.rb and Jenkins (formerly Hudson). However, my CI tool of choice is TeamCity from JetBrains. We’ve recently added native support in CiMonitor for displaying your TeamCity build status, and I want to show you how to get it going. It’s as easy as configuring a new project and pointing to TeamCity’s REST API. Let’s walk through it step by step.

Install CiMonitor

For native TeamCity support, you’ll need to be on the latest version of CiMonitor. Follow the installation instructions on the CiMonitor GitHub page. If you already have CiMonitor installed locally, you’ll have to update to the latest version.

Create a New Project

Login to CiMonitor, and create a new project.

Choose “Team City Rest Project” as the Project Type.

For the Feed URL, you’ll be hitting the REST API provided by TeamCity 5.0 and newer. The correct format for the URL is as follows, with the # representing the TeamCity project number:

http://teamcity:8111/app/rest/builds?locator=running:all,buildType:(id:bt#)

You can find the correct project number by clicking onto the project in TeamCity and looking in the URL. Grab the number from the buildTypeId parameter.
TeamCity Project ID

You will also need to fill in a TeamCity username and password that CiMonitor will use to access the REST API.

Example Settings

New Project

Once you’ve set up the new project, save it and you’re all set.

Watch Your Builds Run!

You can now easily see the status of your TeamCity builds.
TeamCity Builds

CiMonitor will also show that a build is currently in progress.
Running TeamCity Build

Wrapping Up

The integration is pretty solid, but there are one or two things that may seem to be odd behavior.

CiMonitor keeps track of build start times to control the size of the build dots for each project. The older the build, the smaller the dot. Currently, TeamCity’s REST API doesn’t publish the start time of a running build. Since this data is unavailable, CiMonitor just uses the current time when it fetches the feed. This is a minor issue, and JetBrains has already committed a fix for their REST API which will be released in the next version of TeamCity. CiMonitor will use the new field if it’s present in the feed.

Also, TeamCity has a great feature that will tell you that a build is failing before it even finishes. This has an interesting effect on CiMonitor. If a TeamCity build is red, the next time it begins running, CiMonitor will show it as green until the first test fails. Once TeamCity picks up on a failure, CiMonitor will show the build as red. This can be a little confusing at first because it may look like a build-in-progress is green before it has finished.

Hopefully you find this new functionality useful!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (778)
  • rails (113)
  • testing (87)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (54)
  • techtalk (44)
  • rspec (38)
  • activerecord (29)
  • productivity (29)
  • gogaruco (29)
  • ironblogger (29)
  • git (28)
  • nyc (27)
  • rubymine (25)
  • mobile (22)
  • bloggerdome (21)
  • cucumber (20)
  • process (19)
  • pivotal tracker (19)
  • 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)
  • tdd (13)
  • selenium (12)
  • css (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. →
  • 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 >