This is a fully-functioning dual-REST application for TW Recruiting.
Installation & Application Requirements
- Ruby 1.9.2 (for compatibility with Heroku's Cedar Stack) & Rubygems (Bundle). rvm recommended; .rvmrc checked into the repo.
- A MailChimp API key saved in the root of the repo as ".secretkey"; get your own. :)
- To get hacking, run
foreman start. I personally like to run
bundle exec shotgun --server=thin -p 4567if editing the Ruby app directly. Otherwise, Sprockets will reload the application.js / application.css if you're working in the Sammy app.
Architecture and Design
This Rack application, running on Sinatra, manages the two components of the repository:
- a RESTful JS application that runs mostly in the browser, save for two POST methods to the MailChimp service [and]
- static snapshots of the MailChimp templates for "View Online."
- Served out of /assets, which is managed by Sprockets
- sammy-routes.js develops the routes for information collection, record CRUD from localStorage, and keychain/authentication management.
- Two POST routes interface information collection from the JS app into MailChimp.
- Served out of /mailer
- Image assets are served out of /assets/mail_static
- Transition to Sass
- Some pieces are done.
- Fully implement headless RSpec/Capybara without having to rewrite my tests in JS for Zombie.js
- Why? It takes 1m to run 15 tests right now. o_O
- More tests. Always, more tests.
Status of the endeavour: capybara-webkit doesn't support localStorage; there is a version of the gem referenced (but commented out) in the Gemfile that hypothetically supports it, but it has not yet been integrated into the master branch of the canonical repository.
The other option, capybara-zombie is an unfortunately immature library, and seems to have been abandoned. I've forked the repo to investigate, but I am loath to introduce an additional dependency (node.js & friends) for people who want to help out.