ruby-deepviz 1.0.0 → 1.0.2
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/deepviz/sandbox.rb +19 -11
- metadata +2 -3
- data/lib/deepviz/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148be5362fbc0a4f9c269bcb5b34722d50210aaa
|
4
|
+
data.tar.gz: 6a63b4356641b77b83ac4fd629e82f234f86e0b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 160f640cf1abc93a2a415fe4fdff4cda77e29d0a97d15567c3fd08754193eadeea438edf811d97026d0793783d048c92f78e9842f0ddbd4120ca9aeb6eb1ed5b
|
7
|
+
data.tar.gz: 6f2fe54b1292801a477c5fe3676cb9263b9f9fc798432b9ae7964ec8da68cf49bc22aff6090b6e143db086f53c7f2ae2101ca30b35b3105465eb053aae22ebae
|
data/lib/deepviz/sandbox.rb
CHANGED
@@ -41,13 +41,17 @@ class Sandbox
|
|
41
41
|
return Result.new(status=NETWORK_ERROR, msg='%s - Error while connecting to Deepviz: %s' % [response.code, body['errmsg']])
|
42
42
|
end
|
43
43
|
|
44
|
-
if response.code ==
|
45
|
-
return Result.new(status=
|
44
|
+
if response.code == 428
|
45
|
+
return Result.new(status=PROCESSING, msg='Analysis is running')
|
46
46
|
else
|
47
|
-
if response.code
|
48
|
-
return Result.new(status=
|
47
|
+
if response.code == 200
|
48
|
+
return Result.new(status=SUCCESS, msg=response.body['data'])
|
49
49
|
else
|
50
|
-
|
50
|
+
if response.code >= 500
|
51
|
+
return Result.new(status=SERVER_ERROR, msg='%s - Error while connecting to Deepviz: %s' % [response.code, response.body['errmsg']])
|
52
|
+
else
|
53
|
+
return Result.new(status=CLIENT_ERROR, msg='%s - Error while connecting to Deepviz: %s' % [response.code, response.body['errmsg']])
|
54
|
+
end
|
51
55
|
end
|
52
56
|
end
|
53
57
|
end
|
@@ -78,7 +82,7 @@ class Sandbox
|
|
78
82
|
if x != '.' and x != '..'
|
79
83
|
file_path = File.join(path, x)
|
80
84
|
result = upload_sample(api_key, file_path)
|
81
|
-
if result.status != SUCCESS
|
85
|
+
if result.status != SUCCESS and result.status != PROCESSING
|
82
86
|
result.msg = '"Unable to upload file "%s"' % file_path
|
83
87
|
return result
|
84
88
|
end
|
@@ -235,13 +239,17 @@ class Sandbox
|
|
235
239
|
return Result.new(status=NETWORK_ERROR, msg='%s - Error while connecting to Deepviz: %s' % [response.code, response.body['errmsg']])
|
236
240
|
end
|
237
241
|
|
238
|
-
if response.code ==
|
239
|
-
return Result.new(status=
|
242
|
+
if response.code == 428
|
243
|
+
return Result.new(status=PROCESSING, msg='Analysis is running')
|
240
244
|
else
|
241
|
-
if response.code
|
242
|
-
return Result.new(status=
|
245
|
+
if response.code == 200
|
246
|
+
return Result.new(status=SUCCESS, msg=response.body['data'])
|
243
247
|
else
|
244
|
-
|
248
|
+
if response.code >= 500
|
249
|
+
return Result.new(status=SERVER_ERROR, msg='%s - Error while connecting to Deepviz: %s' % [response.code, response.body['errmsg']])
|
250
|
+
else
|
251
|
+
return Result.new(status=CLIENT_ERROR, msg='%s - Error while connecting to Deepviz: %s' % [response.code, response.body['errmsg']])
|
252
|
+
end
|
245
253
|
end
|
246
254
|
end
|
247
255
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-deepviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saferbytes S.r.l.s.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,7 +61,6 @@ files:
|
|
61
61
|
- lib/deepviz/intel.rb
|
62
62
|
- lib/deepviz/result.rb
|
63
63
|
- lib/deepviz/sandbox.rb
|
64
|
-
- lib/deepviz/version.rb
|
65
64
|
homepage: https://www.deepviz.com
|
66
65
|
licenses:
|
67
66
|
- MIT
|
data/lib/deepviz/version.rb
DELETED