rpdoc 0.1.8 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +1 -1
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +6 -22
- data/VERSION.md +1 -1
- data/lib/rpdoc/postman_response.rb +53 -13
- data/lib/rpdoc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 243ceb4a0adab54f8a06f34e661c43ad7b33c910366f900707274930d1d54840
|
4
|
+
data.tar.gz: 0d7f8060ff75dd7ad59f33fdb2c75b1442d824c2c6581098a08be68a2758d303
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 233f675ee16f351fa6a36da68f8a7d099d0a333d6e8b4c9672b4d208e4515da4285fad63fdb372c23f6cf8406eb9824cf07f527aade8890f78df7d5f77368b21
|
7
|
+
data.tar.gz: 54f1f4fe0c839b37938115fb25271e39d9b41910d29bad38641e0645ba3b294d69f1b91453426a198e9139cc100b3fa9af0a6f5a9ca4e2a37131b24bc6b634ed
|
data/.gitlab-ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
-
## [0.1.
|
1
|
+
## [0.1.11] - 2022-08-09
|
2
|
+
- Check encoding names using instance (PR#1)
|
3
|
+
|
4
|
+
## [0.1.10] - 2022-07-14
|
5
|
+
- Enable form-data request body
|
6
|
+
|
7
|
+
## [0.1.7, 0.1.8, 0.1.9] - 2022-02-14
|
2
8
|
- Fix rspec parse zip response bug
|
9
|
+
|
3
10
|
## [0.1.6] - 2022-02-14
|
4
11
|
- Update licnese
|
5
12
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rpdoc (0.1.
|
4
|
+
rpdoc (0.1.11)
|
5
5
|
json_requester (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -33,35 +33,19 @@ GEM
|
|
33
33
|
crass (1.0.6)
|
34
34
|
diff-lcs (1.4.4)
|
35
35
|
erubi (1.10.0)
|
36
|
-
faraday (
|
37
|
-
faraday-
|
38
|
-
faraday-em_synchrony (~> 1.0)
|
39
|
-
faraday-excon (~> 1.1)
|
40
|
-
faraday-httpclient (~> 1.0.1)
|
41
|
-
faraday-net_http (~> 1.0)
|
42
|
-
faraday-net_http_persistent (~> 1.1)
|
43
|
-
faraday-patron (~> 1.0)
|
44
|
-
faraday-rack (~> 1.0)
|
45
|
-
multipart-post (>= 1.2, < 3)
|
36
|
+
faraday (2.3.0)
|
37
|
+
faraday-net_http (~> 2.0)
|
46
38
|
ruby2_keywords (>= 0.0.4)
|
47
|
-
faraday-
|
48
|
-
faraday-em_synchrony (1.0.0)
|
49
|
-
faraday-excon (1.1.0)
|
50
|
-
faraday-httpclient (1.0.1)
|
51
|
-
faraday-net_http (1.0.1)
|
52
|
-
faraday-net_http_persistent (1.2.0)
|
53
|
-
faraday-patron (1.0.0)
|
54
|
-
faraday-rack (1.0.0)
|
39
|
+
faraday-net_http (2.0.3)
|
55
40
|
i18n (1.8.10)
|
56
41
|
concurrent-ruby (~> 1.0)
|
57
|
-
json_requester (1.0.
|
42
|
+
json_requester (1.0.7)
|
58
43
|
faraday (>= 1.0.0)
|
59
44
|
loofah (2.12.0)
|
60
45
|
crass (~> 1.0.2)
|
61
46
|
nokogiri (>= 1.5.9)
|
62
47
|
method_source (1.0.0)
|
63
48
|
minitest (5.14.4)
|
64
|
-
multipart-post (2.1.1)
|
65
49
|
nokogiri (1.12.5-x86_64-darwin)
|
66
50
|
racc (~> 1.4)
|
67
51
|
parallel (1.21.0)
|
@@ -132,4 +116,4 @@ DEPENDENCIES
|
|
132
116
|
rubocop (~> 1.0)
|
133
117
|
|
134
118
|
BUNDLED WITH
|
135
|
-
2.2.
|
119
|
+
2.2.32
|
data/VERSION.md
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.11
|
@@ -52,7 +52,7 @@ module Rpdoc
|
|
52
52
|
data[:body] = JSON.pretty_generate(JSON.parse(@rspec_response.body)) rescue nil
|
53
53
|
else
|
54
54
|
body = @rspec_response.body
|
55
|
-
data[:body] = body.encoding ==
|
55
|
+
data[:body] = body.encoding == Encoding::BINARY ? body.force_encoding(Encoding::ISO_8859_1).encode(Encoding::UTF_8) : body
|
56
56
|
end
|
57
57
|
data
|
58
58
|
end
|
@@ -75,13 +75,14 @@ module Rpdoc
|
|
75
75
|
end.compact
|
76
76
|
query_string = @rspec_request.query_string.split('&').map do |string|
|
77
77
|
key, value = string.split('=')
|
78
|
+
next if key.nil? || value.nil?
|
78
79
|
{
|
79
80
|
key: key,
|
80
81
|
value: CGI.unescape(value),
|
81
82
|
text: 'text'
|
82
83
|
}
|
83
|
-
end
|
84
|
-
|
84
|
+
end.compact
|
85
|
+
{
|
85
86
|
method: @rspec_request.method,
|
86
87
|
header: filter_headers,
|
87
88
|
url: {
|
@@ -90,18 +91,57 @@ module Rpdoc
|
|
90
91
|
path: @rspec_request.path.split('/'),
|
91
92
|
query: query_string
|
92
93
|
},
|
93
|
-
body:
|
94
|
+
body: original_request_data_body
|
94
95
|
}
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
end
|
97
|
+
|
98
|
+
def original_request_data_body
|
99
|
+
if @rspec_request.headers['RAW_POST_DATA'].present?
|
100
|
+
json_body = JSON.pretty_generate(JSON.parse(@rspec_request.headers['RAW_POST_DATA'])) rescue nil
|
101
|
+
{
|
102
|
+
mode: 'raw',
|
103
|
+
raw: json_body || @rspec_request.headers['RAW_POST_DATA'],
|
104
|
+
options: {
|
105
|
+
raw: {
|
106
|
+
language: json_body.present? ? 'json' : 'text'
|
107
|
+
}
|
101
108
|
}
|
102
109
|
}
|
103
|
-
|
104
|
-
|
105
|
-
|
110
|
+
elsif @rspec_request.form_data?
|
111
|
+
{
|
112
|
+
mode: 'formdata',
|
113
|
+
formdata: form_data_object_to_array(@rspec_request.request_parameters)
|
114
|
+
}
|
115
|
+
else
|
116
|
+
nil
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def form_data_object_to_array(form_data, prefix: nil)
|
121
|
+
array = []
|
122
|
+
form_data.each do |key, value|
|
123
|
+
key = "#{prefix}[#{key}]" if prefix.present?
|
124
|
+
if value.is_a?(Hash)
|
125
|
+
array += form_data_object_to_array(value, prefix: key)
|
126
|
+
elsif value.is_a?(Array)
|
127
|
+
value.each do |item|
|
128
|
+
array += form_data_object_to_array(item, prefix: "#{key}[]")
|
129
|
+
end
|
130
|
+
elsif value.is_a?(ActionDispatch::Http::UploadedFile)
|
131
|
+
array << {
|
132
|
+
key: key,
|
133
|
+
src: value.original_filename,
|
134
|
+
type: 'file'
|
135
|
+
}
|
136
|
+
else
|
137
|
+
array << {
|
138
|
+
key: key,
|
139
|
+
value: value,
|
140
|
+
type: 'text'
|
141
|
+
}
|
142
|
+
end
|
143
|
+
end
|
144
|
+
array
|
145
|
+
end
|
106
146
|
end
|
107
147
|
end
|
data/lib/rpdoc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yuntai
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json_requester
|