iAuditor 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 +4 -4
- data/lib/iAuditor/audit.rb +22 -7
- data/lib/iAuditor/base.rb +0 -2
- data/lib/iAuditor/base_modules.rb +2 -2
- data/lib/iAuditor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a3c6d766508bd9ac27f7a7b5d367d912b0af289
|
4
|
+
data.tar.gz: f058622af02f513253e5b34297b7db30de25564a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f01fbf3a00c5db1336e44ffe69894d2ee0d78b3b53e19f5aabd01155d94b5a90d483cc962bb747082ceac902a4fdbfbffe72e7b95f349d36dcdacb56c1aaa7
|
7
|
+
data.tar.gz: 5e66b831d4f17d0674d2ee0dec9b264b489a21cfad9210fc18962658ad21e5c1afc9d776125b04ff10705c578835e2c8a86bfba0c0aec5705fbf62425339b545
|
data/lib/iAuditor/audit.rb
CHANGED
@@ -14,7 +14,6 @@ module IAuditor
|
|
14
14
|
def fetch(audit)
|
15
15
|
@audit = self.class.get("/audits/#{audit}", @options)
|
16
16
|
@audit.parsed_response
|
17
|
-
|
18
17
|
end
|
19
18
|
|
20
19
|
# Retrieving audit link
|
@@ -27,20 +26,25 @@ module IAuditor
|
|
27
26
|
@audits = self.class.get("/audits/#{audit}/web_report_link", @options)
|
28
27
|
end
|
29
28
|
|
30
|
-
# Need to be add based on checklist
|
31
|
-
# def start_audit
|
32
|
-
#
|
33
|
-
# end
|
34
|
-
|
35
29
|
# Retrieving audit media
|
36
30
|
def audit_media(audit,media)
|
37
31
|
@audits = self.class.get("/audits/#{audit}/media/#{media}", @options)
|
38
32
|
end
|
39
33
|
|
34
|
+
def export(audit, options={})
|
35
|
+
@audit_id = audit
|
36
|
+
@options.merge!(query: options) if options.present?
|
37
|
+
@export = self.class.post("/audits/#{@audit_id}/export", @options).parsed_response
|
38
|
+
@status = export_polling_status
|
39
|
+
return @status if @status["status"] == "FAILED"
|
40
|
+
|
41
|
+
export_document
|
42
|
+
end
|
43
|
+
|
40
44
|
# format. timezone, export_profile
|
41
45
|
def start_audit_export(audit,options={})
|
42
46
|
@options.merge!(query: options) if options.present?
|
43
|
-
@audits = self.class.
|
47
|
+
@audits = self.class.post("/audits/#{audit}/export", @options)
|
44
48
|
end
|
45
49
|
|
46
50
|
# format. timezone, export_profile
|
@@ -48,6 +52,17 @@ module IAuditor
|
|
48
52
|
@audits = self.class.get("/audits/#{audit}/exports/#{export}/#{file}", @options)
|
49
53
|
end
|
50
54
|
|
55
|
+
private
|
56
|
+
|
57
|
+
def export_polling_status
|
58
|
+
@status = self.class.get("/audits/#{@audit_id}/exports/#{@export["id"]}", @options).parsed_response
|
59
|
+
export_polling_status if @status["status"] == "IN PROGRESS"
|
60
|
+
@status
|
61
|
+
end
|
51
62
|
|
63
|
+
def export_document
|
64
|
+
file_name = URI.encode(@status["filename"])
|
65
|
+
self.class.get("/audits/#{@audit_id}/exports/#{@export["id"]}/#{file_name}", @options).parsed_response
|
66
|
+
end
|
52
67
|
end
|
53
68
|
end
|
data/lib/iAuditor/base.rb
CHANGED
@@ -6,8 +6,8 @@ class BaseModules
|
|
6
6
|
def initialize(token)
|
7
7
|
@options = token.is_a?(String) ? {
|
8
8
|
headers: {
|
9
|
-
"Content-Type"
|
10
|
-
"Authorization"
|
9
|
+
"Content-Type" => "application/json",
|
10
|
+
"Authorization"=> "Bearer #{token}"
|
11
11
|
}
|
12
12
|
}
|
13
13
|
: token
|
data/lib/iAuditor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iAuditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Wetteroth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-06-
|
12
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|