Project

playback

0.0
No commit activity in last 3 years
No release in over 3 years
Execute http request from apache access log
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 1.6
~> 10.0
>= 0

Runtime

 Project Readme

Playback Build Status Code Climate

Execute http request from apache access log

Installation

$ gem install playback

Usage

as a command line tool

$ 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

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