bps-google-api 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48eb103dafe0d57e7032a72e648f7cf085e2526c53f5d2d18e9122eeec620eea
4
- data.tar.gz: e9505e457d101da12a86cd758d2e124b335cfb5271e2f84404816cbd7d74e8d1
3
+ metadata.gz: e7937e55313beccedf580def65fe7e6b041144f86220aa4279d283d61b07d2c8
4
+ data.tar.gz: 8379c2d08a286369deef102cf842a711a9d6fb38f3c73d5cc112995bf0b14267
5
5
  SHA512:
6
- metadata.gz: 62a8efa1c192691cf326063b4c9ee19d296b3d6c8953d02d535b449d0cfe78e560965f237993c7aa7728d6748bf91fa40aaa29f3aa924475d92044dd06141f23
7
- data.tar.gz: 781131026cb28c330afada70929b2d6564e79620d4dcc87472788e8d6c887461b37d4741f921e8fd3959b039b4a040009f230e217687481c5cb1cc0c9510cef0
6
+ metadata.gz: 9f03d2238a56f6aebbc125b5e7ff06bcc9e6351a83e33fc16d43d2e45dc6f5559f6ce114fac73ae3e5078c873564565180db6e0c3deeb5c5e163cef91cf5b431
7
+ data.tar.gz: a3850bff8d52700c87543af69de468478fe69a7a2e726ee7deaed7202962056454f4b53e88426730b618c0589ed655b8a048b202a5740f878662f9e6de1a203d
data/.rubocop.yml CHANGED
@@ -37,6 +37,7 @@ Metrics/LineLength:
37
37
  Max: 100
38
38
  Metrics/MethodLength:
39
39
  Enabled: true
40
+ Max: 15
40
41
  Metrics/ClassLength:
41
42
  Enabled: true
42
43
  Max: 125
data/Gemfile.lock CHANGED
@@ -1,25 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bps-google-api (0.5.0)
4
+ bps-google-api (0.6.0)
5
5
  exp_retry (~> 0.0.13)
6
6
  fileutils (~> 1.2)
7
- google-api-client (~> 0.23)
7
+ google-apis-admin_directory_v1 (~> 0.40)
8
+ google-apis-calendar_v3 (~> 0.27)
9
+ google-apis-groupssettings_v1 (~> 0.13)
8
10
  ruby-progressbar (~> 1.10)
9
11
 
10
12
  GEM
11
13
  remote: https://rubygems.org/
12
14
  specs:
13
- activesupport (6.1.7.3)
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
15
- i18n (>= 1.6, < 2)
16
- minitest (>= 5.1)
17
- tzinfo (~> 2.0)
18
- zeitwerk (~> 2.3)
19
- addressable (2.8.1)
15
+ addressable (2.8.3)
20
16
  public_suffix (>= 2.0.2, < 6.0)
21
17
  ast (2.4.0)
22
- concurrent-ruby (1.2.2)
23
18
  declarative (0.0.20)
24
19
  diff-lcs (1.3)
25
20
  docile (1.3.2)
@@ -47,11 +42,11 @@ GEM
47
42
  faraday-patron (1.0.0)
48
43
  faraday-rack (1.0.0)
49
44
  faraday-retry (1.0.3)
50
- fileutils (1.7.0)
51
- gems (1.2.0)
52
- google-api-client (0.53.0)
53
- google-apis-core (~> 0.1)
54
- google-apis-generator (~> 0.1)
45
+ fileutils (1.7.1)
46
+ google-apis-admin_directory_v1 (0.40.0)
47
+ google-apis-core (>= 0.11.0, < 2.a)
48
+ google-apis-calendar_v3 (0.27.0)
49
+ google-apis-core (>= 0.11.0, < 2.a)
55
50
  google-apis-core (0.11.0)
56
51
  addressable (~> 2.5, >= 2.5.1)
57
52
  googleauth (>= 0.16.2, < 2.a)
@@ -61,14 +56,8 @@ GEM
61
56
  retriable (>= 2.0, < 4.a)
62
57
  rexml
63
58
  webrick
64
- google-apis-discovery_v1 (0.14.0)
65
- google-apis-core (>= 0.11.0, < 2.a)
66
- google-apis-generator (0.12.0)
67
- activesupport (>= 5.0)
68
- gems (~> 1.2)
59
+ google-apis-groupssettings_v1 (0.13.0)
69
60
  google-apis-core (>= 0.11.0, < 2.a)
70
- google-apis-discovery_v1 (~> 0.5)
71
- thor (>= 0.20, < 2.a)
72
61
  googleauth (1.1.3)
73
62
  faraday (>= 0.17.3, < 3.a)
74
63
  jwt (>= 1.4, < 3.0)
@@ -77,14 +66,11 @@ GEM
77
66
  os (>= 0.9, < 2.0)
78
67
  signet (>= 0.16, < 2.a)
79
68
  httpclient (2.8.3)
80
- i18n (1.12.0)
81
- concurrent-ruby (~> 1.0)
82
69
  jaro_winkler (1.5.3)
83
70
  json (2.3.1)
84
71
  jwt (2.7.0)
85
72
  memoist (0.16.2)
86
73
  mini_mime (1.1.2)
87
- minitest (5.15.0)
88
74
  multi_json (1.15.0)
89
75
  multipart-post (2.3.0)
90
76
  os (1.1.4)
@@ -131,14 +117,10 @@ GEM
131
117
  json (>= 1.8, < 3)
132
118
  simplecov-html (~> 0.10.0)
133
119
  simplecov-html (0.10.2)
134
- thor (1.2.1)
135
120
  trailblazer-option (0.1.2)
136
- tzinfo (2.0.6)
137
- concurrent-ruby (~> 1.0)
138
121
  uber (0.1.0)
139
122
  unicode-display_width (1.6.0)
140
123
  webrick (1.8.1)
141
- zeitwerk (2.6.7)
142
124
 
143
125
  PLATFORMS
144
126
  ruby
@@ -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.0'
6
- s.date = '2023-03-13'
5
+ s.version = '0.6.0'
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'
@@ -15,10 +15,12 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_ruby_version = '>= 2.4'
17
17
 
18
- s.add_runtime_dependency 'exp_retry', '~> 0.0.13'
19
- s.add_runtime_dependency 'fileutils', '~> 1.2'
20
- s.add_runtime_dependency 'google-api-client', '~> 0.23'
21
- s.add_runtime_dependency 'ruby-progressbar', '~> 1.10'
18
+ s.add_runtime_dependency 'exp_retry', '~> 0.0.13'
19
+ s.add_runtime_dependency 'fileutils', '~> 1.2'
20
+ s.add_runtime_dependency 'google-apis-calendar_v3', '~> 0.27'
21
+ s.add_runtime_dependency 'google-apis-groupssettings_v1', '~> 0.13'
22
+ s.add_runtime_dependency 'google-apis-admin_directory_v1', '~> 0.40'
23
+ s.add_runtime_dependency 'ruby-progressbar', '~> 1.10'
22
24
 
23
25
  s.add_development_dependency 'rspec', '~> 3.8', '>= 3.8.0'
24
26
  s.add_development_dependency 'rubocop', '~> 0.71', '>= 0.71.0'
@@ -7,9 +7,10 @@ class GoogleAPI
7
7
  raise Google::Apis::RateLimitError, '(Rate Limit Exceeded)' if error
8
8
 
9
9
  @verbose = verbose
10
- Google::Apis.logger.level = Logger::WARN
11
- choose_page_token(page_token)
12
- loop_over_pages(ENV['GOOGLE_CALENDAR_ID_TEST'], page_limit: page_limit)
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
- before do
90
- allow(calendar).to receive(:call).and_return(
91
- Google::Apis::CalendarV3::Events.new(items: [Google::Apis::CalendarV3::Event], next_page_token: 'abc'),
92
- Google::Apis::CalendarV3::Events.new(items: [Google::Apis::CalendarV3::Event], next_page_token: nil)
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.0
4
+ version: 0.6.0
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-03-13 00:00:00.000000000 Z
11
+ date: 2023-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: exp_retry
@@ -39,19 +39,47 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  - !ruby/object:Gem::Dependency
42
- name: google-api-client
42
+ name: google-apis-calendar_v3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.23'
47
+ version: '0.27'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.23'
54
+ version: '0.27'
55
+ - !ruby/object:Gem::Dependency
56
+ name: google-apis-groupssettings_v1
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.13'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.13'
69
+ - !ruby/object:Gem::Dependency
70
+ name: google-apis-admin_directory_v1
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.40'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.40'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: ruby-progressbar
57
85
  requirement: !ruby/object:Gem::Requirement