0.0
No commit activity in last 3 years
No release in over 3 years
Start using Runscope to monitor your API traffic in minutes
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 1.6.1
~> 1.1.1
>= 0
~> 2.13.0
~> 1.13.0
 Project Readme

runscope-rb

Dependency Status

A gem to quickly get up and running with Runscope in a few lines of code.

runscope-rb currently supports Net::HTTP requests. Requests made using other HTTP libraries, such as libcurl or sockets, won't be modified. If you want to add support for another HTTP library that would be fantastic. See the section on Contributing at the end of the readme.

Installation

Add this line to your application's Gemfile:

gem 'runscope-rb'

And then execute:

$ bundle

Or install it yourself as:

$ gem install runscope-rb

Usage

Obviously you'll need a Runscope account to use this. Then just run the configure block below within your code. If you're making a Rails app you probably want to put it in config/initializers/runscope.rb.

Runscope.configure do |config|
  config.bucket  = "abcd1234"
  config.domains = ["api.stackexchange.com", "api.github.com", /\S+\.desk\.com/]
end

Options

There are a few options to set:

bucket Required

A string for the bucket key from Runscope. Default is nil.

domains Required

An array of strings and regular expressions to match outbound traffic against. Any requests through Net::HTTP that don't match one of these will pass through unaltered. Default is [].

enabled

A boolean to control if Runscope is used at all. Set to false to stop using Runscope. Default is true.

Troubleshooting

If your requests aren't being sent through Runscope after you're set up, check how the request is being made. If it's not using Net::HTTP it won't work at this time. Check the section below on Contributing if you want to add support for another HTTP library.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request