Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Viewing code

Reply
Thread Tools

Viewing code

 
 
Burt Hill
Guest
Posts: n/a
 
      01-08-2008
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/.

 
Reply With Quote
 
 
 
 
Burt Hill
Guest
Posts: n/a
 
      01-08-2008
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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Are you fed-up with people "viewing" your code, and stealing your HTML code ? Your Encryption Site HTML 11 04-24-2008 11:02 AM
Running code when viewing aspx code =?Utf-8?B?TWF0dGhpYXMgSC4=?= ASP .Net 2 02-11-2005 02:31 PM
PC Viewing vs DVD Player Viewing - MP3 play very fast Ray Donzdorf Computer Support 0 12-11-2004 01:07 PM
Re: Still problems viewing pdf in IE...posting code Eric Lawrence [MSFT] ASP .Net 5 03-02-2004 07:24 AM
Code: Viewing Exchange Contacts in ASP.NET George Durzi ASP .Net 0 11-03-2003 06:19 PM



Advertisments