nanoc/nanoc — pull request #217 by ddfreyne (2013-02-10 21:17:20+00:00)
Title: Find item by identifier

This implements #214.

First of all, this allows accessing items using `@items['/foo/']` instead of the much more cumbersome `@items.find { |i| i.identifier == '/foo/' }`.

It also keeps a cache of the mapping of identifier onto items, so that the complexity of finding an item by identifier is now O(1) instead of O(n). This makes the implementation quite a bit more difficult, because items can change identifiers during preprocessing.