omnievent-google 0.1.0.pre3 → 0.1.0.pre4
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/Gemfile.lock +3 -3
- data/lib/omnievent/google/version.rb +1 -1
- data/lib/omnievent/strategies/google.rb +6 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0da08dfc39ca1d3912e18b576d42e684e8a7eb593140391ac0cfbc007826878
|
4
|
+
data.tar.gz: 44ee373377dd2062cbd0386a2954ef2b823014d5929ae9cd403682e9ecbc4538
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55559e8dd02abd686ac26285a5f1d8c4e2e057b63abe9a074db5c960cda91f931c92f29f0eab9bab298f3ab9d8d12f7a734c39e410797007935de1851e731856
|
7
|
+
data.tar.gz: 640619807882127fcc589e63e68a7a79a04ab16e8b2092056aec95392d03810feafc53a19b63cae3f44eaf742ad8c330125aa6a03a679383b3e5262002b64361
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omnievent-google (0.1.0.
|
4
|
+
omnievent-google (0.1.0.pre3)
|
5
5
|
omnievent
|
6
6
|
omnievent-api
|
7
7
|
|
@@ -24,11 +24,11 @@ GEM
|
|
24
24
|
iso-639 (0.3.6)
|
25
25
|
json (2.7.2)
|
26
26
|
language_server-protocol (3.17.0.3)
|
27
|
-
omnievent (0.1.0.
|
27
|
+
omnievent (0.1.0.pre7)
|
28
28
|
hashie (>= 3.4.6)
|
29
29
|
iso-639 (~> 0.3.5)
|
30
30
|
tzinfo (~> 2.0)
|
31
|
-
omnievent-api (0.1.0.
|
31
|
+
omnievent-api (0.1.0.pre4)
|
32
32
|
excon
|
33
33
|
omnievent
|
34
34
|
parallel (1.26.3)
|
@@ -14,8 +14,10 @@ module OmniEvent
|
|
14
14
|
API_VERSION = "v3"
|
15
15
|
|
16
16
|
def raw_events
|
17
|
-
response = perform_request(path:
|
18
|
-
|
17
|
+
response = perform_request(path: path_with_params(request_path, list_params))
|
18
|
+
return [] unless response.is_a?(Hash) && response["items"]
|
19
|
+
|
20
|
+
events = response["items"]
|
19
21
|
|
20
22
|
next_link = build_next_link(response, list_params)
|
21
23
|
while next_link
|
@@ -30,7 +32,7 @@ module OmniEvent
|
|
30
32
|
def build_next_link(response, params)
|
31
33
|
return nil unless response && response["nextPageToken"]
|
32
34
|
|
33
|
-
|
35
|
+
path_with_params(request_path, params.merge(pageToken: response["nextPageToken"]))
|
34
36
|
end
|
35
37
|
|
36
38
|
def create_event
|
@@ -121,13 +123,6 @@ module OmniEvent
|
|
121
123
|
end
|
122
124
|
end
|
123
125
|
|
124
|
-
def request_path_with_params(params = {})
|
125
|
-
uri = URI.parse(request_path)
|
126
|
-
params.reject! { |_k, v| v.to_s.strip.empty? }
|
127
|
-
uri.query = URI.encode_www_form(params) unless params.empty?
|
128
|
-
uri.to_s
|
129
|
-
end
|
130
|
-
|
131
126
|
def request_url
|
132
127
|
"https://www.googleapis.com"
|
133
128
|
end
|
@@ -167,6 +162,7 @@ module OmniEvent
|
|
167
162
|
params = {}
|
168
163
|
params[:timeMin] = options.from_time if options.from_time
|
169
164
|
params[:timeMax] = options.to_time if options.to_time
|
165
|
+
params[:q] = options.match_name if options.match_name
|
170
166
|
params
|
171
167
|
end
|
172
168
|
end
|