UWFlow/rmc — pull request #192 by mduan (2014-07-18 00:03:51+00:00)
Title: Fix some schedule parsing issues

Fixes two schedule parsing issues:
- Incorrectly parsing courses with "TBA" or is empty for the slot time.
- Incorrectly parsing professors with apostrophe in name.

There's significant changes to the regex code, which may be unexpected given it's only to fix the two small issues mentioned above. However, this is because regex matching for an empty value for the slot time was in some cases very slow using the existing parsing logic. So I had to refactor some of the code to make it more performant.

Also includes some refactoring of the data structure for storing the parsed schedule items. Originally we were creating just a single list of `processed_items` (each one corresponding to a user schedule item) to send to the server. This PR changes that splits the single `processed_items` list into multiple lists of schedule items, one for each course. This makes it easier to figure out how many schedule items we found for each course (so if we get zero for a course, we know its schedule times are TBA).

For testing, I added mocha tests that cover these two issues. Also, tested on localhost with the failing schedules + a previously working schedule.

For a previously working schedule + schedule with apostrophe in prof name:
- Calendar shows all the schedule items
- Courses are added to the user's course history

For the schedule with TBA for the slot time, tested that:
- We show an alert that tells the user which courses are missing information
- Courses are still added to the user's course history
- Courses do not show in calendar