cronofy 0.0.3 → 0.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/cronofy.rb +4 -2
- data/lib/cronofy/errors.rb +4 -0
- data/lib/cronofy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da5d96380934904435706ec98e7aa923abd05cc7
|
4
|
+
data.tar.gz: 73720046c2544252bdec8d7f7d5d5af8d7b93f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 884b2c8194a158011ee7f4c03218e1f28f75bab6c904d6e36b39ef7734a58082e6601a8ccbc6a02359c5cdbbc1e0d46a3c865ebb33934018b3e0d24a75fcd87c
|
7
|
+
data.tar.gz: 96feb5c06ccad53deb93df2fc819fb4182857615776e7713484e45e230626c2f885258448941c912ed21296fed61ec69225808a4be741b3677dc7c92d63605fb
|
data/lib/cronofy.rb
CHANGED
@@ -2,6 +2,7 @@ require "cronofy/version"
|
|
2
2
|
require "cronofy/auth"
|
3
3
|
require "cronofy/response_parser"
|
4
4
|
require "cronofy/errors"
|
5
|
+
require 'json'
|
5
6
|
|
6
7
|
module Cronofy
|
7
8
|
class Cronofy
|
@@ -45,7 +46,7 @@ module Cronofy
|
|
45
46
|
'Content-Type' => 'application/json'
|
46
47
|
}
|
47
48
|
|
48
|
-
do_request { access_token!.post("/v1/calendars/#{calendar_id}/events", { body: body
|
49
|
+
do_request { access_token!.post("/v1/calendars/#{calendar_id}/events", { body: JSON.generate(body), headers: headers }) }
|
49
50
|
end
|
50
51
|
alias_method :upsert_event, :create_or_update_event
|
51
52
|
|
@@ -96,7 +97,8 @@ module Cronofy
|
|
96
97
|
private
|
97
98
|
|
98
99
|
ERROR_MAP = {
|
99
|
-
401 =>
|
100
|
+
401 => AuthenticationFailureError,
|
101
|
+
403 => AuthorizationFailureError,
|
100
102
|
404 => NotFoundError,
|
101
103
|
422 => InvalidRequestError,
|
102
104
|
429 => TooManyRequestsError
|
data/lib/cronofy/errors.rb
CHANGED
data/lib/cronofy/version.rb
CHANGED