cronofy 0.19.0 → 0.20.0
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 +13 -1
- data/lib/cronofy/client.rb +13 -3
- data/lib/cronofy/errors.rb +4 -0
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/client_spec.rb +31 -8
- data/spec/lib/cronofy/errors_spec.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 522370b2f01af27ff60bacbb76323ca47dd077b1
|
4
|
+
data.tar.gz: 716a6013058ba2216fe70ac96b755bc6533ba24e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8bdf1cbb735736f76700aad41b083be051b5d821e03a088c54b537c066743ee51390fc73daa6875b8ecc78ee22e5c6c127d8b94532ee3af0b492cd4270b8acf
|
7
|
+
data.tar.gz: 5bb3db55ed8cd3e9f71320bdb13f1e754d9f9bf47b049d8d87c3a2be74fc668c4c21c0f352fb4147ef1bd54762b39c03e2f004b6ade724ba9ff3f0011b4c04fb
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
## [0.20.0]
|
2
|
+
|
3
|
+
* Change invalid request message to include errors [#36]
|
4
|
+
* Pass through times as-is if already Strings [#37]
|
5
|
+
* Support bulk delete from specific calendars [#38]
|
6
|
+
|
1
7
|
## [0.19.0]
|
2
8
|
|
3
|
-
* Support
|
9
|
+
* Support setting event transparency [#31]
|
10
|
+
* Support Add To Calendar [#35]
|
4
11
|
|
5
12
|
## [0.18.0]
|
6
13
|
|
@@ -45,6 +52,7 @@
|
|
45
52
|
[0.17.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.17.0
|
46
53
|
[0.18.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.18.0
|
47
54
|
[0.19.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.19.0
|
55
|
+
[0.20.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.20.0
|
48
56
|
|
49
57
|
[#13]: https://github.com/cronofy/cronofy-ruby/pull/13
|
50
58
|
[#16]: https://github.com/cronofy/cronofy-ruby/pull/16
|
@@ -56,3 +64,7 @@
|
|
56
64
|
[#27]: https://github.com/cronofy/cronofy-ruby/pull/27
|
57
65
|
[#30]: https://github.com/cronofy/cronofy-ruby/pull/30
|
58
66
|
[#31]: https://github.com/cronofy/cronofy-ruby/pull/31
|
67
|
+
[#35]: https://github.com/cronofy/cronofy-ruby/pull/35
|
68
|
+
[#36]: https://github.com/cronofy/cronofy-ruby/pull/36
|
69
|
+
[#37]: https://github.com/cronofy/cronofy-ruby/pull/37
|
70
|
+
[#38]: https://github.com/cronofy/cronofy-ruby/pull/38
|
data/lib/cronofy/client.rb
CHANGED
@@ -330,9 +330,16 @@ module Cronofy
|
|
330
330
|
|
331
331
|
# Public: Deletes all events you are managing for the account.
|
332
332
|
#
|
333
|
-
# See
|
333
|
+
# See https://www.cronofy.com/developers/api/#bulk-delete-events for
|
334
334
|
# reference.
|
335
335
|
#
|
336
|
+
# options - The Hash options used to refine the selection (optional):
|
337
|
+
# :calendar_ids - An Array of calendar ids to delete managed
|
338
|
+
# events from returned events.
|
339
|
+
#
|
340
|
+
# If no options are specified it defaults to deleting all the events you are
|
341
|
+
# managing.
|
342
|
+
#
|
336
343
|
# Returns nothing.
|
337
344
|
#
|
338
345
|
# Raises Cronofy::CredentialsMissingError if no credentials available.
|
@@ -345,8 +352,9 @@ module Cronofy
|
|
345
352
|
# parameters.
|
346
353
|
# Raises Cronofy::TooManyRequestsError if the request exceeds the rate
|
347
354
|
# limits for the application.
|
348
|
-
def delete_all_events
|
349
|
-
|
355
|
+
def delete_all_events(options = nil)
|
356
|
+
options ||= { delete_all: true }
|
357
|
+
delete("/v1/events", options)
|
350
358
|
nil
|
351
359
|
end
|
352
360
|
|
@@ -939,6 +947,8 @@ module Cronofy
|
|
939
947
|
result = time
|
940
948
|
|
941
949
|
case time
|
950
|
+
when String
|
951
|
+
time
|
942
952
|
when Hash
|
943
953
|
if time[:time]
|
944
954
|
encoded_time = encode_event_time(time[:time])
|
data/lib/cronofy/errors.rb
CHANGED
data/lib/cronofy/version.rb
CHANGED
@@ -319,6 +319,13 @@ describe Cronofy::Client do
|
|
319
319
|
|
320
320
|
it_behaves_like 'a Cronofy request'
|
321
321
|
end
|
322
|
+
|
323
|
+
context 'when start and end already encoded' do
|
324
|
+
let(:start_datetime) { encoded_start_datetime }
|
325
|
+
let(:end_datetime) { encoded_end_datetime }
|
326
|
+
|
327
|
+
it_behaves_like 'a Cronofy request'
|
328
|
+
end
|
322
329
|
end
|
323
330
|
|
324
331
|
describe '#read_events' do
|
@@ -594,16 +601,32 @@ describe Cronofy::Client do
|
|
594
601
|
end
|
595
602
|
|
596
603
|
describe '#delete_all_events' do
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
604
|
+
context "default" do
|
605
|
+
let(:request_url) { "https://api.cronofy.com/v1/events" }
|
606
|
+
let(:method) { :delete }
|
607
|
+
let(:request_headers) { json_request_headers }
|
608
|
+
let(:request_body) { { :delete_all => true } }
|
609
|
+
let(:correct_response_code) { 202 }
|
610
|
+
let(:correct_response_body) { nil }
|
603
611
|
|
604
|
-
|
612
|
+
subject { client.delete_all_events }
|
605
613
|
|
606
|
-
|
614
|
+
it_behaves_like 'a Cronofy request'
|
615
|
+
end
|
616
|
+
|
617
|
+
context "specific calendars" do
|
618
|
+
let(:calendar_ids) { %w{cal_1234_5678 cal_abcd_efgh} }
|
619
|
+
let(:request_url) { "https://api.cronofy.com/v1/events" }
|
620
|
+
let(:method) { :delete }
|
621
|
+
let(:request_headers) { json_request_headers }
|
622
|
+
let(:request_body) { { :calendar_ids => calendar_ids } }
|
623
|
+
let(:correct_response_code) { 202 }
|
624
|
+
let(:correct_response_body) { nil }
|
625
|
+
|
626
|
+
subject { client.delete_all_events(calendar_ids: calendar_ids) }
|
627
|
+
|
628
|
+
it_behaves_like 'a Cronofy request'
|
629
|
+
end
|
607
630
|
end
|
608
631
|
end
|
609
632
|
|
@@ -50,6 +50,10 @@ describe Cronofy::Errors do
|
|
50
50
|
|
51
51
|
expect(subject.errors).to eq(deserialized_errors)
|
52
52
|
end
|
53
|
+
|
54
|
+
it "includes the errors in the message" do
|
55
|
+
expect(subject.message).to eq('message - {"event_id"=>[{"key"=>"errors.required", "description"=>"required"}]}')
|
56
|
+
end
|
53
57
|
end
|
54
58
|
|
55
59
|
context "errors field missing" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cronofy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergii Paryzhskyi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.6.
|
152
|
+
rubygems_version: 2.6.6
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Cronofy - one API for all the calendars
|