eric/pilfer — pull request #1 by lmarburger (2013-03-17 00:15:49+00:00)
Title: Refactor

Now that the gem and Rails API are proven to work together, it's time to rebuild the gem to have tests and a better UI. Here's how I've been imagining it will work. @eric I'd love your feedback.
```ruby
options = { :service_url => 'http://my-hosted-pilfer.com',
:service_token => 'abc123',
:file_matcher => %r{...},
:app_root => '/dev/null',
:checker => lambda { run_profile? } }

Pilfer::Profiler.profile(options) { do_work }

Pilfer.profile(options) { do_work }

use(Pilfer::Middleware, :service_url => 'http://my-hosted-pilfer.com',
:service_token => 'abc123',
:file_matcher => %r{...},
:app_root => '/dev/null') do
run_profile?
end
```

I'm not very happy with the mess of options needed for the code block usage. I think extracting the object that does the reporting from the object that profiles is where I'm headed. You'll instantiate a `Pilfer::Reporter` and pass it to `Pilfer.profile`.

My biggest focus is on the middleware since that's the first thing that'll be running in production. Once we have use cases for profiling arbitraty blocks of code, we can figure out how it makes sense to design the UI.