summer1278/smd-demo — pull request #2 by matth (2014-07-28 22:09:27+00:00)
Title: Re-organise code base

Hi Xia,

I have done a bit of re-organising of the code-base in order to prepare the project for deployment to a server and also to bring it more inline with a standard Ruby project layout. Below is a summary:

* Create `.gitignore` and add some files in there. This means we will not keep things like log files etc in version control

* Move all HTML and Javascript files to the `public` directory. This is a Ruby convention and a good idea to keep stuff for the web front-end separate from the other files. I have also written the script `bin/smd-webserver` to launch the webserver instead of `rackup server.ru`.

* Move all install scripts instructions into a `provisioning` directory. This means we can reuse the scripts on the server not just via Vagrant, and also keeps them separate from the application code.

* Rename `scripts` to be `bin`. Again this is a Ruby convention and good practice.

Are you comfortable accepting this pull request and merging the changes?

I think if tomorrow we can work on the `parse_mp3.rb` script together I can show you a little bit more about how to structure a Ruby project. We can make a directory called `lib` and write some classes in there that are then called from files in the `bin` directory. This is not strictly necessary but does follow standard practice so I'd be keen to spend an hour or so showing you how!

If you want a little background on general Ruby project layouts then below is a good guide and also an example project of mine:

http://ruby.learncodethehardway.org/book/ex46.html
https://github.com/bbcsnippets/redux-client-ruby/tree/version-4

Thanks,

Matt