# Painting myself into a corner !help!

**URL:** <https://www.ruby-forum.com/t/painting-myself-into-a-corner-help/92470>\
**Category:** Ruby\
**Created:** [April 19, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/painting-myself-into-a-corner-help/92470 "2007-04-19T20:39:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Post date:** [April 19, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/painting-myself-into-a-corner-help/92470/1 "2007-04-19T20:39:32Z")

</div>

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?/

---

<div class="post-metadata">

**Author:** ![bitsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Post date:** [April 19, 2007, 8:54pm UTC](https://www.ruby-forum.com/t/painting-myself-into-a-corner-help/92470/2 "2007-04-19T20:54:42Z")

</div>

On Apr 19, 2007, at 2:39 PM, Dave R. wrote:

> 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 B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![bitsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Post date:** [April 19, 2007, 9:27pm UTC](https://www.ruby-forum.com/t/painting-myself-into-a-corner-help/92470/3 "2007-04-19T21:27:46Z")

</div>

For unc on window.

i.e:  
require ‘//networklocation/option1.rb’  
load ‘//networkloacation/option2.rb’

---

<div class="post-metadata">

**Author:** ![bitsmith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@bitsmith](https://www.ruby-forum.com/u/bitsmith)\
**Post date:** [April 19, 2007, 11:02pm UTC](https://www.ruby-forum.com/t/painting-myself-into-a-corner-help/92470/4 "2007-04-19T23:02:46Z")

</div>

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
