bps-google-api 0.5.0 → 0.5.1
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/.rubocop.yml +1 -0
- data/Gemfile.lock +3 -3
- data/bps-google-api.gemspec +2 -2
- data/lib/google_api/calendar/clear_test_calendar.rb +13 -3
- data/spec/lib/google_api/calendar_spec.rb +11 -5
- 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: 67669257142314c0e1c703dcd7553a52826e5233efdf201d11d2b3756cb3c432
|
4
|
+
data.tar.gz: 1e946c30ee44aa29890b1a6bf889a78d428633980c4233a27d52f218afe4259a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ebef8848cc1f097db66ddeb5f1ba7ed7a60efde57a24839eb42e047aea0e6bc366bc0e3e4c72f1933aebe2d3c988848e0058ec635df21e2b6e3769f81904f83
|
7
|
+
data.tar.gz: 3c69d7700f0521654c56b8f13b68f3b7cddbdd2f4713bafd337249d4cd75d8cc6496c81115c4ea302941b6f27b6e46bea6f0644e33d3884981ed6c49c096ff41
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bps-google-api (0.5.
|
4
|
+
bps-google-api (0.5.1)
|
5
5
|
exp_retry (~> 0.0.13)
|
6
6
|
fileutils (~> 1.2)
|
7
7
|
google-api-client (~> 0.23)
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
minitest (>= 5.1)
|
17
17
|
tzinfo (~> 2.0)
|
18
18
|
zeitwerk (~> 2.3)
|
19
|
-
addressable (2.8.
|
19
|
+
addressable (2.8.3)
|
20
20
|
public_suffix (>= 2.0.2, < 6.0)
|
21
21
|
ast (2.4.0)
|
22
22
|
concurrent-ruby (1.2.2)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
faraday-patron (1.0.0)
|
48
48
|
faraday-rack (1.0.0)
|
49
49
|
faraday-retry (1.0.3)
|
50
|
-
fileutils (1.7.
|
50
|
+
fileutils (1.7.1)
|
51
51
|
gems (1.2.0)
|
52
52
|
google-api-client (0.53.0)
|
53
53
|
google-apis-core (~> 0.1)
|
data/bps-google-api.gemspec
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'bps-google-api'
|
5
|
-
s.version = '0.5.
|
6
|
-
s.date = '2023-
|
5
|
+
s.version = '0.5.1'
|
6
|
+
s.date = '2023-04-08'
|
7
7
|
s.summary = 'Configured Google API'
|
8
8
|
s.description = 'A configured Google API wrapper.'
|
9
9
|
s.homepage = 'http://rubygems.org/gems/bps-google-api'
|
@@ -7,9 +7,10 @@ class GoogleAPI
|
|
7
7
|
raise Google::Apis::RateLimitError, '(Rate Limit Exceeded)' if error
|
8
8
|
|
9
9
|
@verbose = verbose
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
quietly do
|
11
|
+
choose_page_token(page_token)
|
12
|
+
loop_over_pages(ENV['GOOGLE_CALENDAR_ID_TEST'], page_limit: page_limit)
|
13
|
+
end
|
13
14
|
puts '*** Cleared all events!' if @verbose
|
14
15
|
rescue Google::Apis::RateLimitError
|
15
16
|
puts "\n\n*** Google::Apis::RateLimitError (Rate Limit Exceeded)" if @verbose
|
@@ -19,6 +20,15 @@ class GoogleAPI
|
|
19
20
|
|
20
21
|
private
|
21
22
|
|
23
|
+
def quietly
|
24
|
+
old_level = Google::Apis.logger.level
|
25
|
+
Google::Apis.logger.level = Logger::WARN
|
26
|
+
|
27
|
+
yield
|
28
|
+
|
29
|
+
Google::Apis.logger.level = old_level
|
30
|
+
end
|
31
|
+
|
22
32
|
def choose_page_token(page_token)
|
23
33
|
last_token = Calendar.last_token_path
|
24
34
|
@page_token ||= File.read(last_token) if File.exist?(last_token)
|
@@ -86,13 +86,19 @@ RSpec.describe GoogleAPI::Calendar do
|
|
86
86
|
context 'with multiple pages' do
|
87
87
|
let(:calendar) { subject.class.api }
|
88
88
|
|
89
|
-
|
90
|
-
|
91
|
-
Google::Apis::CalendarV3::Events.new(
|
92
|
-
|
93
|
-
|
89
|
+
let(:events) do
|
90
|
+
[
|
91
|
+
Google::Apis::CalendarV3::Events.new(
|
92
|
+
items: [Google::Apis::CalendarV3::Event], next_page_token: 'abc'
|
93
|
+
),
|
94
|
+
Google::Apis::CalendarV3::Events.new(
|
95
|
+
items: [Google::Apis::CalendarV3::Event], next_page_token: nil
|
96
|
+
)
|
97
|
+
]
|
94
98
|
end
|
95
99
|
|
100
|
+
before { allow(calendar).to receive(:call).and_return(events) }
|
101
|
+
|
96
102
|
it 'returns the array of all events from list_all when paginated' do
|
97
103
|
expect(calendar).to receive(:call).twice
|
98
104
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bps-google-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: exp_retry
|