`ptype` can be more than just hash and password, there also ssh keys and the possibility exists that other things will be added in the future.  I think this should explicitly look for passwords like so:
```ruby
next unless o.ptype == "password"
passwords << o.pass
```

Same below for user/pass combinations.