heroku/heroku — pull request #253 by steakknife (2012-03-09 11:35:35+00:00)
Title: Push almost all output via display.

This minor refactor allows plugins to filter output by overriding display, et. al. to work correctly.

A couple places weren't touched (i.e., INT traps) as it didn't seem worth it.

Finally, here are the spec results. Note that it's the same failure as on travis.

```
~/github/steakknife/heroku (refactor_to_use_display ✔) ᐅ rake spec
/Volumes/Users/barry/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/heroku/auth_spec.rb ./spec/heroku/client_spec.rb ./spec/heroku/command/addons_spec.rb ./spec/heroku/command/apps_spec.rb ./spec/heroku/command/auth_spec.rb ./spec/heroku/command/base_spec.rb ./spec/heroku/command/config_spec.rb ./spec/heroku/command/db_spec.rb ./spec/heroku/command/domains_spec.rb ./spec/heroku/command/drains_spec.rb ./spec/heroku/command/help_spec.rb ./spec/heroku/command/keys_spec.rb ./spec/heroku/command/logs_spec.rb ./spec/heroku/command/maintenance_spec.rb ./spec/heroku/command/pg_spec.rb ./spec/heroku/command/pgbackups_spec.rb ./spec/heroku/command/plugins_spec.rb ./spec/heroku/command/ps_spec.rb ./spec/heroku/command/releases_spec.rb ./spec/heroku/command/run_spec.rb ./spec/heroku/command/sharing_spec.rb ./spec/heroku/command/ssl_spec.rb ./spec/heroku/command/stack_spec.rb ./spec/heroku/command/version_spec.rb ./spec/heroku/command_spec.rb ./spec/heroku/helpers_spec.rb ./spec/heroku/heroku-postgresql_client_spec.rb ./spec/heroku/heroku-shared-postgresql_client_spec.rb ./spec/heroku/pg_resolver_spec.rb ./spec/heroku/pgbackupsclient_spec.rb ./spec/heroku/plugin_spec.rb
...........................................................................................................................................................................................................................................................................................................................F...............

Failures:

1) Heroku::Client read_logs new style can read new style logs
Failure/Error: @client.read_logs("myapp") do |logs|
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: GET http://api.heroku.com:443/logplex_url with headers {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}

You can stub this request with the following snippet:

stub_request(:get, "http://api.heroku.com:443/logplex_url").
with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
to_return(:status => 200, :body => "", :headers => {})

registered request stubs:

stub_request(:get, "https://api.heroku.com/logplex_url")
stub_request(:get, "https://api.heroku.com/apps/myapp/logs?logplex=true")

============================================================
# ./lib/heroku/client.rb:414:in `block in read_logs'
# ./lib/heroku/client.rb:413:in `read_logs'
# ./spec/heroku/client_spec.rb:140:in `block (4 levels) in '

Finished in 4.46 seconds
331 examples, 1 failure

Failed examples:

rspec ./spec/heroku/client_spec.rb:139 # Heroku::Client read_logs new style can read new style logs

Randomized with seed 5461

Coverage report generated for RSpec to /Volumes/Users/barry/github/steakknife/heroku/coverage. 2263 / 3106 LOC (72.86%) covered.
rake aborted!
/Volumes/Users/barry/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/heroku/auth_spec.rb ./spec/heroku/client_spec.rb ./spec/heroku/command/addons_spec.rb ./spec/heroku/command/apps_spec.rb ./spec/heroku/command/auth_spec.rb ./spec/heroku/command/base_spec.rb ./spec/heroku/command/config_spec.rb ./spec/heroku/command/db_spec.rb ./spec/heroku/command/domains_spec.rb ./spec/heroku/command/drains_spec.rb ./spec/heroku/command/help_spec.rb ./spec/heroku/command/keys_spec.rb ./spec/heroku/command/logs_spec.rb ./spec/heroku/command/maintenance_spec.rb ./spec/heroku/command/pg_spec.rb ./spec/heroku/command/pgbackups_spec.rb ./spec/heroku/command/plugins_spec.rb ./spec/heroku/command/ps_spec.rb ./spec/heroku/command/releases_spec.rb ./spec/heroku/command/run_spec.rb ./spec/heroku/command/sharing_spec.rb ./spec/heroku/command/ssl_spec.rb ./spec/heroku/command/stack_spec.rb ./spec/heroku/command/version_spec.rb ./spec/heroku/command_spec.rb ./spec/heroku/helpers_spec.rb ./spec/heroku/heroku-postgresql_client_spec.rb ./spec/heroku/heroku-shared-postgresql_client_spec.rb ./spec/heroku/pg_resolver_spec.rb ./spec/heroku/pgbackupsclient_spec.rb ./spec/heroku/plugin_spec.rb failed

Tasks: TOP => spec
(See full trace by running task with --trace)
```