Created
May 9, 2009 08:50
-
-
Save bmaland/109188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # In Ruby 1.8 | |
| irb(main):008:0> "" + Errno::ENOENT.new | |
| => "No such file or directory" | |
| irb(main):009:0> "" + Errno::ENOENT.new.to_s | |
| => "No such file or directory" | |
| # In Ruby 1.9 | |
| irb(main):002:0> "" + Errno::ENOENT.new | |
| TypeError: can't convert Errno::ENOENT into String | |
| irb(main):003:0> "" + Errno::ENOENT.new.to_s | |
| => "No such file or directory" | |
| # So, adding to_s is a good idea |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment