Zlib, hidden classes and modules

K

Krypt Er

Hello, I am pretty new to ruby although I am a quick learner and have
the benefit of help from a pretty experienced scripter, however with my
tutor being abscent from the forum and IRC channels I think maybe it's
time I started to join a specific forum regarding coding only.

As my first question I would like some help with Zlib (Inflate.inflate +
Defalte.deflate) here is a little snippet of code my tutor gave me a
while ago.

Dir.mkdir("./script") unless File.exist?("./script")
$RGSS_SCRIPTS.each do |s|
s[1] = s[1].gsub(/::/,"_").gsub(/\//, "_")
s[2] = Zlib::Inflate.inflate(s[2])
File.open("./script/#{s[1]}.rb","wb") do |f|
f.print(s[0])
end
end

What this does is it saves all scripts in my program to a new folder in
my project folder called scripts and it outputs them from a data file
into .rb files allowing me to edit the code with notpad++ instead of
using the built in script editor, now this is good however there are
hidden classes and modules that I desperately need to edit as they fall
short of the standard that I should expect, but they are'nt outputed
with the above.

So I did a test to see if the hidden classes and modules are included in
the ruby heap.

ObjectSpace::each_object(Class){|x|
p x
}

Which printed to screen all the usual Zlib, hash, array and also all the
classes I can edit within the editor and listed all the hidden classes
and modules, so my theory is they are contained in the editor and not a
seperate file, I can also with the Zlib code above print to screen about
20 lines of a classes code, but again the hidden classes are well,
hidden, I would like to know if there would be a way.

Is there a way to view hidden classes and modules code, also is it
possible to print to screen more than about 20 lines of a classes code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top