sjmarshy/tagtime.js — pull request #15 by sjmarshy (2014-08-18 18:31:53+00:00)
Title: refactor(everything):

index:
* formatting: moved Class dependencies into a logical order
* formatting: add comments
* refactor: remove "most popular" functions, require new Tags Class

tags:
* create new Class Tags to handle information about all of the tags
collected so far
api:
* change args for init function, swap logfile for Tags instance
* remove all previous endpoints, did a large refactor of how tags
are handled. removed:
* GET /api/tags
* GET /api/tags/popularity
* GET /api/tags/detail
* GET /api/tags/flat
* GET /api/tags/flat/raw
* add GET /api/tag/:name
retrieve the timeseries data for named tag

logfile:
* moved methods related to tag manipulation to 'Tags' due to
separate concerns
* extend Logfile class from EventEmitter and add two Events:
* 'read' - emitted on construction once the logfile passed
has been read, passes the Object retrieved from the logfile
* 'ping' - emitted when new information is added to the logfile,
passes the time and the plain string tags.

record:
* remove heavy parsing of tags, instead store them as an array of
plain strings
* add doesContainTag method, should quickly see if record contains
a simple string
* removed getTags method, just access #tags man

BREAKING CHANGES:
quite a lot here -
api: none of the API methods are the same, changed them entirely.
tags: new class
logfile: remove all methods related to tag manipulation, simply reads from
and writes to logfile now
record: stores tags in entirely new way