I’m currently writing a tool where the data-structure is coded in C++,
but manipulated in wonderful Ruby. I had also added some ‘ruby
goodness’ to the C++ classes, such as providing “.each_X” iteration
methods for use within the ruby part of the system.
assume that the class Architecture is defined in a module Nest, all
implemented in C++ but with ruby hooks generated by SWIG.
with ruby 1.6.8, i could do the following:
require ‘Nest’ # load the C++ extension
puts "hi from ruby"
… and now i could call ‘newMethod’ along with all the other instance
methods for Architecture defined in the C++ source.
however, with Ruby 1.8.0 this stopped working, giving the error:
NameError: undefined constant Architecture
…and the only way I can get it running is if i do the following:
define the new methods
is this expected?
- James Adam