JavaScript Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
lib
mailer
spec
tmp
views
.foreman
.gitignore
.rvmrc
Gemfile
Gemfile.lock
LICENSE
Procfile
README.md
Rakefile
app.rb
config.ru

README.md

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.
  1. git clone
  2. bundle install.
  3. A MailChimp API key saved in the root of the repo as ".secretkey"; get your own. :)
  4. To get hacking, run foreman start. I personally like to run bundle exec shotgun --server=thin -p 4567 if 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:

  1. a RESTful JS application that runs mostly in the browser, save for two POST methods to the MailChimp service [and]
  2. static snapshots of the MailChimp templates for "View Online."

JS REST

  • 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.

Static repository

  • Served out of /mailer
  • Image assets are served out of /assets/mail_static

Todo

  • 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.

Headless Information

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.