bps-google-api 0.4.12 → 0.5.1

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: dbdc8c4373d9529ae2bb293a984152c8b63aecbe580cd6f44bb0de168f1f244f
4
- data.tar.gz: 163c36bd9077b256c0181587ba4a2ba7d8d61ed1c9fcf272cd0d6565d8b7f62d
3
+ metadata.gz: 67669257142314c0e1c703dcd7553a52826e5233efdf201d11d2b3756cb3c432
4
+ data.tar.gz: 1e946c30ee44aa29890b1a6bf889a78d428633980c4233a27d52f218afe4259a
5
5
  SHA512:
6
- metadata.gz: acf4e1ced97d4a4dfbd497e238980b86eb94847173132c77c750967986ce4ac7971ea4739cdc097e62b819dcc6a9962faa17e9610889ecbdaf2bd2e4a4025484
7
- data.tar.gz: '00916fda444d3cd6580a611293a260af8cdbb1cd7324bffadcaee67c32626861e86c9ae06f89efabd45ca529e99a28e63c75337d8631b00fd21a46c9157a00fd'
6
+ metadata.gz: 9ebef8848cc1f097db66ddeb5f1ba7ed7a60efde57a24839eb42e047aea0e6bc366bc0e3e4c72f1933aebe2d3c988848e0058ec635df21e2b6e3769f81904f83
7
+ data.tar.gz: 3c69d7700f0521654c56b8f13b68f3b7cddbdd2f4713bafd337249d4cd75d8cc6496c81115c4ea302941b6f27b6e46bea6f0644e33d3884981ed6c49c096ff41
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,48 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bps-google-api (0.4.12)
4
+ bps-google-api (0.5.1)
5
5
  exp_retry (~> 0.0.13)
6
6
  fileutils (~> 1.2)
7
- google-api-client (~> 0.23.4)
7
+ google-api-client (~> 0.23)
8
8
  ruby-progressbar (~> 1.10)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.1)
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.3)
14
20
  public_suffix (>= 2.0.2, < 6.0)
15
21
  ast (2.4.0)
22
+ concurrent-ruby (1.2.2)
16
23
  declarative (0.0.20)
17
24
  diff-lcs (1.3)
18
25
  docile (1.3.2)
19
26
  exp_retry (0.0.14)
20
- faraday (0.17.6)
21
- multipart-post (>= 1.2, < 3)
22
- fileutils (1.5.0)
23
- google-api-client (0.23.9)
27
+ faraday (1.10.3)
28
+ faraday-em_http (~> 1.0)
29
+ faraday-em_synchrony (~> 1.0)
30
+ faraday-excon (~> 1.1)
31
+ faraday-httpclient (~> 1.0)
32
+ faraday-multipart (~> 1.0)
33
+ faraday-net_http (~> 1.0)
34
+ faraday-net_http_persistent (~> 1.0)
35
+ faraday-patron (~> 1.0)
36
+ faraday-rack (~> 1.0)
37
+ faraday-retry (~> 1.0)
38
+ ruby2_keywords (>= 0.0.4)
39
+ faraday-em_http (1.0.0)
40
+ faraday-em_synchrony (1.0.0)
41
+ faraday-excon (1.1.0)
42
+ faraday-httpclient (1.0.1)
43
+ faraday-multipart (1.0.4)
44
+ multipart-post (~> 2)
45
+ faraday-net_http (1.0.1)
46
+ faraday-net_http_persistent (1.2.0)
47
+ faraday-patron (1.0.0)
48
+ faraday-rack (1.0.0)
49
+ faraday-retry (1.0.3)
50
+ fileutils (1.7.1)
51
+ gems (1.2.0)
52
+ google-api-client (0.53.0)
53
+ google-apis-core (~> 0.1)
54
+ google-apis-generator (~> 0.1)
55
+ google-apis-core (0.11.0)
24
56
  addressable (~> 2.5, >= 2.5.1)
25
- googleauth (>= 0.5, < 0.7.0)
26
- httpclient (>= 2.8.1, < 3.0)
27
- mime-types (~> 3.0)
57
+ googleauth (>= 0.16.2, < 2.a)
58
+ httpclient (>= 2.8.1, < 3.a)
59
+ mini_mime (~> 1.0)
28
60
  representable (~> 3.0)
29
- retriable (>= 2.0, < 4.0)
30
- signet (~> 0.9)
31
- googleauth (0.6.7)
32
- faraday (~> 0.12)
61
+ retriable (>= 2.0, < 4.a)
62
+ rexml
63
+ 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)
69
+ google-apis-core (>= 0.11.0, < 2.a)
70
+ google-apis-discovery_v1 (~> 0.5)
71
+ thor (>= 0.20, < 2.a)
72
+ googleauth (1.1.3)
73
+ faraday (>= 0.17.3, < 3.a)
33
74
  jwt (>= 1.4, < 3.0)
34
75
  memoist (~> 0.16)
35
76
  multi_json (~> 1.11)
36
77
  os (>= 0.9, < 2.0)
37
- signet (~> 0.7)
78
+ signet (>= 0.16, < 2.a)
38
79
  httpclient (2.8.3)
80
+ i18n (1.12.0)
81
+ concurrent-ruby (~> 1.0)
39
82
  jaro_winkler (1.5.3)
40
83
  json (2.3.1)
41
- jwt (2.3.0)
84
+ jwt (2.7.0)
42
85
  memoist (0.16.2)
43
- mime-types (3.4.1)
44
- mime-types-data (~> 3.2015)
45
- mime-types-data (3.2023.0218.1)
86
+ mini_mime (1.1.2)
87
+ minitest (5.15.0)
46
88
  multi_json (1.15.0)
47
89
  multipart-post (2.3.0)
48
90
  os (1.1.4)
@@ -56,6 +98,7 @@ GEM
56
98
  trailblazer-option (>= 0.1.1, < 0.2.0)
57
99
  uber (< 0.2.0)
58
100
  retriable (3.1.2)
101
+ rexml (3.2.5)
59
102
  rspec (3.8.0)
60
103
  rspec-core (~> 3.8.0)
61
104
  rspec-expectations (~> 3.8.0)
@@ -77,9 +120,10 @@ GEM
77
120
  ruby-progressbar (~> 1.7)
78
121
  unicode-display_width (>= 1.4.0, < 1.7)
79
122
  ruby-progressbar (1.10.1)
80
- signet (0.14.1)
81
- addressable (~> 2.3)
82
- faraday (>= 0.17.3, < 2.0)
123
+ ruby2_keywords (0.0.5)
124
+ signet (0.16.1)
125
+ addressable (~> 2.8)
126
+ faraday (>= 0.17.5, < 3.0)
83
127
  jwt (>= 1.5, < 3.0)
84
128
  multi_json (~> 1.10)
85
129
  simplecov (0.16.1)
@@ -87,9 +131,14 @@ GEM
87
131
  json (>= 1.8, < 3)
88
132
  simplecov-html (~> 0.10.0)
89
133
  simplecov-html (0.10.2)
134
+ thor (1.2.1)
90
135
  trailblazer-option (0.1.2)
136
+ tzinfo (2.0.6)
137
+ concurrent-ruby (~> 1.0)
91
138
  uber (0.1.0)
92
139
  unicode-display_width (1.6.0)
140
+ webrick (1.8.1)
141
+ zeitwerk (2.6.7)
93
142
 
94
143
  PLATFORMS
95
144
  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.4.12'
6
- s.date = '2023-03-13'
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'
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_runtime_dependency 'exp_retry', '~> 0.0.13'
19
19
  s.add_runtime_dependency 'fileutils', '~> 1.2'
20
- s.add_runtime_dependency 'google-api-client', '~> 0.23.4'
20
+ s.add_runtime_dependency 'google-api-client', '~> 0.23'
21
21
  s.add_runtime_dependency 'ruby-progressbar', '~> 1.10'
22
22
 
23
23
  s.add_development_dependency 'rspec', '~> 3.8', '>= 3.8.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.4.12
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-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
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.23.4
47
+ version: '0.23'
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.4
54
+ version: '0.23'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: ruby-progressbar
57
57
  requirement: !ruby/object:Gem::Requirement