[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby apps useing multiple files

Nigel Wilkinson

9/28/2006 9:23:00 PM

Hi folks

I'm writing an app in ruby and want to split it into more than one file
to make it more manageable. How do I get the main file to include the
others. Do I use some sort of include, require or load command or is
there some sort of library command like TCL has.

Cheers
Nigel

6 Answers

Jano Svitok

9/28/2006 9:37:00 PM

0

On 9/28/06, Nigel Wilkinson <nigel@waspz.co.uk> wrote:
> Hi folks
>
> I'm writing an app in ruby and want to split it into more than one file
> to make it more manageable. How do I get the main file to include the
> others. Do I use some sort of include, require or load command or is
> there some sort of library command like TCL has.
>
> Cheers
> Nigel

require 'filename' is the proper one. you can use load 'filename' if
you want to reload the file each time load is called (require loads
the file only once)

$: is load path, where require/load look for files (NB: it's an Array)

J.

Tim Hunter

9/28/2006 9:45:00 PM

0

Nigel Wilkinson wrote:
> Hi folks
>
> I'm writing an app in ruby and want to split it into more than one file
> to make it more manageable. How do I get the main file to include the
> others. Do I use some sort of include, require or load command or is
> there some sort of library command like TCL has.
>
> Cheers
> Nigel
>
>
Use ri to read about "require" and "Kernel#load".

Nigel Wilkinson

9/28/2006 9:51:00 PM

0

On Fri, 29 Sep 2006 06:36:44 +0900
"Jan Svitok" <jan.svitok@gmail.com> wrote:

> On 9/28/06, Nigel Wilkinson <nigel@waspz.co.uk> wrote:
> > Hi folks
> >
> > I'm writing an app in ruby and want to split it into more than one
> > file to make it more manageable. How do I get the main file to
> > include the others. Do I use some sort of include, require or load
> > command or is there some sort of library command like TCL has.
> >
> > Cheers
> > Nigel
>
> require 'filename' is the proper one. you can use load 'filename' if
> you want to reload the file each time load is called (require loads
> the file only once)
>
> $: is load path, where require/load look for files (NB: it's an Array)
>
> J.
Thanks for that, however the "is load path" reference confuses me, I
can't find a reference to it in "Ruby in a nutshell". Can you point me
to a reference please or give an example of its use.

Cheers
Nigel

Reprisal

9/28/2006 10:03:00 PM

0

the global variable $:
is a synonym for $LOAD_PATH
which is an array of paths to search for required/loaded files

On Sep 28, 2006, at 5:51 PM, Nigel Wilkinson wrote:

> On Fri, 29 Sep 2006 06:36:44 +0900
> "Jan Svitok" <jan.svitok@gmail.com> wrote:
>
>> On 9/28/06, Nigel Wilkinson <nigel@waspz.co.uk> wrote:
>>> Hi folks
>>>
>>> I'm writing an app in ruby and want to split it into more than one
>>> file to make it more manageable. How do I get the main file to
>>> include the others. Do I use some sort of include, require or load
>>> command or is there some sort of library command like TCL has.
>>>
>>> Cheers
>>> Nigel
>>
>> require 'filename' is the proper one. you can use load 'filename' if
>> you want to reload the file each time load is called (require loads
>> the file only once)
>>
>> $: is load path, where require/load look for files (NB: it's an
>> Array)
>>
>> J.
> Thanks for that, however the "is load path" reference confuses me, I
> can't find a reference to it in "Ruby in a nutshell". Can you point me
> to a reference please or give an example of its use.
>
> Cheers
> Nigel
>


David Roberts

9/29/2006 9:33:00 AM

0

Nigel Wilkinson wrote:
>> $: is load path, where require/load look for files (NB: it's an Array)
>>
>> J.
> Thanks for that, however the "is load path" reference confuses me, I
> can't find a reference to it in "Ruby in a nutshell". Can you point me
> to a reference please or give an example of its use.
>

Ruby in a Nutshell: Section 3.1 Predefined Variables

--
Posted via http://www.ruby-....

Frank Berger

8/19/2011 10:40:00 PM

0

Oscar wrote:
> On Aug 19, 2:34 pm, Frank Berger wrote:
>>
>> Copyrights provide a certain amount of monopoly power. That is a
>> simple statement of fact and, of course, that is exactly what they
>> arte intended to do. Saying this conveys zero information about what
>> I think about copyrights. Monopoly power can be achieved by legal
>> and illegal means.
>> Note that the monopoly power from copyrights is not absolute. If the
>> holder of the copyright of performance A of a particular work tries
>> to charge too much for it, people can always buy performance B. But
>> as performance A is unique, an element of monopoly power remains.
>>
>> Business people tend to act in their own best interests and have
>> been known to collude, whether such collusion is legal or illegal.
>> These are also simple statements of fact.
>
> Uhh...thanks for the primer, but how does any of this pertain to
> ArkivMusic's exclusive-to-USA reissue of Juililard Bartok SQ and the
> 'grasping covetousness' (to be taken for granted, you say) and
> 'collusion' (the 'likely answer') behind its issue as a basic license
> on 3CD's?

I simply raised the question of why they would charge for 3 full-price CDs?