Skip to content

Instantly share code, notes, and snippets.

@radar
Created April 1, 2012 03:17
Show Gist options
  • Save radar/2270943 to your computer and use it in GitHub Desktop.
Save radar/2270943 to your computer and use it in GitHub Desktop.
  1. I find a mistake in the book or somebody else points one out using the review system's notes.
  2. I fix the mistake in the ERB/XML version of the book.
  3. The ERB/XML version is then automatically converted into an XML document via a running Guard process.
  4. I commit both files to the Git repository for the book, and then push these to GitHub
  5. GitHub tells the review tool that a push has occurred, and sends through a push notification.
  6. The review tool receives the notification and stores a job in Resque to parse the book.
  7. A resque worker runs the job, detecting which files have changed and then updates just those chapters.
  8. For each chapter, each element is processed individually using an XSLT file and stored in a MongoDB database as HTML (I know, right?)
  9. When a user requests a chapter, this page is then read from the database and then cached back to Redis.
  10. Every time a chapter is updated, be it by the automated process or by a user putting a note on the book, the cache is reset.

OMG.

@jumph4x
Copy link

jumph4x commented Apr 1, 2012

Damn dude, no kidding...

@Spaceghost
Copy link

@radar, you're something of a one man cyberspace juggling act, you know?

@bsodmike
Copy link

That's just incredible. OMFG...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment