Zlib, hidden classes and modules

Discussion in 'Ruby' started by Krypt Er, Jan 16, 2008.

  1. Krypt Er

    Krypt Er Guest

    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.
    --
    Posted via http://www.ruby-forum.com/.
    Krypt Er, Jan 16, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick
    Replies:
    3
    Views:
    8,107
    Alexey Smirnov
    Apr 13, 2010
  2. Matthew Brett
    Replies:
    4
    Views:
    1,089
    Matthew Brett
    May 9, 2010
  3. Daniel Berger
    Replies:
    5
    Views:
    229
    Roger Pack
    Jun 21, 2009
  4. Nicholas Wieland

    Most simple usage of zlib or pr-zlib

    Nicholas Wieland, Mar 9, 2011, in forum: Ruby
    Replies:
    4
    Views:
    303
    Jeremy Bopp
    Mar 10, 2011
  5. SolarCanine
    Replies:
    2
    Views:
    255
    SolarCanine
    Sep 20, 2005
Loading...

Share This Page