qismo 0.1.2 → 0.1.8

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
  SHA256:
3
- metadata.gz: 71fd2b8604c428a10be54ac548616086c07af7a3e44e36dccc67d8055e6059c1
4
- data.tar.gz: c3f53f46b6cced132d75d1cbe087bf46ce81673e708727db499a8a0d3e3b4d9f
3
+ metadata.gz: d4eaffbee238679bb22787462d15da8eeba47b130485a197f25798f9972df663
4
+ data.tar.gz: 8503bd0773f35a80cc29d0e2ac28f4eebf0a77856f83f629452b2ee57c1e28bd
5
5
  SHA512:
6
- metadata.gz: 57f0f8c37ff0cd40720e9c4c2acce92b588b64f9df015e7bbf97c315f4f60639d68b39050e7ed63ae38c7cbc2a37da4ae84d2d766d418baaea4f55094165f9d8
7
- data.tar.gz: 725b992269f83942b4f164812ca5a15abe7c8c559327e17a8b796313ed555441435201b19204472d4eb421223a911fd2648e8a19ff1f5667380db7c5553220f6
6
+ metadata.gz: 4d58a2a88592ff4d8cc65c50afeda3ec153ed1a2abc451827ae670c3eff5c0af8fdcecb837689eb2915de5ebd08c1216913b15c9ef14a75b93cbba4c3ee81f06
7
+ data.tar.gz: 4ef954fed64bd7e30ee7314524cccc6baa89709c0e3e279fb07df608e6927cb05aee7ef19e7e747c86e1dd499d68037b1d9ad2539ec9da7ab89f47e481a9839f
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qismo (0.1.1)
4
+ qismo (0.1.8)
5
5
  http (~> 5.0)
6
6
 
7
7
  GEM
@@ -74,9 +74,9 @@ module Qismo
74
74
  end
75
75
 
76
76
  def parse_error(resp)
77
- return nil if resp.status.ok? || resp.status.informational? || resp.status.redirect?
77
+ return nil if resp.status.ok?
78
78
 
79
- if resp.status.server_error?
79
+ if resp.code >= 500
80
80
  return InternalServerError.new(
81
81
  "Qiscus internal server error",
82
82
  http_code: resp.code,
@@ -86,7 +86,7 @@ module Qismo
86
86
  )
87
87
  end
88
88
 
89
- if resp.status.client_error?
89
+ if resp.code >= 400
90
90
  code = resp.code
91
91
  headers = safe_parse_json(resp.headers.to_h)
92
92
  raw_body = resp.to_s
@@ -124,9 +124,8 @@ module Qismo
124
124
  end
125
125
 
126
126
  klass.message = error_message
127
- klass.message = errors if klass.message.is_a?(String)
128
127
  else
129
- klass.message = klass.http_body
128
+ klass.message = klass.http_raw_body
130
129
  end
131
130
 
132
131
  klass
data/lib/qismo/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Qismo
4
4
  # @return [String] gem version constant
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.8"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qismo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nurcholis Art
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-02-22 00:00:00.000000000 Z
12
+ date: 2022-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: http
@@ -57,8 +57,6 @@ files:
57
57
  - LICENSE.txt
58
58
  - README.md
59
59
  - Rakefile
60
- - bin/console
61
- - bin/setup
62
60
  - lib/qismo.rb
63
61
  - lib/qismo/client.rb
64
62
  - lib/qismo/errors.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "qismo"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here