response_mate 0.1.3 → 0.1.4
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
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzI5Njg3MWQzNWU1NjI1ZjIwMzQyMDY2NTYyNzE0NzkzZjU0NWJkOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTg5YjUwZjVhZmRhN2JlNWFhY2RkOTU4NjQ1MTFkMTM1MzVjODEyNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjljNzhjMjNhNjJjZTc1ZWY5YWQ0YWNiNDU5ODhiOTg5MjhiOGEwMDgxMzQ0
|
10
|
+
NGVmYjQwYjg4ZmNmN2UxOTdmN2Y4YjY3YTNkNTQ1YTI3ZDQ4ZGUwYmQyY2I3
|
11
|
+
YjY2MzA1N2RiZjM3NGQ5ZDg5OTJmNDU0Yzg5NWVmNTNlMmJiNzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZThjN2QzMmEwNzFiYzg5ZjE1M2FjMTk2ZGY1M2YxOTEwNzI5ZWI3N2FhNTli
|
14
|
+
NjE0OWQyMTVkZmUwODQ1M2QwNzU1NDJiM2RhZmRlZTEyOWFmNDc0YmNlMzE5
|
15
|
+
ZTUwNThmMzBmMGVhNGJkYzE0MjlkMGM2NGI4OWJkMTVmZjUzYmM=
|
data/lib/response_mate/cli.rb
CHANGED
@@ -57,7 +57,7 @@ module ResponseMate
|
|
57
57
|
desc 'export',
|
58
58
|
'Export to one of the available formats'
|
59
59
|
method_option :requests_manifest, aliases: '-r'
|
60
|
-
method_option :format, aliases: '-f'
|
60
|
+
method_option :format, required: true, aliases: '-f'
|
61
61
|
method_option :pretty, aliases: '-p', default: false
|
62
62
|
def export
|
63
63
|
ResponseMate::Commands::Export.new(args, options).run
|
@@ -12,13 +12,6 @@ module ResponseMate
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def run
|
15
|
-
unless options[:format].present?
|
16
|
-
@options[:format] = choose { |menu|
|
17
|
-
menu.prompt = 'Please pick one of the available formats'
|
18
|
-
menu.choice(:postman)
|
19
|
-
}.to_s
|
20
|
-
end
|
21
|
-
|
22
15
|
output = ResponseMate::Exporter.new(options).export
|
23
16
|
if options[:pretty]
|
24
17
|
puts JSON.pretty_generate(output)
|
@@ -35,10 +35,10 @@ module ResponseMate::Exporters
|
|
35
35
|
def build_requests
|
36
36
|
manifest.requests.each do |request|
|
37
37
|
req = ResponseMate::Manifest.parse_request(request.request)
|
38
|
-
url = if req[
|
39
|
-
"#{req[
|
38
|
+
url = if req[:params].present?
|
39
|
+
"#{req[:path]}?#{req[:params].to_query}"
|
40
40
|
else
|
41
|
-
req[
|
41
|
+
req[:path]
|
42
42
|
end
|
43
43
|
|
44
44
|
out_req = {
|
@@ -46,13 +46,13 @@ module ResponseMate::Exporters
|
|
46
46
|
collectionId: out[:id],
|
47
47
|
data: [],
|
48
48
|
description: '',
|
49
|
-
method: req[
|
50
|
-
name: request
|
49
|
+
method: req[:verb],
|
50
|
+
name: request.key,
|
51
51
|
url: url,
|
52
52
|
version: 2,
|
53
53
|
responses: [],
|
54
54
|
dataMode: 'params',
|
55
|
-
headers: request
|
55
|
+
headers: request.headers || manifest.default_headers
|
56
56
|
}
|
57
57
|
|
58
58
|
out[:order] << out_req[:id]
|