apidragon 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/VERSION +1 -1
- data/bin/apidragon +1 -1
- data/lib/apidragon/macro.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba5645d669bed63e76fa86bb835fc5f0ab27b874
|
4
|
+
data.tar.gz: bf3ff860f629dd508006626bee57bff1685583f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdf4c6a02cc8f8fec3e89e7345c46af29f6b1118ca8f5b1c5f4a0c5cbbd317b4c250c2aef10b6fb55787d8c1eacb356ff2c920abd9debe6b3c8266093df5ce8d
|
7
|
+
data.tar.gz: 26c6832181e0a17d7754d7e40559e77ccebb4a97bb8f2623db9b565de46a38289412c597b42a453de4e0308438b4edb80ed6b7b174a018c6e9fd6ba5495e9762
|
data/README.md
CHANGED
@@ -113,7 +113,9 @@ Each call can have a `record` option, where you can specify what output variable
|
|
113
113
|
```
|
114
114
|
|
115
115
|
## Qualifier variables
|
116
|
-
|
116
|
+
apidragon automatically returns the first instance it finds of the specified output variable in the response.
|
117
|
+
|
118
|
+
For more specific output parsing, you can specify a qualifier variable. As long as responses are returned as `xml` or `json`, output variables can be associated with one of your pre-defined values for cases like parsing lists of values that have several attribute fields.
|
117
119
|
|
118
120
|
- e.g.:
|
119
121
|
```yaml
|
@@ -125,12 +127,12 @@ Further, for more specific output parsing, you can specify a qualifier variable.
|
|
125
127
|
So if the call returns a list like this: `[{username => bob, id => 1234}, {username => alice, id => 5678}]`, you can always return the `id` associated with the `username` variable defined in the `vars` section.
|
126
128
|
|
127
129
|
## logging
|
128
|
-
|
130
|
+
Loggin can be disabled by specifying `logging` to be `false`, as per below.
|
129
131
|
|
130
132
|
- e.g.:
|
131
133
|
```yaml
|
132
134
|
testcall:
|
133
|
-
logging:
|
135
|
+
logging: false
|
134
136
|
```
|
135
137
|
|
136
138
|
## plugin
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.5
|
data/bin/apidragon
CHANGED
@@ -6,7 +6,7 @@ require_relative '../lib/apidragon.rb'
|
|
6
6
|
|
7
7
|
Commander.configure do
|
8
8
|
program :name, 'apidragon'
|
9
|
-
program :version, '1.4.
|
9
|
+
program :version, '1.4.5'
|
10
10
|
program :description, 'CLI for automating api requests'
|
11
11
|
program :help, 'Author', 'Isaiah Thiessen <isaiah.thiessen@telus.com>'
|
12
12
|
|
data/lib/apidragon/macro.rb
CHANGED
@@ -99,10 +99,11 @@ class Call < ArgBucket
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def xml_to_json
|
102
|
-
@response =
|
102
|
+
@response = Hash.from_xml(@response).to_json unless !@response.include?('<?xml')
|
103
103
|
end
|
104
104
|
|
105
105
|
def parse_response
|
106
|
+
@response = JSON.parse @response
|
106
107
|
@output.each do |var|
|
107
108
|
if var.is_a? String
|
108
109
|
parser = Parser.new(var, nil, @response)
|