Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespacing and structure #4

Closed
kaapa opened this issue May 20, 2015 · 2 comments
Closed

Namespacing and structure #4

kaapa opened this issue May 20, 2015 · 2 comments

Comments

@kaapa
Copy link

kaapa commented May 20, 2015

Food for thought

I'd like to think that this gem is the reference implementation for Refile 3rd party backend gems. From that point of view the current structure suggests placing backend implementations directly under Refile namespace is the preferred practice.

Hence I'd like to propose the following structure to avoid promoting pollution of the root Refile namespace by silly backend implementors releasing their own gems:

  • /lib/refile/s3.rb
    • defines Refile::S3 module
    • requires refile/s3/version and refile/backend/s3
  • /lib/refile/s3/version.rb
    • defines Refile::S3::VERSION
  • /lib/refile/backend/s3.rb
    • implements the backend in Refile::Backend::S3 class

PS. I hope the tone of my post does not come through as patronizing - I'm certain @jnicklas has way more experience in structuring and gardening open source projects than I do. 😇

@jnicklas
Copy link
Contributor

I thought about this and decided on the current structure because of the following reasons:

  • I want gem name and file structure to match. If the file structure were as you mentioned, the gem should have been called refile-backend-s3. This wouldn't have been so bad, except...
  • Prior art. There are already several backend implementations out there simply called refile-something. Calling this gem something else would have been inconsistent with refile-fog, refile-postgres etc...
  • Namespace clashes are unlikely.
  • Rubygems restricts the namespace anyway, so clashes shouldn't happen.

@kaapa
Copy link
Author

kaapa commented May 20, 2015

Ok, thank you for the explanation! Just wanted to make sure it was a thought out decision instead of an overlook while splitting the gem out of the main library.

@kaapa kaapa closed this as completed May 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants