Note that there are some explanatory texts on larger screens.

plurals
  1. POSystem for organizing multi-file Ruby programs?
    text
    copied!<p>Is there a standard or conventional system for organizing multi-file Ruby programs? I have embarked on my first large "project" in Ruby, a search program which is logically organized into multiple files and directories. I've outlined below my potential structure:</p> <ul> <li><em>The main file</em>. This file implements the search class and general searching protocol.</li> <li><em>The algorithmic analysis file</em>. This file implements functions that interpret search results.</li> <li><em>Protocols directory</em> <ul> <li>Contains one file per protocol to search.</li> </ul></li> <li><em>Feeds Directory</em> <ul> <li>Part of the program's purpose is to search archived news feeds. The files for this feature go in this folder.</li> </ul></li> </ul> <p>However, the code currently has a class (let's call it Searcher) that each protocol's search class inherits from (GoogleSearcher &lt; Searcher). In order to manage this, I need to include the main file in these protocol files (right?) which doesn't seem possible given my ideal structure.</p> <p>Aside from my specific example, I was wondering if there are any conventions, such as "more files rather than less", or "logical structuring of files is unnecessary". Is it common to have a file of "helper" functions (such as in Rails?) What level of abstraction is considered appropriate?</p> <p>Finally, I'm planning on integrating this into Rails someday as a library (not a plugin; I want it to work standalone as well). I don't know if this would affect the organization.</p> <p>I know this is a pretty open-ended question, but that's because I would appreciate any advice that is remotely relevant. Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload