evostream-event 0.2.5.pre.34 → 0.2.5.pre.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/evostream/event.rb +10 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15d1ac0f7bab1de147d56cf73c8dfc0085dbdd14
4
- data.tar.gz: 5154c56a7cc63c78c235a5184e6b1d821baf3909
3
+ metadata.gz: e4baa9af53940d34633e420d681b329609517ac3
4
+ data.tar.gz: a574bc56a10e985fcf44f2cba7225dde3c97ccc8
5
5
  SHA512:
6
- metadata.gz: e1bffbdf54cc949dcb9d3f388623e8959045bb4a8591c102cb8483ab959a4de3af0872efa913f1affa60fa7bad94a5e59ad3dc4da777f74e679116083c4996cc
7
- data.tar.gz: a4039c7a198170d79f52a8caba1744dc1bbb9b47ae40e7d0a1e18d1b80be87e5c87c68ee09df0202c97dc0a460cca862f9ca7f472ef5f79ce639c8b16ef9c108
6
+ metadata.gz: 3a9f496ca7e709c84d2b6b510d929be6a3078c3bb480baec37826dd3810e5b83b60ae72a2d381ade34ccb9bc09a41d56b152b07675fff6a37efafe69a5cd83e3
7
+ data.tar.gz: b57aa429ca4f3e6f94a8dfdae3144680e75899a8d2286598d0b8ba8e0fdd432d82d92018183f68d24096cb6f2545bde80737e2e40e0ddd34db6c8463c5716129
@@ -7,11 +7,13 @@ require 'evostream/event/commands'
7
7
  require 'evostream/event/events'
8
8
  require 'net/http'
9
9
 
10
+ # :reek:DuplicateMethod
11
+
10
12
  # Primary command to gem
11
13
  module Evostream
12
14
  def self.send_command(cmd)
13
15
  response = prepare_request(cmd)
14
- body = JSON.parse(response.body).to_hash
16
+ body = response.body.nil? ? {} : JSON.parse(response.body).to_hash
15
17
  { status: Evostream.status(body), message: body['description'] }
16
18
  end
17
19
 
@@ -31,7 +33,13 @@ module Evostream
31
33
  end
32
34
 
33
35
  def self.status(body)
34
- body['status'].eql?('FAIL') ? 403 : 200
36
+ if body['status'].eql?('FAIL')
37
+ 403
38
+ elsif body.empty?
39
+ 204
40
+ else
41
+ 200
42
+ end
35
43
  end
36
44
 
37
45
  def self.prepare_request(cmd)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evostream-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5.pre.34
4
+ version: 0.2.5.pre.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - VAILLANT Jeremy