calendlyr 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +6 -7
- data/lib/calendlyr/error.rb +8 -0
- data/lib/calendlyr/resource.rb +6 -1
- data/lib/calendlyr/version.rb +1 -1
- data/test/fixtures/resources/424.json +4 -1
- data/test/fixtures/resources/429.json +1 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c57c6eee34f296883a41d1c78d7f9ab9f142768353c78068a91ed7a4f6ec33f8
|
4
|
+
data.tar.gz: b1adb963d1d9ec9b2529d2765b7ddc6c0ea2a92fb5a89b016154abbacdb0d7dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db6766c86112dc3e944e3b6387bcd8e67b4c335804590d8cb7ef55081a874e0c572a647e9d9ce799ef1207434eeda482c6ca2ea12ba842ed20abe054d0e7ed67
|
7
|
+
data.tar.gz: 4b59f6ad76dd238775a010501c647c383a0dca86861b1dc417b460d5f899b6b5be2852a6d1102a20637739857d7277eca3cf88655c7a1350fe08d1cb91cee894
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.7.3]
|
6
|
+
* Fix: Prevent possible empty body response to fail
|
7
|
+
|
8
|
+
[0.7.3]: https://github.com/araluce/calendlyr/compare/v0.7.1...v0.7.3
|
9
|
+
|
5
10
|
## [0.7.1]
|
6
11
|
* Adding support for 429 responses from Calendly API
|
7
12
|
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
[](https://github.com/araluce/calendlyr/blob/master/LICENSE.txt)
|
2
|
-
[](https://github.com/araluce/calendlyr/actions)
|
3
|
-
[](https://codecov.io/gh/araluce/calendlyr)
|
4
|
-

|
1
|
+
[](https://github.com/araluce/calendlyr/blob/master/LICENSE.txt)
|
2
|
+
[](https://github.com/araluce/calendlyr/actions)
|
3
|
+
[](https://codecov.io/gh/araluce/calendlyr)
|
4
|
+
[](https://badge.fury.io/rb/calendlyr)
|
5
|
+

|
7
6
|
|
8
7
|
# Calendly API Rubygem
|
9
8
|
|
@@ -24,7 +23,7 @@ We understand the importance of not adding unwanted dependencies.
|
|
24
23
|
Add this line to your application's Gemfile:
|
25
24
|
|
26
25
|
```ruby
|
27
|
-
gem 'calendlyr', '0.7.
|
26
|
+
gem 'calendlyr', '0.7.3'
|
28
27
|
```
|
29
28
|
|
30
29
|
And then execute:
|
data/lib/calendlyr/error.rb
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
module Calendlyr
|
2
2
|
class Error < StandardError; end
|
3
|
+
|
3
4
|
class PermissionDenied < StandardError; end
|
5
|
+
|
4
6
|
class BadRequest < StandardError; end
|
7
|
+
|
5
8
|
class PaymentRequired < StandardError; end
|
9
|
+
|
6
10
|
class Unauthenticated < StandardError; end
|
11
|
+
|
7
12
|
class NotFound < StandardError; end
|
13
|
+
|
8
14
|
class ExternalCalendarEror < StandardError; end
|
15
|
+
|
9
16
|
class InternalServerError < StandardError; end
|
17
|
+
|
10
18
|
class TooManyRequestsEror < StandardError; end
|
11
19
|
|
12
20
|
class ResponseErrorHandler
|
data/lib/calendlyr/resource.rb
CHANGED
@@ -50,7 +50,12 @@ module Calendlyr
|
|
50
50
|
def handle_response(response)
|
51
51
|
return true unless response.read_body
|
52
52
|
|
53
|
-
body =
|
53
|
+
body = begin
|
54
|
+
JSON.parse(response.read_body)
|
55
|
+
rescue
|
56
|
+
{}
|
57
|
+
end
|
58
|
+
|
54
59
|
if ERROR_CODES.include? response.code
|
55
60
|
raise ResponseErrorHandler.new(response.code, body).error
|
56
61
|
else
|
data/lib/calendlyr/version.rb
CHANGED