Version 2.0.0, what has replaced scan?

A friend wrote a brief Ruby script (attached) which downloads game files
from a website. It worked for 1.7, but not for 2.0. Here is the error I
get:

david@achernar:~/games/Twixt/sw$ ruby ./getgame.rb 1522422 1522423
1522424 1522431
./getgame.rb:91:in `getPlayer1': undefined method `scan' for
nil:NilClass (NoMethodError)
  from ./getgame.rb:143:in `getJtwixtFileData'
  from ./getgame.rb:164:in `getGame'
  from ./getgame.rb:179:in `block in <main>'
  from ./getgame.rb:178:in `each'
  from ./getgame.rb:178:in `<main>'
david@achernar:~/games/Twixt/sw$

Is there a list of changes to Ruby since 1.7? Any clue would be
appreciated. Thanks for your time.

David

Attachments:
http://www.ruby-forum.com/attachment/8202/getgame.rb

···

--
Posted via http://www.ruby-forum.com/.

It isn't a difference between Ruby versions. You are trying to call scan on nil, this has never worked.

Show us the code and we might have a better idea of your problem.

Henry

···

On 7/03/2013, at 1:08 PM, David Bush <lists@ruby-forum.com> wrote:

A friend wrote a brief Ruby script (attached) which downloads game files
from a website. It worked for 1.7, but not for 2.0. Here is the error I
get:

david@achernar:~/games/Twixt/sw$ ruby ./getgame.rb 1522422 1522423
1522424 1522431
./getgame.rb:91:in `getPlayer1': undefined method `scan' for
nil:NilClass (NoMethodError)

Sorry I missed the attachment…

It looks to me that you aren't being careful enough in checking the server responses in getGame. lgData on line 155 is nil.

Incidentally, I ran your script and it worked so maybe there was a transient server error.

Henry

···

On 7/03/2013, at 1:17 PM, Henry Maddocks <hmaddocks@me.com> wrote:

Show us the code and we might have a better idea of your problem.