Xrcise problem

Hello Mario.

From: Mario S. [email protected]
To: General discussion of wxRuby [email protected]
Date: Mon, 23 Nov 2009 06:24:32 -0500
Subject: Re: [wxruby-users] xrcise not working
Hello Philip,

The problem you are having, is the fact that Ruby 1.9 String standard
class
no longer implements the each method on it. Which basically, for
string,
each splits the lines at the \n terminator, returning each line to the
block, so you need to create a library file, and have it included, as
follows:

string_each.rb:

class String
def each
self.split(“\n”).each do |line|
yield line
end
end
end

Then there’s two ways you can work this, either on the command line, do
the
following:

xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc

xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc
/home/myhome/gems/bin/xrcise: invalid option – r
/opt/lib/ruby1.9/1.9.1/getoptlong.rb:392:in set_error': invalid option -- r (GetoptLong::InvalidOption) from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:569:in get’
from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:600:in block in each' from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:599:in loop’
from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:599:in each' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:90:in <top
(required)>’
from /home/myhome/gems/bin/xrcise:19:in load' from /home/myhome/gems/bin/xrcise:19:in

Or, modify the xrcise script itself, found in /home/myhome/gems/gems/wx_
sugar-0.1.22/bin/xrcise

And add a require ‘string_each’ before any other require. I will see
about fixing this bug, and doing a > new release of wx_sugar to fix this
problem with Ruby 1.9, along with any other outstanding bugs that > I
can
find in regards to wx_sugar

I tried that but still got errors. A new release of wx_sugar would be
great. Thanks for your reply.

Philip