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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebc75d73079201879712a90261fb8c0a2e1d64e9
4
- data.tar.gz: 50628c0c85917510259cbe8c9a8b1f6b3115940f
3
+ metadata.gz: d79a32a36f71f6ebdd71a92068f08488b38c1bc5
4
+ data.tar.gz: 8adf54c66f79831bc875985659f9c90d07133fc2
5
5
  SHA512:
6
- metadata.gz: 4ee5567ac519f4d76d1be20cbcd08bbc5e79369bfd77e3e8ec94fc1d2291f080ba2fd8708f3d736658f8ebcdf298f89de2104bdddec6a0e6389b60184e52536d
7
- data.tar.gz: 0a5a5856cfc7574275ecd3f8eba6ab0a4a69ef7e90109556d9b5201e4f7466ebf7a33d916d47598225efc0506e9e9840482496d1238dfad207c6a646645c74e9
6
+ metadata.gz: 1f5092786df273f8575cb5db00efe609d1c3140fda204d14cb9336c310355885514dfafe8b324c77eb8eda66867302e954a5fb607b1578bb17ce436c22feee60
7
+ data.tar.gz: 19aa2bf089f5ffbdf110833f421592e332113b766b4d383ba14d346a493ad293d8f0ceea6e70004b46443ad4a85d130d7fcd5ea47bada01383b2b3e5d11aa597
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mojfile-uploader-api-client (0.3)
4
+ mojfile-uploader-api-client (0.4)
5
5
  rest-client (~> 2.0.0)
6
6
 
7
7
  GEM
@@ -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
- raise RequestError unless response.success?
42
- response.body
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
@@ -1,3 +1,3 @@
1
1
  module MojFileUploaderApiClient
2
- VERSION = '0.3'
2
+ VERSION = '0.4'
3
3
  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.3'
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-24 00:00:00.000000000 Z
12
+ date: 2017-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler