E
Eric Promislow
If I run <<ri Abbrev>>, no problem.
But with this code:
##########
require 'yaml'
require 'pp'
class RiFinder
def initialize(sysdir)
@sysdir = sysdir
end
def get_class_info(clsName, info)
clsFile = "#{@sysdir}/#{clsName}/cdesc-#{clsName}.yaml"
puts "About to yaml <<#{clsFile}>>"
clsInfo = File.open(clsFile) { |io| YAML.load(io) }
pp clsInfo
end
end
rifinder = RiFinder.new("c:/ruby/share/ri/1.8/system", nil, nil)
rifinder.get_class_info("Abbrev", nil)
#===========
About to yaml <<c:/ruby/share/ri/1.8/system/Abbrev/cdesc-Abbrev.yaml>>
I get this error:
c:/ruby/lib/ruby/1.8/yaml.rb:133:in `transfer': invalid subclass
(TypeError)
from c:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'
from get_yaml_info.rb:19:in `get_class_info'
from get_yaml_info.rb:19:in `get_class_info'
from get_yaml_info.rb:25
ruby 1.8.4 (2006-04-14) [i386-mswin32]
It's the same code, and I don't see ri setting any options in the YAML
namespace
telling it to process types like "!ruby/struct:SM::Flow:"
differently, although I gather
this is the problem.
Any advice?
I can use yaml.rb to read back files I've written out with it. The
problem is with the
rdoc files. But it works when I go through ri (after adding the bug
fix at line 99
of ri_descriptions.rb given in
http://ruby.about.com/od/gettingstarted/qt/ruby_ri.htm).
Thanks,
Eric
But with this code:
##########
require 'yaml'
require 'pp'
class RiFinder
def initialize(sysdir)
@sysdir = sysdir
end
def get_class_info(clsName, info)
clsFile = "#{@sysdir}/#{clsName}/cdesc-#{clsName}.yaml"
puts "About to yaml <<#{clsFile}>>"
clsInfo = File.open(clsFile) { |io| YAML.load(io) }
pp clsInfo
end
end
rifinder = RiFinder.new("c:/ruby/share/ri/1.8/system", nil, nil)
rifinder.get_class_info("Abbrev", nil)
#===========
About to yaml <<c:/ruby/share/ri/1.8/system/Abbrev/cdesc-Abbrev.yaml>>
I get this error:
c:/ruby/lib/ruby/1.8/yaml.rb:133:in `transfer': invalid subclass
(TypeError)
from c:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'
from get_yaml_info.rb:19:in `get_class_info'
from get_yaml_info.rb:19:in `get_class_info'
from get_yaml_info.rb:25
ruby 1.8.4 (2006-04-14) [i386-mswin32]
It's the same code, and I don't see ri setting any options in the YAML
namespace
telling it to process types like "!ruby/struct:SM::Flow:"
differently, although I gather
this is the problem.
Any advice?
I can use yaml.rb to read back files I've written out with it. The
problem is with the
rdoc files. But it works when I go through ri (after adding the bug
fix at line 99
of ri_descriptions.rb given in
http://ruby.about.com/od/gettingstarted/qt/ruby_ri.htm).
Thanks,
Eric