doggy 2.0.37 → 2.0.38

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: e6ca3e8dffbd2ec37317f14aa6b824324abd4cb3
4
- data.tar.gz: 8b72ae39c4fce2e3a9e3f205689e3d0a1c695ae5
3
+ metadata.gz: 957f7b3de058a28033615d38adc4cde2592e74c6
4
+ data.tar.gz: dc8100cfa99575c54904087b55eb01ac97a46d6e
5
5
  SHA512:
6
- metadata.gz: 86313aa953b60dc71bf0ba9d425d20daf1e6585a5a66cace87898f12de58ac57315ad980ebd141c4f2235fb09e58c5e3ffe90c912257d7d6475072363cda24a0
7
- data.tar.gz: 9f607bf285f1b58ae97d3d927368a44ce1a4e842ab220a5b2113d76df2ef981a778bd4ac7d4f9701fd736a8b9261e72da1e846a2b3d1d936a53214e0379a5b05
6
+ metadata.gz: 6818fabbc4c59ed124504fed8bade0f29c20d11be312640fc04a7a3448bab6cac5de05e54074c1463d6e15afe3e62bba09f16488cc27fc70f902ad9d9eb21438
7
+ data.tar.gz: f95498183a511ec8cc023426ef8273b1d336a3894b445346a1f2de10775e7be1381daa71e3bf3fc5dd21a0e202c4c48fff30dc84a2d4dd0d0068e512e153e4d6
data/lib/doggy/model.rb CHANGED
@@ -112,6 +112,9 @@ module Doggy
112
112
  request.body = body if body
113
113
 
114
114
  response = http.request(request)
115
+ unless response.code =~ /\A[23][0-9]{2}\Z/
116
+ raise DoggyError, "Unexpected response code #{response.code} for #{url}."
117
+ end
115
118
  response.body ? JSON.parse(response.body) : nil
116
119
  end
117
120
 
data/lib/doggy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Doggy
4
- VERSION = '2.0.37'
4
+ VERSION = '2.0.38'
5
5
  end
data/lib/doggy.rb CHANGED
@@ -21,6 +21,8 @@ module Doggy
21
21
  DOG_SKIP_REGEX = /\xF0\x9F\x98\xB1|:scream:/i.freeze
22
22
  MANAGED_BY_DOGGY_REGEX = /\xF0\x9F\x90\xB6|:dog:/i.freeze
23
23
 
24
+ class DoggyError < StandardError; end
25
+
24
26
  extend self
25
27
 
26
28
  def random_word
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doggy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.37
4
+ version: 2.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Gorodetsky
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-12-14 00:00:00.000000000 Z
12
+ date: 2017-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json