rreplay 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df1ba81f052a9eca78ff75466a5f3cb5d79d8eac293fc88e991153649f3074f5
4
- data.tar.gz: 1c2dcdc2a6d633750c7fdfc116c90de736a95bd2f73c01b8202445675f5970d0
3
+ metadata.gz: 507bbd393bd742145e99d1c67c4e038f6dc197e764cf40108f989234e8956290
4
+ data.tar.gz: 03414e0fca37098bc54a95928e8e581a21a6aa828f36c729c4958a2deccc628c
5
5
  SHA512:
6
- metadata.gz: 66e8b80d877d22e33335e360301143dabd273a8c9caf451b0b9437e831d5a9e7669332ccec8c18e977b6b6a54ea101aed68ed937784e3972f5fe10ca57b5b944
7
- data.tar.gz: 4691481c1a6cd91c6e7e0022b896f027446b79f28262b7b9644ed89b66a6b14aa1d2368fbad0600127f6e606cfdceb5655cfe9721cab235c5fe69b04d968c999
6
+ metadata.gz: c794773f59f030729ea155bbd0e728e88471d2193cbc1ff3e90b2bebb8c43d53f0f68e3f46d7a240e8d6e5e342050ef5076d045c39fe66f6d1792968b2c32892
7
+ data.tar.gz: adfe68cd9db097139e1fe543031c8b751c759c13bb3f82c8ce2b638a278281c068f6af626b01c73730b67cbc5fa85aa9a4f73e182629464f796e6882ea129532
@@ -0,0 +1,27 @@
1
+ name: test
2
+ on: [push]
3
+
4
+ jobs:
5
+ build:
6
+ runs-on: ubuntu-latest
7
+
8
+ steps:
9
+ - uses: actions/checkout@v1
10
+
11
+ - name: Set up Ruby 2.7
12
+ uses: clupprich/ruby-build-action@master
13
+ with:
14
+ ruby-version: 2.7.0
15
+
16
+ - uses: actions/cache@v1
17
+ with:
18
+ path: vendor/bundle
19
+ key: bundle-${{ hashFiles('**/Gemfile.lock') }}
20
+
21
+ - name: Bundle install
22
+ run: |
23
+ bundle -j 4 --path vendor/bundle
24
+
25
+ - name: Run Tests
26
+ run: |
27
+ bundle exec rake test
data/.gitignore CHANGED
@@ -6,4 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- **/*.log
9
+ **/rreplay.log*
data/README.md CHANGED
@@ -39,6 +39,8 @@ This configuration enables rreplay to record HTTP request and response, and writ
39
39
 
40
40
  Please see the implementation of [rack/rreplay.rb](https://github.com/petitviolet/rreplay/blob/master/lib/rack/rreplay.rb).
41
41
 
42
+ ![demo](./rreplay-demo-record.gif)
43
+
42
44
  ### HTTP request replay
43
45
 
44
46
  Use `bundle exec rreplay <endpoint> <target>` to send recorded HTTP request in <target> to <endpoint>.
@@ -50,6 +52,8 @@ $ bundle exec rreplay 'https://example.com' ./rreplay_tmp/rreplay.log.msgpack --
50
52
 
51
53
  Please call `bundle exec rreplay --help` to see arguments and available options.
52
54
 
55
+ ![demo](./rreplay-demo-replay.gif)
56
+
53
57
  ## Development
54
58
 
55
59
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/rack/rreplay.rb CHANGED
@@ -92,10 +92,18 @@ module Rack
92
92
  {
93
93
  'status' => status,
94
94
  'headers' => headers,
95
- 'body' => body.join(''),
95
+ 'body' => response_body(body),
96
96
  }
97
97
  end
98
98
 
99
+ def response_body(body)
100
+ return body unless body.respond_to?(:each)
101
+
102
+ [].tap do |b|
103
+ body.each { |content| b << content }
104
+ end.join('')
105
+ end
106
+
99
107
  def request_hash(env)
100
108
  headers = {
101
109
  'content-type' => env['CONTENT_TYPE'],
Binary file
Binary file
data/rreplay.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "rreplay"
3
- spec.version = "0.1.0"
3
+ spec.version = "0.1.1"
4
4
  spec.authors = ["petitviolet"]
5
5
  spec.email = ["violethero0820@gmail.com"]
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rreplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - petitviolet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-29 00:00:00.000000000 Z
11
+ date: 2019-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -133,6 +133,7 @@ executables:
133
133
  extensions: []
134
134
  extra_rdoc_files: []
135
135
  files:
136
+ - ".github/workflows/action.yaml"
136
137
  - ".gitignore"
137
138
  - ".ruby-version"
138
139
  - ".travis.yml"
@@ -150,6 +151,8 @@ files:
150
151
  - lib/rreplay/debugger.rb
151
152
  - lib/rreplay/format.rb
152
153
  - lib/rreplay/replay_runner.rb
154
+ - rreplay-demo-record.gif
155
+ - rreplay-demo-replay.gif
153
156
  - rreplay.gemspec
154
157
  homepage: https://github.com/petitviolet/rreplay
155
158
  licenses: