README.md in staccato-0.5.1 vs README.md in staccato-0.5.2

- old
+ new

@@ -8,11 +8,13 @@ [![Gem Version](https://badge.fury.io/rb/staccato.png)](http://badge.fury.io/rb/staccato) [![Build Status](https://travis-ci.org/tpitale/staccato.png?branch=master)](https://travis-ci.org/tpitale/staccato) [![Code Climate](https://codeclimate.com/github/tpitale/staccato.png)](https://codeclimate.com/github/tpitale/staccato) +If you're using Rails and would like to use Staccato, we have an gem for that! [Staccato Rails](https://github.com/tpitale/staccato-rails) + ## Installation Add this line to your application's Gemfile: gem 'staccato' @@ -451,10 +453,24 @@ ## Adapters ## Staccato provides a variety of adapters for sending or debugging requests being made. To use them, first require the adapter by name: `require 'staccato/adapter/#{chosen-adapter-name}'` +Multiple adapters can be used by calling `add_adapter`: + +```ruby +require 'staccato/adapter/validate' + +tracker = Staccato.tracker('UA-XXXX-Y') do |c| + c.add_adapter Staccato::Adapter::Validate.new + c.add_adapter Staccato::Adapter::Logger.new(Staccato.ga_collection_uri) + c.add_adapter Staccato::Adapter::Faraday.new(Staccato.ga_collection_uri) +end +``` + +**Results returned will be in an array, as returned by each adapter in the order the adapters were added.** + ### HTTP Adapters ### Staccato provides a number of basic adapters to different ruby http libraries. By default, Staccato uses `net/http` when you create a new tracker. If you are using Faraday or [The Ruby HTTP library](https://github.com/httprb/http.rb) Staccato provides adapters. ```ruby @@ -515,9 +531,15 @@ require 'staccato/adapter/validate' tracker = Staccato.tracker('UA-XXXX-Y') do |c| c.adapter = Staccato::Adapter::Validate.new end +``` + +See results by printing a call to track any hit: + +```ruby +puts tracker.pageview(path: '/') ``` By default, the staccato `default_adapter` is used to send validation hits, but a different adapter can be used (e.g. `Faraday` or `Net::HTTP`). ```ruby