Viewing code

Discussion in 'Ruby' started by Burt Hill, Jan 8, 2008.

  1. Burt Hill

    Burt Hill Guest

    I am new to ruby and although I am learning quickley I was wondering if
    it is possible to view code, I will explain.

    When I write a module I can use the below code to print out the method
    names I used in my module on screen which is ok, but is it possible to
    print everything I written (the whole script) onscreen and/or
    output/save it to a txt file?
    ===================================================================================
    module Hidden
    class << self
    p instance_methods-Module.instance_methods
    end
    end
    ===================================================================================
    --
    Posted via http://www.ruby-forum.com/.
    Burt Hill, Jan 8, 2008
    #1
    1. Advertising

  2. Burt Hill

    Burt Hill Guest

    Ok I found a better way of explaining it.

    Say I write a module for a program and I implement it and it all works
    fine but later I want to add onto it but I can no longer remember what I
    written in and the module itself is not visible within the program.

    When I use the above code in my first post it returns the methods I
    wrote in arrays but nothing else, then the program continues as normal
    this isn't too bad as it helps me remember what methods I used, but, I
    still need to know everything else so instead of taking ages deciphering
    and remembering what else I wrote is it possible to print to screen or
    output the whole script into a .txt document.

    Problem is I didn't make a copy of my module and now the module is there
    and working but I want to add to it without deciphering and without
    adding a new module with aliases.
    --
    Posted via http://www.ruby-forum.com/.
    Burt Hill, Jan 8, 2008
    #2
    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. George Durzi

    Code: Viewing Exchange Contacts in ASP.NET

    George Durzi, Nov 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,896
    George Durzi
    Nov 3, 2003
  2. Eric Lawrence [MSFT]

    Re: Still problems viewing pdf in IE...posting code

    Eric Lawrence [MSFT], Mar 1, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    619
    john farrow
    Mar 2, 2004
  3. =?Utf-8?B?TWF0dGhpYXMgSC4=?=

    Running code when viewing aspx code

    =?Utf-8?B?TWF0dGhpYXMgSC4=?=, Feb 11, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    446
    Stefano
    Feb 11, 2005
  4. Tony Moaikel

    Viewing generated code in ASP.NET

    Tony Moaikel, Nov 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    483
    Juan T. Llibre
    Nov 9, 2005
  5. Your Encryption Site
    Replies:
    11
    Views:
    706
    Kim André Akerø
    Apr 24, 2008
Loading...

Share This Page