Sha256: 9898f2885819d1acf55f4fa1038ecade1226322d40093bd02921233d5d126248

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

# Playback
[![Build Status](https://travis-ci.org/takady/playback.svg?branch=master)](https://travis-ci.org/takady/playback) [![Code Climate](https://codeclimate.com/github/takady/playback/badges/gpa.svg)](https://codeclimate.com/github/takady/playback)  
execute http request from access log  
supported log format: apache(common, combined and customized base on combined)

## Installation

    $ gem install playback

## Usage

### as a command line tool
```sh
playback 'http://httpbin.org' /path/to/access.log
#=> { "method": "GET", "path": "/get", "status": 200 }
#=> { "method": "POST", "path": "/post?hoge=1", "status": 404 }
#=> { "method": "PUT", "path": "/put?foo=bar", "status": 200 }
#=> :
#=> :
```

### as a part of code
```ruby
require 'playback'

p = Playback::Request.new('http://httpbin.org')
File.open '/path/to/access.log' do |file|
  file.each_line do |line|
    puts p.run(line)               #=> { "method": "GET", "path": "/get", "status": 200 }
    puts p.run(line, 'net-http')   #=> #<Net::HTTPOK:0xb8309eb4>
  end
end
```

## Contributing

1. Fork it ( https://github.com/takady/playback/fork )
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 a new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
playback-1.0.0 README.md