calendlyr 0.7.2 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +13 -0
- data/README.md +5 -7
- data/lib/calendlyr/error.rb +12 -4
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fcea4c5206606b7ef08edb1e46d1aa2c51380cb769d8c911bb316aa7bc4bef1
|
4
|
+
data.tar.gz: 44177a86aa12c87a5ec66b4af52ffad054d9110743bbfaffd116b8fe70399586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0e22a796f4c0bea34e6881a999cb88f27b847d6acf8acd2b4bc65ec5b61e30023ca2349c2152cf8e5f4e8a92358b9e6bb020ac1bc8986ac2dd20724e0a9fdea
|
7
|
+
data.tar.gz: 75880af1a6ce07bd4a2b0afb5c0ed66c99adbc6d0fd0099ee13e81e911420039651667b5f528bcaf8487fbf84a7d3bcf501e57a29c56f75cd4839a3a9b80c989
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [0.7.4]
|
6
|
+
* Fix: Error class name typo `ExternalCalendarEror` -> `ExternalCalendarError`
|
7
|
+
* Fix: Error class name typo `TooManyRequestsEror` -> `TooManyRequests`
|
8
|
+
* Updating rubies versions in CI to add 3.3
|
9
|
+
* Adding total rubygems downloads badge to README
|
10
|
+
|
11
|
+
[0.7.4]: https://github.com/araluce/calendlyr/compare/v0.7.3...v0.7.4
|
12
|
+
|
13
|
+
## [0.7.3]
|
14
|
+
* Fix: Prevent possible empty body response to fail
|
15
|
+
|
16
|
+
[0.7.3]: https://github.com/araluce/calendlyr/compare/v0.7.1...v0.7.3
|
17
|
+
|
5
18
|
## [0.7.1]
|
6
19
|
* Adding support for 429 responses from Calendly API
|
7
20
|
|
data/README.md
CHANGED
@@ -1,9 +1,7 @@
|
|
1
|
-
[![](https://img.shields.io/github/license/araluce/calendlyr)](https://github.com/araluce/calendlyr/blob/master/LICENSE.txt)
|
2
|
-
[![](https://github.com/araluce/calendlyr/actions/workflows/ci.yml/badge.svg)](https://github.com/araluce/calendlyr/actions)
|
3
|
-
[![codecov](https://codecov.io/gh/araluce/calendlyr/branch/master/graph/badge.svg?token=YSUU4PHM6Y)](https://codecov.io/gh/araluce/calendlyr)
|
4
|
-
![
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/calendlyr.svg)](https://badge.fury.io/rb/calendlyr)
|
6
|
-
![Gem Downloads (for specified version)](https://img.shields.io/gem/dv/calendlyr/0.7.2)
|
1
|
+
[![](https://img.shields.io/github/license/araluce/calendlyr?kill_cache=1)](https://github.com/araluce/calendlyr/blob/master/LICENSE.txt)
|
2
|
+
[![](https://github.com/araluce/calendlyr/actions/workflows/ci.yml/badge.svg?kill_cache=1)](https://github.com/araluce/calendlyr/actions)
|
3
|
+
[![codecov](https://codecov.io/gh/araluce/calendlyr/branch/master/graph/badge.svg?token=YSUU4PHM6Y&kill_cache=1)](https://codecov.io/gh/araluce/calendlyr)
|
4
|
+
![Gem Downloads (for specified version)](https://img.shields.io/gem/dt/calendlyr)
|
7
5
|
|
8
6
|
# Calendly API Rubygem
|
9
7
|
|
@@ -24,7 +22,7 @@ We understand the importance of not adding unwanted dependencies.
|
|
24
22
|
Add this line to your application's Gemfile:
|
25
23
|
|
26
24
|
```ruby
|
27
|
-
gem 'calendlyr', '0.7.
|
25
|
+
gem 'calendlyr', '0.7.4'
|
28
26
|
```
|
29
27
|
|
30
28
|
And then execute:
|
data/lib/calendlyr/error.rb
CHANGED
@@ -1,13 +1,21 @@
|
|
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
|
8
|
-
|
13
|
+
|
14
|
+
class ExternalCalendarError < StandardError; end
|
15
|
+
|
9
16
|
class InternalServerError < StandardError; end
|
10
|
-
|
17
|
+
|
18
|
+
class TooManyRequests < StandardError; end
|
11
19
|
|
12
20
|
class ResponseErrorHandler
|
13
21
|
ERROR_TYPES = {
|
@@ -15,8 +23,8 @@ module Calendlyr
|
|
15
23
|
"401" => Unauthenticated,
|
16
24
|
"403" => PermissionDenied,
|
17
25
|
"404" => NotFound,
|
18
|
-
"424" =>
|
19
|
-
"429" =>
|
26
|
+
"424" => ExternalCalendarError,
|
27
|
+
"429" => TooManyRequests,
|
20
28
|
"500" => InternalServerError
|
21
29
|
}
|
22
30
|
|
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
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calendlyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- araluce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|