mojfile-uploader-api-client 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mojfile_uploader_api_client.rb +9 -2
- data/lib/mojfile_uploader_api_client/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: d79a32a36f71f6ebdd71a92068f08488b38c1bc5
|
4
|
+
data.tar.gz: 8adf54c66f79831bc875985659f9c90d07133fc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f5092786df273f8575cb5db00efe609d1c3140fda204d14cb9336c310355885514dfafe8b324c77eb8eda66867302e954a5fb607b1578bb17ce436c22feee60
|
7
|
+
data.tar.gz: 19aa2bf089f5ffbdf110833f421592e332113b766b4d383ba14d346a493ad293d8f0ceea6e70004b46443ad4a85d130d7fcd5ea47bada01383b2b3e5d11aa597
|
data/Gemfile.lock
CHANGED
@@ -11,10 +11,12 @@ require 'mojfile_uploader_api_client/list_files'
|
|
11
11
|
|
12
12
|
module MojFileUploaderApiClient
|
13
13
|
INFECTED_FILE_RESPONSE_CODE = 400
|
14
|
+
NOT_FOUND_RESPONSE_CODE = 404
|
14
15
|
|
15
16
|
class Unavailable < StandardError; end
|
16
17
|
class RequestError < StandardError; end
|
17
18
|
class InfectedFileError < StandardError; end
|
19
|
+
class NotFoundError < StandardError; end
|
18
20
|
|
19
21
|
def self.add_file(params)
|
20
22
|
response = AddFile.new(params).call
|
@@ -38,7 +40,12 @@ module MojFileUploaderApiClient
|
|
38
40
|
def self.list_files(params)
|
39
41
|
response = ListFiles.new(params).call
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
+
if response.success?
|
44
|
+
response.body
|
45
|
+
elsif response.code.equal?(NOT_FOUND_RESPONSE_CODE)
|
46
|
+
raise NotFoundError
|
47
|
+
else
|
48
|
+
raise RequestError
|
49
|
+
end
|
43
50
|
end
|
44
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mojfile-uploader-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesus Laiz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-02-
|
12
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|