Xrcise now works

Hi Mario,

The following change to outputter.rb did work for me. It looks like
adding
a routine to string should also work but it didn’t for me. Thanks for
your
help.

-Philip
===== from RubyForge ==========
Date: 2009-11-18 00:25
Sender: Konstantin Shabanov

After changing ‘each’ method to ‘each_line’ in outputter.rb
on lines 39 and 46 xrcise code generation seems to be working.

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

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.

hth,

Mario