[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby projects code organization

Simon COURTOIS

8/13/2008 3:54:00 PM

Hi all,

I'm finishing the first version of a project. I want to prepare it to
distribution.
It seems there is no standard about ruby projects code organization.
Is there any ?

I looked the Puppet's project organization, but I don't know if it
follows a standard.
Do you haveany advices, ideas or links to articles about it ?

Thanks :)

--
Happy


4 Answers

Trans

8/13/2008 6:48:00 PM

0



On Aug 13, 11:54=A0am, Simon COURTOIS <happyn...@free.fr> wrote:
> Hi all,
>
> I'm finishing the first version of a project. I want to prepare it to
> distribution.
> It seems there is no standard about ruby projects code organization.
> Is there any ?

There are some general standards. Best place to start:

http://i.loveruby.net/en/projects/setup/doc/...

Beyond that, Hoe, a popular project management tool, defines a minimal
superset of this --if you want to use it.

I have started adding an admin/ directory to my projects to place all
administrative files. This helps separate the distributable files from
the files I use only for development. It also keeps the project root
directory from getting so huge. For example, my projects will look
something like this:

myapp/
COPYING
HISTORY
MANIFEST
METADATA
NEWS
README
admin/
build/
config/
depot/
forms/
log/
notes/
pkg/
plugins/
website/
bin/
demo/
data/
etc/
doc/
rdoc/
ri/
lib/
myapp/
man/
script/
test/

This is the full spread, many of these locations aren't needed for
every project.

T.


Tim Pease

8/13/2008 8:49:00 PM

0


On Aug 13, 2008, at 12:47 PM, Trans wrote:

>
>
> On Aug 13, 11:54 am, Simon COURTOIS <happyn...@free.fr> wrote:
>> Hi all,
>>
>> I'm finishing the first version of a project. I want to prepare it to
>> distribution.
>> It seems there is no standard about ruby projects code organization.
>> Is there any ?
>
> There are some general standards. Best place to start:
>
> http://i.loveruby.net/en/projects/setup/doc/...
>
> Beyond that, Hoe, a popular project management tool, defines a minimal
> superset of this --if you want to use it.
>

Author's plug ... try out Mr Bones if Hoe is not your style ...

http://codeforpeople.rubyforge....


Blessings,
TwP

Simon COURTOIS

8/13/2008 9:35:00 PM

0

Tim Pease wrote:
> On Aug 13, 2008, at 12:47 PM, Trans wrote:
>> On Aug 13, 11:54 am, Simon COURTOIS <happyn...@free.fr> wrote:
>>> Hi all,
>>>
>>> I'm finishing the first version of a project. I want to prepare it to
>>> distribution.
>>> It seems there is no standard about ruby projects code organization.
>>> Is there any ?
>> There are some general standards. Best place to start:
>>
>> http://i.loveruby.net/en/projects/setup/doc/...
>>
>> Beyond that, Hoe, a popular project management tool, defines a minimal
>> superset of this --if you want to use it.
>>
> Author's plug ... try out Mr Bones if Hoe is not your style ...
> http://codeforpeople.rubyforge....
>
> Blessings,
> TwP
Ok :) Thank you both, I'll look a your links, 'seems nice.

--
Simon COURTOIS
{EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Lead
10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 81
http://www.ha...


elliottcable

8/13/2008 11:17:00 PM

0

I'd suggest something a little shorter than what others have - these
are the bare minimum, that you *must* have for a usable gem IMHO:

my_project/
- README.mkdn
- Rakefile.rb
- lib/
- my_project.rb
- my_project/
- another_file.rb
- spec/
- spec_helper.rb
- my_project_spec.rb
- my_project/
- another_file_spec.rb

Of course your requirements will vary, but the concept remains - a
'lib' folder in root, with a file named after your project (this way,
you can distribute your project as a RubyGem, and people can `require
'my_project'` to use your library) as well as a folder named the same
(so they can cherry-pick code from your project if they so like -
`require 'my_project/core_ext/string'` for instance would allow them
to use your String class extensions without having to add the weight
of your entire project to their own).

Spec'ing is a must, IMHO, but that's up to you - if you do so, it's
expedient to have a duplicate of your 'lib' folder named 'spec'
instead, a file mirroring each file in your project in name, with
`_spec` appended to it's name.

On Aug 13, 2008, at 7:54 AM, Simon COURTOIS wrote:

> Hi all,
>
> I'm finishing the first version of a project. I want to prepare it
> to distribution.
> It seems there is no standard about ruby projects code organization.
> Is there any ?
>
> I looked the Puppet's project organization, but I don't know if it
> follows a standard.
> Do you haveany advices, ideas or links to articles about it ?
>
> Thanks :)
>
> --
> Happy
>
>