elliottcable
8/13/2008 11:17:00 PM
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
>
>