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.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install runscope-rb
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
There are a few options to set:
A string for the bucket key from Runscope. Default is
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
A boolean to control if Runscope is used at all. Set to
false to stop using Runscope. Default is
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.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request