Created
March 21, 2012 12:18
-
-
Save sent-hil/2146566 to your computer and use it in GitHub Desktop.
Rearrangement of Rails folder structure based on 'Architecture the Lost Years'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rearrangement of Rails folder structure based on Robert Martins' Keynote: Architecture the Lost Years. | |
# This structure was meant to say 'I am a web app that does x and y and only incidentally uses Rails'. | |
# I'm interested in knowing if: | |
# 1. Is this viable in the long run? | |
# 2. Can you tell what the app does? | |
|── Gemfile | |
├── Gemfile.lock | |
├── Readme | |
│── authentication | |
│ ├── sessions_controller.rb | |
│ ├── user.rb | |
│ └── users_controller.rb | |
│── repo_statistics | |
│ ├── repo.rb | |
│ └── repo_controller.rb | |
├── rails | |
│ ├── boot.rb | |
│ ├── log | |
│ │ ├── development.log | |
│ │ └── production.log | |
│ └── rack.ru | |
├── spec | |
│ └── acceptance | |
│ └── authentication_spec.rb | |
└── vendor |
I like the typical gem-compatible folder structure for a model:
├── Gemfile
├── lib/
│ ├── appname.rb
│ ├── appname/
│ │ ├── user.rb
│ │ ├── user_authenticator.rb # Service object to fetch a User object
│ │ ├── repo.rb
├── spec/
Uncle Bob said himself you could bundle this up as a gem and plug it in somewhere else, i.e. your Rails app.
Without a frontend, though, a service object like the UserAuthenticator
won't be used anywhere but in the tests. I haven't decided whether that might be a problem, yet.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
original Rails structure