autotelik / datashift

Full Excel/CSV Import/Export facilities for Rails
http://www.autotelik.co.uk
Other
136 stars 75 forks source link

Library File Structure #52

Closed flyfy1 closed 7 years ago

flyfy1 commented 7 years ago

Currently, the file structure is like this:

/path/to/datashift/
▾ lib/
  ▸ applications/
  ▸ datashift/
  ▸ exporters/
  ▸ generators/
  ▸ java/
  ▸ loaders/
  ▸ tasks/
    datashift.rb
▸ spec/
  CHANGELOG.md
  datashift.gemspec
  datashift.thor
  Gemfile
  LICENSE
  md_style.rb
  Rakefile
  README.md

As we can see, folders like applications are under the lib root path directly. Following this post about best practices, we can see that the current approach would pollute the global load path:

suppose there's another library called loaders, then the current list of files in loaders/files would pollute the original java library.

I'd suggest putting all files under lib/datashift/folder.

autotelik commented 7 years ago

Yes thanks for the feedback, I agree.

As I'm making excuses, this was a classic case of a script turning organically into a library ! .. still work to do :-)

autotelik commented 7 years ago

done