Ocra chat list?; Ocra crashes; Subclassing String

  1. Is there an active OCRA chat list?

  2. When I use OCRA to create an executable, the executable crashes
    before the first puts is executed.

I tentatively have isolated the problem to subclassing String. …


class PathnameString < String
def initialize(arg)
super arg
end

def is_root_directory?
!((self.convert_forward_slash_to_back_slash.strip =~
/^[A-Za-z]:\$/).nil?)
end

def convert_forward_slash_to_back_slash
self.class.new(self.gsub(///, “\”))
end

end


Assuming that it is this subclassing that is causing OCRA difficulties,
do any of the gurus here know what I might have to do get OCRA to
understand the subclassing?

In the alternate … I will have to change this from an ISA method to a
HASA method with a ton of delegates. Is there a good Ruby way to do
that?

Does using a ghost method sound like a good idea here?

On Sun, Aug 22, 2010 at 7:39 AM, Ralph S. [email protected]
wrote:

  1. Is there an active OCRA chat list?

You can go to http://rubyforge.org/projects/ocra and post to the forum
or create a request on the tracker.

  1. When I use OCRA to create an executable, the executable crashes before the first puts is executed.

Can you be a bit more specific about the “crash”, please. If it’s an
exception, please post the output (name and backtrace). It will also
be very helpful if you can produce a minimal example that shows the
problem. I can’t reproduce with the code your have provided.

I can also highly recommend trying out the new and improved Ocra
1.2.0.rc1. (gem install ocra --pre)

Saturday, August 21, 2010, 11:39:22 PM, you wrote:

RS> 1) Is there an active OCRA chat list?

RS> 2) When I use OCRA to create an executable, the executable crashes
before the first puts is executed.

RS> I tentatively have isolated the problem to subclassing String. …

RS> - - - -

RS> class PathnameString < String
RS> def initialize(arg)
RS> super arg
RS> end
RS>
RS> def is_root_directory?
RS> !((self.convert_forward_slash_to_back_slash.strip =~
/^[A-Za-z]:\$/).nil?)
RS> end

RS> def convert_forward_slash_to_back_slash
RS> self.class.new(self.gsub(///, “\”))
RS> end
RS>
RS> …

RS> end
RS> - - - -

RS> Assuming that it is this subclassing that is causing OCRA
difficulties, do any of the gurus here know what I might have to do get
OCRA to understand the subclassing?

RS> In the alternate … I will have to change this from an ISA method
to a HASA method with a ton of delegates. Is there a good Ruby way to
do that?

RS> Does using a ghost method sound like a good idea here?

Replying to my own message:

Well, it was not subclassing, I think, that was messing OCRA up.

I had a handful of relatively innocuous *.rb files in a subdirectory off
of my main directory. These are some utility classes and modules. As
far as I can tell, there is nothing particularly special about them.

These functions sat in a directory named “Utils”. Changing the name of
the directory from Utils to UD_Stuff did not clear the crash.

The only thing that worked was moving these innocuous utility functions
from the subdirectory up a level to the same directory where main.rb

ruby mymain.rb

What’s weird is that I have other subdirectories (e.g. Models, Views,
Controllers) with large and complicated ruby files, and I have no
problems with them.

If anyone has any ideas … I’d love to hear them.

Lars,

The only information about the crash is in the system event log


Faulting application UltraDedupGUI.exe, version 0.0.0.0, time stamp
0x4b07346d, faulting module unknown, version 0.0.0.0, time stamp
0x00000000, exception code 0xc0000005, fault offset 0x2f637273, process
id 0x1a40, application start time 0x01cb424e0d9a7620


UltraDedupGUI.exe is the executable produced by OCRA.

I don’t know how much of a low-level programmer you are but 0xc0000005
is an access violation … a wild pointer.

Thus … there is no trace to give you.

Ralph

Sunday, August 22, 2010, 5:06:50 PM, you wrote:

LC> On Sun, Aug 22, 2010 at 7:39 AM, Ralph S. [email protected]
wrote:

  1. Is there an active OCRA chat list?

LC> You can go to http://rubyforge.org/projects/ocra and post to the
forum
LC> or create a request on the tracker.

  1. When I use OCRA to create an executable, the executable crashes before the first puts is executed.

LC> Can you be a bit more specific about the “crash”, please. If it’s an
LC> exception, please post the output (name and backtrace). It will also
LC> be very helpful if you can produce a minimal example that shows the
LC> problem. I can’t reproduce with the code your have provided.

LC> I can also highly recommend trying out the new and improved Ocra
LC> 1.2.0.rc1. (gem install ocra --pre)

Lars,

Sunday, August 22, 2010, 5:06:50 PM, you wrote:

LC> On Sun, Aug 22, 2010 at 7:39 AM, Ralph S. [email protected]
wrote:

  1. Is there an active OCRA chat list?

LC> You can go to http://rubyforge.org/projects/ocra and post to the
forum
LC> or create a request on the tracker.

  1. When I use OCRA to create an executable, the executable crashes before the first puts is executed.

LC> Can you be a bit more specific about the “crash”, please. If it’s an
LC> exception, please post the output (name and backtrace). It will also
LC> be very helpful if you can produce a minimal example that shows the
LC> problem. I can’t reproduce with the code your have provided.

LC> I can also highly recommend trying out the new and improved Ocra
LC> 1.2.0.rc1. (gem install ocra --pre)

I will post there.

I did the gem install and the latest exhibits the same bizarre behavior.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs