Skip to content

Instantly share code, notes, and snippets.

@tank-bohr
Created January 10, 2013 08:19
Show Gist options
  • Save tank-bohr/4500398 to your computer and use it in GitHub Desktop.
Save tank-bohr/4500398 to your computer and use it in GitHub Desktop.
$ rvm use ruby-1.9.3-p362
Using /Users/me/.rvm/gems/ruby-1.9.3-p362
$ irb
1.9.3p362 :001 > require 'strscan'
=> true
1.9.3p362 :002 > scanner = StringScanner.new('cölorfül')
=> #<StringScanner 0/10 @ "c\xC3\xB6lo...">
1.9.3p362 :003 > scanner.pos = 9
=> 9
1.9.3p362 :004 > scanner
=> #<StringScanner 9/10 "...orf\xC3\xBC" @ "l">
1.9.3p362 :005 >
$ rvm use rbx-2.0.0-rc1
Using /Users/me/.rvm/gems/rbx-2.0.0-rc1
$ irb
rubinius-2.0.0.rc1 :001 > require 'strscan'
=> true
rubinius-2.0.0.rc1 :002 > scanner = StringScanner.new('cölorfül')
=> #<StringScanner 0/8 @ "cölor...">
rubinius-2.0.0.rc1 :003 > scanner.pos = 9
RangeError: index out of range (9)
from /Users/me/.rvm/rubies/rbx-2.0.0-rc1/lib/strscan.rb:15:in `pos='
from (irb):3
from kernel/common/block_environment.rb:75:in `call_on_instance'
from kernel/common/eval.rb:75:in `eval'
from kernel/common/kernel19.rb:42:in `loop'
from kernel/common/throw_catch19.rb:8:in `catch'
from kernel/common/throw_catch.rb:10:in `register'
from kernel/common/throw_catch19.rb:7:in `catch'
from kernel/common/throw_catch19.rb:8:in `catch'
from kernel/common/throw_catch.rb:10:in `register'
from kernel/common/throw_catch19.rb:7:in `catch'
from kernel/delta/codeloader.rb:68:in `load_script'
from kernel/delta/codeloader.rb:118:in `load_script'
from kernel/loader.rb:615:in `script'
from kernel/loader.rb:816:in `main'
rubinius-2.0.0.rc1 :004 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment