[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

typical application structure

Joe Van Dyk

3/29/2005 9:38:00 PM

Hi,

Is the typical rails application structure like the following? (For a
small application named 'typ') If not, how do you set up your
application directories and what's the rational behind it?

4 Answers

James Gray

3/29/2005 9:44:00 PM

0

On Mar 29, 2005, at 3:37 PM, Joe Van Dyk wrote:

> Hi,
>
> Is the typical rails application structure like the following? (For a
> small application named 'typ') If not, how do you set up your
> application directories and what's the rational behind it?

The secret is to let Rails do all the house keeping for you:

$ rails my_app

Will build the Rails directory structure for you, in a folder called
"my_app". From there, you can use my_app/script/generate to create the
pieces of your application, as needed. This makes sure Rails can help
you as much as possible, while still keeping everything the way it
likes it.

Hope that helps.

James Edward Gray II



Joe Van Dyk

3/29/2005 10:18:00 PM

0

On Wed, 30 Mar 2005 06:44:10 +0900, James Edward Gray II
<james@grayproductions.net> wrote:
> On Mar 29, 2005, at 3:37 PM, Joe Van Dyk wrote:
>
> > Hi,
> >
> > Is the typical rails application structure like the following? (For a
> > small application named 'typ') If not, how do you set up your
> > application directories and what's the rational behind it?
>
> The secret is to let Rails do all the house keeping for you:
>
> $ rails my_app
>
> Will build the Rails directory structure for you, in a folder called
> "my_app". From there, you can use my_app/script/generate to create the
> pieces of your application, as needed. This makes sure Rails can help
> you as much as possible, while still keeping everything the way it
> likes it.
>
> Hope that helps.
>
> James Edward Gray II

What the...

s/rails/ruby/g

Argh. :(


James Gray

3/29/2005 10:35:00 PM

0

On Mar 29, 2005, at 4:17 PM, Joe Van Dyk wrote:

> What the...
>
> s/rails/ruby/g
>
> Argh. :(

Okay, I'll try again. :)

I use:

bin/
executables
db/
sql scripts and other database files
doc/
my documentation and rdoc
examples/
examples of how to use the software
lib/
project libraries
test/
unit tests
util/
any tools I build for the project
vendor/
third party code

I would say most of the above is pretty standard, especially for open
source. A src/ directory is also common, but I've never felt the need
with a Ruby project.

Hope I answered the right question this time.

James Edward Gray II



Eric Hodel

3/29/2005 10:40:00 PM

0

On 29 Mar 2005, at 13:37, Joe Van Dyk wrote:

> Is the typical rails [ruby] application structure like the following?
> (For a
> small application named 'typ') If not, how do you set up your
> application directories and what's the rational behind it?
>
> .
> ./README
> ./lib
> ./lib/typ.rb
> ./lib/typ
> ./lib/typ/typ1.rb
> ./lib/typ/typ2.rb
> ./tests
> ./tests/typ1.rb
> ./tests/typ2.rb

README
install stuff (setup.rb, Rakefile hooking into RubyGems, Makefile, etc).
bin/ (if appropriate)
lib/
test/

RubyGems and setup.rb both know how to install this kind of setup for
you.

--
Eric Hodel - drbrain@segment7.net - http://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04