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

Standup 9/17/2009: silly Ruby tricks, unstub!, iPivotal => PTCruiser

Nate Clark
Thursday, September 17, 2009

Interesting Things

  • silly Ruby trick of the day — does anyone know what this does?
while gets
  print if /foo/
end

This is an example from the Ruby “Pickaxe” book. No respected Rubyist actually writes such difficult-to-understand and obfuscated code. Though, it was mentioned, that terse syntax like this is useful for command-line hacking.

  • unstub! is a useful Rspec method that removes a stub from a previously stubbed object. This can be useful if you have stubbed, then mocked the same method, and you want to remove the stub.

  • The unofficial community-developed iPhone app for Pivotal Tracker, is changing its name from iPivotal to PTCruiser. See the author’s Twitter for more.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  1. Yarrow says:

    It does the same thing as

    ruby -ne ‘print if /foo/’

    which does the same thing as

    egrep foo

    If you’re a Perl refugee, this isn’t particularly obfuscated. And

    ruby -n00e ‘print if /foo/’ some-file.ldif

    will print the complete, multi-line text of every entry in the LDIF file that contains “foo”, which I don’t know how to do with grep or egrep.

    September 17, 2009 at 10:54 am

Add New Comment Cancel reply

Your email address will not be published.

Nate Clark

Nate Clark
San Francisco

Recent Posts

  • 09/25/12: It’s about something
  • revealing the ActionController callback filter chain
  • Standup 9/16/2009: eycap :forward_agent, Rails 2.3 sends 2 content-types
Subscribe to Nate's Feed

Author Topics

agile (6)
rails (1)
rails3 (1)
  • 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 >