Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

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

Interesting Things

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

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.

  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.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *

Share This