README.md in wercker_api-0.1.10 vs README.md in wercker_api-1.0.1

- old
+ new

@@ -1,8 +1,7 @@ [![wercker status](https://app.wercker.com/status/15fd697b0b3ff854e408a5c256e6737b/s/master "wercker status")](https://app.wercker.com/project/byKey/15fd697b0b3ff854e408a5c256e6737b) -[![Code Climate](https://codeclimate.com/github/StupidCodeFactory/wercker_api/badges/gpa.svg)](https://codeclimate.com/github/codeclimate/codeclimate) -[![Test Coverage](https://codeclimate.com/github/StupidCodeFactory/wercker_api/badges/coverage.svg)](https://codeclimate.com/github/codeclimate/codeclimate/coverage) + # WerckerAPI Thin ruby wrapper around [wercker API](http://devcenter.wercker.com/docs/api) ## Installation @@ -28,9 +27,27 @@ client = WerckerAPI::Client.new(token) client.applications('StupidCodeFactory') # => ApplicationCollection ``` + +# Trigger a pipeline run PipelineRunner # + +```ruby + + client = WerckerAPI::Client.new(token) + + # Will poll the build every 60 seconds for 5 times maximum + runner = WerckerAPI::PipelineRunner.new(client, max_attempts: 5, delay: 60) + + # Blocking call that polls the pipeline and returns a WorkerAPI::Run instance or raise a WerckerAPI::PipelineRunner::Timeout + run = runner.run # => #<0x007fa4b509bcd8 WorkerAPI::Run id: '125344f34v34'...> + run.result # => 'passed' +``` + +## API Documentation + +Full gem documentation on [rubydoc.info](http://www.rubydoc.info/gems/wercker_api) and API reference at [wercker.com](http://devcenter.wercker.com/docs/api) ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.