fwbrasil/clump — pull request #19 by williamboxhall (2014-12-20 04:10:33+00:00)
Title: Fine grained fetches

This is a reaction to shortcomings described in https://github.com/fwbrasil/clump/pull/17 and https://github.com/fwbrasil/clump/issues/18

[`clump.run`](https://github.com/fwbrasil/clump/blob/390e0b6c46745e59666410defa3a1eb12521014d/src/main/scala/clump/Clump.scala#L23) now returns `Future[U]` instead of `Future[Option[U]]`

[Change ClumpSource](https://github.com/fwbrasil/clump/blob/390e0b6c46745e59666410defa3a1eb12521014d/src/main/scala/clump/ClumpSource.scala) to allow more fine-tuned fetching: `get`/`getOrElse`/`apply` so the user may decide the behavior when items are not found

This allows users to decide what the behavior should be when secondary resources are not found. Rather than always making the whole thing be a None, they may choose [partial responses](https://github.com/fwbrasil/clump/blob/390e0b6c46745e59666410defa3a1eb12521014d/src/test/scala/clump/IntegrationSpec.scala#L76), or [default response](https://github.com/fwbrasil/clump/blob/390e0b6c46745e59666410defa3a1eb12521014d/src/main/scala/clump/ClumpSource.scala#L21)

@fwbrasil I really think we should merge this