rreplay 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/action.yaml +27 -0
- data/.gitignore +1 -1
- data/README.md +4 -0
- data/lib/rack/rreplay.rb +9 -1
- data/rreplay-demo-record.gif +0 -0
- data/rreplay-demo-replay.gif +0 -0
- data/rreplay.gemspec +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 507bbd393bd742145e99d1c67c4e038f6dc197e764cf40108f989234e8956290
|
|
4
|
+
data.tar.gz: 03414e0fca37098bc54a95928e8e581a21a6aa828f36c729c4958a2deccc628c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
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
|
+

|
|
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
|
+

|
|
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
|
|
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
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.
|
|
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-
|
|
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:
|