Terminate streaming endpoints with an empty chunk

HTTP Streams must be terminated by an empty chunk, or certain clients
will raise errors. For example, trying to `curl` a streaming endpoint
will finish with:

`curl: (18) transfer closed with outstanding read data remaining`

Ensure that streaming endpoints write an empty chunk, denoted by
"0\r\n\r\n" before closing.

Signed-off-by: David Celis <me@davidcel.is>
Merge pull request #44 from davidcelis/empty-chunks

Terminate streaming endpoints with an empty chunk
Update development dependencies

Update RSpec to version 3. This deprecates the old, monkey-patching
`should` syntax in favor of the newer `expect` syntax, which all of
Crepe's specs have been updated to use.

Additionally, update Cane and Rake.

Signed-off-by: David Celis <me@davidcel.is>
Merge pull request #45 from davidcelis/update-dependencies

Update development dependencies
Rename Util.deep_dup to avoid confusion

Active Support (and others) use deep_dup for slightly different
behavior.

Fixes #38

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Document Util methods

We may want to add more later, e.g., "Crepe uses [X] method to do [Y]."

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Better-document Crepe class methods

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Document Crepe::Config

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Remove Endpoint#dup alias

We can (and should) just call clone directly. We're not relying on dup
getting called elsewhere.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Improve documentation

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Fix documentation typo

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add code example for Crepe::Config#scope

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Better-document url_for

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Clean up documentation

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Better frozen params behavior

Rather than freezing the underlying store, let's freeze values when
accessed.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Don't freeze params

While immutability is generally a good thing, Ruby just doesn't like it,
and neither do its popular libraries.

We can revisit this in the future, but for now it makes things too
brittle.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Remove Pagination renderer

Simple APIs rarely need pagination. Complex APIs will probably need to
implement their own.

In any case, this doesn't belong in Crepe-proper. If we want to make a
more configurable plug-in, this could be a good start for
crepe-pagination.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Flat world

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Create and mount Endpoint subclasses instead of instances

Multiple benefits:

- Increases composability and flexibility. If desired, Crepe::Endpoint can
  even be subclassed (like Crepe::API) and mounted in any Rack framework.

- Consistency and discoverability. Now, both API and Endpoint are subclassed
  in a similar way, and discoverable, readable constants are created for these
  subclasses for easier introspection.

- Future API possibilities. We could potentially allow Endpoints to be used
  instead of blocks when defining an API: `get '/user', with: UserEndpoint`

- Performance. It's hard to benchmark this precisely, but I'm seeing anywhere
  from 5-10% improvement. Nothing to laugh at.

Signed-off-by: Evan Owen <evan@cotap.com>
Allow Endpoint handler to be access directly and using #to_proc

Allows: `get &AllWiggles` inside `Crepe::API`.

Signed-off-by: Evan Owen <kainosnoema@gmail.com>