Reputation: 19
I have a script which is using rspec tests for automation of the rails app. I don't want to put the file "automation.rb" in the spec folder or in the lib folder (don't want a gem for this code).
My question is: Can we have custom folders in addition to the standard ones in the rails directory structure. Eg. a folder like automation in the root directory of rails app.
Upvotes: 0
Views: 340
Reputation: 52357
Yes, you can have any number of custom folders within your app structure.
The thing to be aware of here, is that if you're going to use code from these folders (why would you have them otherwise?), you'll have to load it.
To not mess things up much, you can add these folders under /app
directory - anything defined there is automatically loaded in all environments.
As to scripts - indeed, you can just store them under the scripts
folder in root directory - it's a common practice (at least I've seen it used in projects I have worked on).
Upvotes: 2