typical application structure

J

Joe Van Dyk

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

James Edward Gray II

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
 
J

Joe Van Dyk

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. :(
 
J

James Edward Gray II

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
 
E

Eric Hodel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,920
Members
47,463
Latest member
FinleyMoye

Latest Threads

Top