magicbell 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/magicbell/api_operations.rb +12 -1
- data/lib/magicbell/client.rb +2 -1
- data/lib/magicbell/version.rb +1 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29113907c736b89c737a0522778b8479f863b436732c0d374946a4f04fb96c1a
|
4
|
+
data.tar.gz: '038fac96186f5de27eec5f0deca1ded68e06555ec6b3662e9f48800e807b3046'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c62643f20bd3ccc2ff67d8260af27431b810b57f4f2c7a702fcb4ff7fc248c07ceb55acef118b792cc2d6cd2748fa86c02fdf3de54dd1cec3a89537ac5d967ec
|
7
|
+
data.tar.gz: 3c8b6720557cf512ab763e4787e283ec8fcb5f4621d2bc0ba8e31248dde536b62146668a27f8a4112c0d570cad01477193c8dc95435bd42ffea4373e81f39d67
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'colorize'
|
1
3
|
module MagicBell
|
2
4
|
module ApiOperations
|
3
5
|
def get(url, options = {})
|
@@ -34,11 +36,20 @@ module MagicBell
|
|
34
36
|
|
35
37
|
def raise_http_error_unless_2xx_response(response)
|
36
38
|
return if response.success?
|
37
|
-
|
39
|
+
|
38
40
|
e = MagicBell::Client::HTTPError.new
|
39
41
|
e.response_status = response.code
|
40
42
|
e.response_headers = response.headers.to_h
|
41
43
|
e.response_body = response.body
|
44
|
+
e.errors = []
|
45
|
+
unless e.response_body.nil? || e.response_body.empty?
|
46
|
+
body = JSON.parse(response.body)
|
47
|
+
e.errors = body["errors"]
|
48
|
+
e.errors.each do |error, index|
|
49
|
+
puts "#{error["suggestion"].red}"
|
50
|
+
puts "#{error["help_link"].blue.on_white}"
|
51
|
+
end
|
52
|
+
end
|
42
53
|
raise e
|
43
54
|
end
|
44
55
|
end
|
data/lib/magicbell/client.rb
CHANGED
data/lib/magicbell/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magicbell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hana Mohan
|
8
8
|
- Nisanth Chunduru
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -39,6 +39,20 @@ dependencies:
|
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: colorize
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: actionmailer
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +157,7 @@ homepage: https://magicbell.io
|
|
143
157
|
licenses:
|
144
158
|
- MIT
|
145
159
|
metadata: {}
|
146
|
-
post_install_message:
|
160
|
+
post_install_message:
|
147
161
|
rdoc_options: []
|
148
162
|
require_paths:
|
149
163
|
- lib
|
@@ -159,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
173
|
version: '0'
|
160
174
|
requirements: []
|
161
175
|
rubygems_version: 3.1.4
|
162
|
-
signing_key:
|
176
|
+
signing_key:
|
163
177
|
specification_version: 4
|
164
178
|
summary: Ruby wrapper for MagicBell.io
|
165
179
|
test_files: []
|