[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to include files in ruby webs?

Edward

9/8/2006 3:33:00 AM

What is the equivalent of
include("library.php");
in ruby?

I googled this and "rendering shared partials in ruby" but can't find
anything.

Thanks,

Edward Tanguay
All my projects: http://www.ta...

3 Answers

Logan Capaldo

9/8/2006 3:44:00 AM

0


On Sep 7, 2006, at 11:35 PM, Edward wrote:

> What is the equivalent of
> include("library.php");
> in ruby?
>
> I googled this and "rendering shared partials in ruby" but can't find
> anything.
>
> Thanks,
>
> Edward Tanguay
> All my projects: http://www.ta...
>
>

Check out the docs for require and load.


Chris Gehlker

9/8/2006 3:51:00 AM

0


On Sep 7, 2006, at 8:35 PM, Edward wrote:

> What is the equivalent of
> include("library.php");
> in ruby?

Well, I don't know php but 'require' is the equivalent of #include in
C/C++ except that it automatically adds the guards against multiple
inclusion. You can also leave off the .rb

Just use it like;
require libfile


HTH
--
For blocks are better cleft with wedges,
Than tools of sharp or subtle edges,
And dullest nonsense has been found
By some to be the most profound.
-Samuel Butler,




Darshan Patil

9/8/2006 5:45:00 AM

0

You can use require or load.

require 'filename'
loads filename.rb only once during the current executiion. This is what
you would normally require. I dont know php all that well, but I think
this is what you mean.


Edward wrote:
> What is the equivalent of
> include("library.php");
> in ruby?
>
> I googled this and "rendering shared partials in ruby" but can't find
> anything.
>
> Thanks,
>
> Edward Tanguay
> All my projects: http://www.ta...
>


--
Darshan Patil

"The trouble with work is that it interferes with living." - Peter
Mckill 1968

http://deepy....
http://www.sing...
http://www.cri...
http://www.ringto...