What's new? | Help | Directory | Sign in
Google
substruct
Open-source Ruby on Rails E-Commerce
  
  
  
  
    
Search
for
Updated Feb 12, 2008 by subimage
Labels: Phase-Implementation
ContributingToSubstruct  
Guidelines for contributing to Substruct

Introduction

If you'd like to add something to Substruct we'd love to see what you have to offer.

Please follow the following guidelines when proposing any patch.

Respect the original style

Respect the coding style of the original files you're editing.

If a patch is submitted which doesn't satisfy the component's coding conventions, then either a committer will need to rewrite the submission or it will be rejected. Getting it right in this first place will save you having to rewrite it.

Spaces Not Tabs

PLEASE NO TABS!

The source should be indented using spaces rather than tabs. The standard indentation is 2 spaces per indent - but respect the number of spaces used by the original.

Some IDEs include automatic source (re)formatting. If you use an IDE, please check that this feature is either disabled or set to use (2) spaces.

If a patch is submitted which uses tabs rather than spaces, then either a committer will have to reformat it before it's applied or the patch will be rejected. Again, it's easier to get it right in the first place rather than have to reformat and resubmit your patch.

Test Cases

If possible please include test cases. Yes, we know the tests are lacking for Substruct right now. Please help us improve that.

Creating Patch Files

Please create your patch against the latest revision of the files in the source code repository (TRUNK) since this makes the job of applying the patch much easier. If you don't have a version checked out, then check one out. If you have, then please do a fresh update before you make your changes.

The patch should be in unified format. You can create a patch in this format (from Subversion) by using:

svn diff File >> patchfile

Try to give your patch files meaningful names. This makes it easier for developers who need to apply a number of different patches.

Submitting your Patch

Please use our Issue tracker on Google Code to submit all patch files. Provide a clear description of what the patch file does, and why you're submitting it.

Multiple files should be archived via zip, gzip, or tar.


Comment by bcreeve, Feb 22, 2008

Is there any information on creating modules?

Comment by edmundo.vn, Feb 24, 2008

For those that doesn't know how to work with plugins very well, you can make changes made inside substruct reload automatically with something like that, creating an initializer and saying to reload it always:

/config/initializers/always_load_these_paths.rb

SUBSTRUCT_ROOT="#{RAILS_ROOT}/vendor/plugins/substruct"

Dependencies.load_once_paths.delete("#{SUBSTRUCT_ROOT}/app/controllers")
Dependencies.load_once_paths.delete("#{SUBSTRUCT_ROOT}/app/helpers")
Dependencies.load_once_paths.delete("#{SUBSTRUCT_ROOT}/app/models")
Dependencies.load_once_paths.delete("#{SUBSTRUCT_ROOT}/lib")

Sign in to add a comment