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

Glenn Jahnke

Is your XML foo savvy?

Glenn Jahnke
Tuesday, November 15, 2011

Helps

  • “How do you change the address and port that Solr is running on?”

Somewhere in the server.xml file was suggested, however that didn’t seem to work. The workaround was using IP Tables.

Interestings

  • as_json (with options) seems to always be called with an explicit nil argument from to_json under Rails 3. Some people just use as_json explicitly, or pass an explicit empty hash as the arg to get around this oddity.

  • Jenkins now supports Ruby plugins.

  • Support Movember! Pivotal has raised quite a bit of money and you can too.

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

New in Pivotal Tracker for iOS: Search, My Work, New iPhone Interface

Dan Podsedly
Tuesday, November 15, 2011

Version 1.1 of the Pivotal Tracker for iOS app is now available in the iTunes App Store. This update adds the Search and My Work panels, a redesigned iPhone interface, and many overall usability improvements. All the details after the jump, below.

Search and My Work

You can now find and filter stories quickly with the new Search panel, which supports all of the Tracker search syntax that you’re used to. The new My Work panel shows you all of the stories that you’re currently working on, that are assigned to you, or that are waiting for your acceptance.

Add Stories Anywhere

Adding stories is easier now, just tap the new story button at the top right corner, regardless of where you are in the app (on the iPad or the iPhone).

Faster Access to Story Panels

Switching between panels on the iPhone is now much faster with the new tab bar at the bottom. It even works while dragging a story – tap the desired target panel with the other finger.

Similarly, the iPad version now has a row of panel buttons at the top right, tap them to reveal a given panel quickly or just swipe the panels side to side as before.

Story States on iPhone

Story states are now displayed for in-progress stories on the iPhone, and easily changed by swiping a story to the left.

Other Improvements

Drag and drop and scrolling has been significantly improved, particularly on older iPhone and iPod Touch models. We’ve also updated the app for iOS 5, and added many detailed interface tweaks to make stories easier to find and work with.

Feedback

We’re committed to bringing the best of Pivotal Tracker to the your iPhone and iPad, while taking full advantage of all the user experience and portability features of the iOS platform. Many more improvements are on the way, but we’d love to know what you think so far! Give us a shout at tracker@pivotallabs.com.

By the way, we’re thrilled to see all the positive reviews in iTunes. Thanks everyone, and keep them coming!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
JT Archie

[Standup][NYC] 2011-11-14 – 3, 2, 1 Launch!

JT Archie
Monday, November 14, 2011

Interesting

  • Heroku has released Scheduler. Their replacement functionally for cron, which allows you to schedule processes to be run (limited to a 10 minute interval).

Events

  • Monday – Raise Cache @ 7pm
  • Wednesday – node.js meetup @ 6:30pm
  • Wednesday – Machine Learning study group @ 7pm
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Why can’t it be Moly or Mogust?

Pivotal Labs
Sunday, November 13, 2011

It’s Movember, the month formerly known as November. I decided to join the Movember cause this year by shaving my beard off and growing a mustache. I’ve had a beard for a good 5+ years, so it’s rather cold in the morning waiting for the bus.

You can help make my sacrifice more worth while by donating funds to combat cancers affecting men. Please support my efforts by making a donation at http://mobro.co/jasonnoble/d.

Even $5 helps a ton!

Quite a few Pivots are participating this year. We’re part of the Webstache network:

Webstache
Pivotal SF
Pivotal NY
Pivotal Boulder

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

Figuring out what Rails Guide to edit next

Pivotal Labs
Sunday, November 13, 2011

I’ve been contributing to Rails lately by going through the Rails Guides and making sure they’re up to date.

How do I go about finding a guide that hasn’t been updated in a while?

Here’s what I came up with:


ls -1 | perl -e 'while(<>) { chomp; $file = $_; print "$file was"; $changed = qx/git log -1 --format=format:"changed by %an %ar" $file/; print " $changedn" } '

In the docrails/railties/guides/source directory, this outputs:


2_2_release_notes.textile was changed by Vijay Dev 11 months ago
2_3_release_notes.textile was changed by Vijay Dev 8 months ago
3_0_release_notes.textile was changed by ov3y 3 months ago
3_1_release_notes.textile was changed by Rinaldi Fonseca 2 months ago
action_controller_overview.textile was changed by Brian Durand 3 weeks ago
[...]

There’s got to be a better way. I’d like to be able to sort by the date they were last written, etc.

Got any ideas?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Hunter Gillane

Terminal: Beyond Ctrl + A and Ctrl + E

Hunter Gillane
Saturday, November 12, 2011

Update: I had some of the Ctrl and Option commands switched. Fixed now.

As Rails developers, we spend most of our day in two places: an IDE/text editor and the command line. While we spend much time learning shortcuts that help us write and refactor our source code more quickly, many of us are perfectly okay just learning Ctrl + A and Ctrl + E and holding down the arrow keys to place the cursor where we want to get to on the command line.

Don’t do that. With only a handful of additional commands, your day to day interaction with the terminal can be much more pleasant. Here are a few ways to do that using terminal and the bash shell.

A Command Line Editing Starter Pack

Here’s a quick list of commands that you’ll get a lot of day to day usage from, if you aren’t already:

  • Ctrl + A: Move cursor to the beginning of the line
  • Ctrl + E: Move cursor to the end of the line
  • Ctrl + K: Delete from cursor to the end of the line
  • Option + F: Move cursor one word forward
  • Option + B: Move cursor one word backward
  • Option + D: Delete next word
  • Option + Delete: Delete previous word

Note: You’ll need to set your meta key to Option before the commands that use Option will work (see below).

These seven simple commands will help you move more nimbly when editing text on the commands line. There is certainly plenty more you can do, which you can find in the bash manual.

A Word on Modes

By default, the bash shell run in emacs mode. This means that emacs shortcuts are enabled by default.

Emacs mode uses a Meta key for some commands, and the Option key is a good choice. In Terminal on OS X, you’ll need to enable this by going to Preferences > Settings > Keyboard and checking “Use option as meta key.”

You can also tell bash you want to use vi mode for command line editing with set -o vi, if for some reason you want to type i before every cd or ls you write.

End

Nothing new or overwhelmingly exciting here, and there is certainly much more to dive into if you are so inclined. However, this small set of commands will have you covered for the majority of your day to day command line editing needs and is what I would consider constitutes a minimum level of proficiency.

Give your arrow keys a break!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Stephan Hagemann

Standup 11/11/2011: Some funkinesses

Stephan Hagemann
Friday, November 11, 2011

Interesting

  • rspec stub != stub!. stub! is an alias method for stub. There is however also a method stub that is an alias for double. If you try to stub a method on the test class (to stub it on the context), you should probably use the magic subject/helper/controller methods. If you don’t, using self.stub(:name => 'result') will create a double, while self.stub!(:name => 'result') will stub the method as you would expect.

  • Asynchronous file creation and downloading: if an asynchronous process writes a file using File.open and f.write, an other process checking the presence of the file to determine whether it is already available for download, will deliver the empty file, if the file has been opened, but not yet written.

    • Workarounds:
      • if you have one write to the file only: check filesize.
      • update an ActiveRecord attribute after the file writing is completed and check against that.
  • == on DelegateClass: newing up an instance delegate_x of DelegateClass from object x, x == delegate_x, while of course x.class != delegate_x.class.

Keystroke of the day

  • Rubymine KOTD: The search+replace mode you reach via Cmd+r allows you to see recent searches by hitting the down arrow. If that doesn’t work for you in Lion, hit Ctrl+h.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Stephan Hagemann

Another first four weeks: concerned and delegated

Stephan Hagemann
Thursday, November 10, 2011

James’ post from a couple of weeks ago inspired me to write up my own experiences of my first couple of weeks at Pivotal. However, instead of telling you how it felt, I will tell you about stuff I learned.

ActiveSupport::Concern

I have seen and used this pattern of adding both class and instance methods from a module to a class:

module Foo
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def foo
      'classy'
    end
  end

  def foo
    'instancy'
  end
end

class Bar
  include Foo
end

Bar.foo # => "classy"
Bar.new.foo # => "instancy"

While the syntax for including Foo in Bar is nice and succinct, the definition of Foo contains the funny looking “included” hook to also extend the base class.

If you happen to have ActiveSupport around, you can instead define Foo as follows while achieving the same result:

module Foo
  extend ActiveSupport::Concern

  module ClassMethods
    def foo
      'classy'
    end
  end

  def foo
    'instancy'
  end
end

The documentation explains the more convenient feature of Concern, which is module dependency. Using Concern, module dependencies are correctly loaded without the need for you to be concerned.

DelegateClass

In one of the projects I worked on, we were exporting data from a Rails app. We wanted access to the business logic of the models while not littering the application’s code with export related code. We decided to extend the models using DelegateClass (see Jeff’s blog post on DelegateClass as a starting point). And DelegateClass rocked our world, too.

A couple of things to note:

  • It turns out, that these days there is no need to manually ensure that id gets delegated. It works out of the box.
  • Class methods need manual delegation.

Here is a basic delegation example:

require 'delegate'

class Foo
  def to_s
    "foo"
  end
end

module Export
  class Foo < DelegateClass(Foo)
    def bar
      "#{self} bar"
    end
  end
end

foo = Foo.new

foo.to_s # => "foo"

Export::Foo.new(foo).to_s # => "foo"
Export::Foo.new(foo).bar # => "foo bar"

When delegating ActiveRecord models with associations between them, the following pattern can be helpful to make sure you get the delegated classes when traversing relationships:

class Post < ActiveRecord::Base
  has_many :comments
end

class Comment < ActiveRecord::Base
  belongs_to :post
end

module Export
  class Post < DelegateClass(Post)
    alias_method :original_comments, :comments
    def comments
      original_comments.map { |comment| Export::Comment.new(comment) }
    end

    #some methods for exporting
  end
end

module Export
  class Comment < DelegateClass(Comment)
    alias_method :original_post, :post
    def post
      Export::Post.new(original_post)
    end

    #some more methods for exporting
  end
end

original_post = Post.new(comments: [Comment.new])
original_post.comments.first.class # => Comment(...)
post = Export::Post.new(original_post)
post.comments.first.class # => Export::Comment

#Be aware!
original_post == post # => true
original_post.class == post.class # => false
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Sean Beckett

New Tech Talk: Hadoop for Rubyists

Sean Beckett
Wednesday, November 9, 2011

Is your MySQL database groaning under the weight of too much data? Are you tired of waiting for analytics rake tasks in Rails that take hours to run? Loren Siebert discusses how you can leverage your existing Ruby codebase by building Hadoop Map/Reduce jobs using Hive and plugging in your own custom Ruby mappers/reducers. This is good for Rubyists who want to apply what they know to Hadoop, and good for Hadoop users who don’t want to build MapReduce functionality in Java.

See all our talks at http://pivotallabs.com/talks

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Roberto Ostinelli

Standup 11/8/2011: Rails 3 fixtures and licenses

Roberto Ostinelli
Tuesday, November 8, 2011

Helps

  • Upgrading to Rails 3 from 2.3.14 results in rails not being able to reference named fixtures, so you actually have to force them. For ex:
work_sample_asset_version:
  asset_id: <%= Fixtures.identify(:work_sample_asset) %> # works
  asset: work_sample_asset # doesn't work
  • Ruby license has switched from dual license Ruby License / GPL3 for v1.9.2 to Ruby License / BSD for v1.9.3.

Interesting

  • Riak v1.0 has been released, release party this evening

  • On Lion, Ctrl-F7 allows you to toggle keyboard access between “all controls” and “text boxes and list only”

  • SF Public Department is running an AIDS risk level assessment, feel free to join up if interested.

  • 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. →
  • 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 >