openshift/os-client-tools — pull request #71 by xiy (2012-06-21 01:06:39+00:00)
Title: rhc-port-forward compatibility bug for ruby 1.9

command: `rhc port-forward -a app`
on ruby: `1.9.3-p194`
with: openshift/os-client-tools@7f9b8c485815ec298c401cb65c474e946163f322 or gem: 0.93.18

After running the above command, you get this doozy:

Checking available ports...
express/bin/rhc-port-forward:118:in `block (2 levels) in

': undefined method `each' for "mongod -> 127.6.40.1:27017\nnginx -> 127.6.40.1:8080\n":String (NoMethodError)
… (snipped)
from express/bin/rhc-port-forward:107:in `

'

This is simply because 1.9.x doesn't have the `each` method on strings anymore, it prefers either `lines` (which literally separates lines platform-specifically) or one of the `each_` methods. Luckily the `lines` method exists for both 1.8 and 1.9. Backwards **and** forwards compatibility win - huzzah!