Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: painting myself into a corner !help!
Doan, Alex
4/19/2007 7:26:00 PM
For unc on window.
i.e:
require '//networklocation/option1.rb'
load '//networkloacation/option2.rb'
-----Original Message-----
From: Rob Biedenharn [mailto:Rob@AgileConsultingLLC.com]
Sent: Thursday, April 19, 2007 2:54 PM
To: ruby-talk ML
Subject: Re: painting myself into a corner !help!
On Apr 19, 2007, at 2:39 PM, Dave Rose wrote:
> i just finished writing a 200 line ruby monthend processing (non OO
> procedural, without class/methods)script that i would like to run
> inline (not as thread) invoked like this from the main script
>
> if option=="yes" then
> require/load/???? "\\\networklocation\\option1.rb"
> else if option2=="yes" then
> require/load/???? "\\\networklocation\\option2.rb"
> ...etc...
> how do i do this in ruby?/
Well, first use normal slashes: "/networklocation/option1.rb"
If you're trying to use UNC paths, you might actually need a Windows-
specific library. (I'm on a Mac and can't help more specifically --
sorry.)
Second, you use 'require' to bring one-time definitions into your
program. If you give 'require' the same argument later, it knows that
it already processed that one and does nothing. Use 'load' to process
the contents of the given file every time.
-Rob
Rob Biedenharn
http://agileconsult...
Rob@AgileConsultingLLC.com
1 Answer
dave rose
4/19/2007 9:03:00 PM
0
Doan, Alex wrote:
> For unc on window.
>
> i.e:
> require '//networklocation/option1.rb'
> load '//networkloacation/option2.rb'
...thank you load works ...and ... as usual.... this forum saves the
day...thanx...dave
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: painting myself into a corner !help!
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password