Skip to content

Instantly share code, notes, and snippets.

@jwilger
Created December 5, 2010 01:05
Show Gist options
  • Save jwilger/728658 to your computer and use it in GitHub Desktop.
Save jwilger/728658 to your computer and use it in GitHub Desktop.
Not sure if this is an interpreter bug or just a misunderstanding on my part.
ree-1.8.7-2010.02 > s.each do |x|
ree-1.8.7-2010.02 > begin
ree-1.8.7-2010.02 > puts '%02d' % x
ree-1.8.7-2010.02 ?> rescue ArgumentError => e
ree-1.8.7-2010.02 ?> puts e
ree-1.8.7-2010.02 ?> end
ree-1.8.7-2010.02 ?> end
01
02
03
04
05
06
07
invalid value for Integer: "08"
invalid value for Integer: "09"
10
=> ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment