search_console_api 0.0.4 → 0.0.5

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: 9909e7477906d0d92cadc90ecd8cf2573d2c745da25866bb649cbc286af8a2f4
4
- data.tar.gz: a53246341e253a27d8abcd229178f19549140e36b3c8ec3365d727a94aa942a4
3
+ metadata.gz: b7a35fdc9e89bb108402bf38f44138e8bde0d0364495850005e1994ac0c28f84
4
+ data.tar.gz: 9cea169a9eff63101a8f6c9d7d265ef36dd8b5fdf18ed2ce75eebc7f38399e08
5
5
  SHA512:
6
- metadata.gz: 3d9130eb30906c21ea2e5798b7c4c64c368dcb6eb6960196d623ad4c9bd9e39731c75cfcf6d2fe2ed9875da5d573923dbed63d5199917328870c132a5ca292f1
7
- data.tar.gz: 3fa282e04cd40b62b8aedfc9bd855c5a6fae06b194cffd0c1baa386aa7944d41ece717ebc2f6f9d42155092484eb6d1332975d153bb540b4d1591166c4f2925c
6
+ metadata.gz: 90513f07be9b036e58c981b5c3b8728b735f47b81ce3f5ea06152c627d7244dbc7ffffa2bd8eb0b7f4cf30ccf0ee31e301a501f39df5b0b5d2a10f582696a917
7
+ data.tar.gz: 72a81468d652f9bbb9a48355ad5821d4e7444c84b7c99ef9e1464208a296a65c3bce1d44b36ade526ad9216c0252ebfd2caa95bec9a7efbe68ed0470dfc6eb4d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- search_console_api (0.0.4)
4
+ search_console_api (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -23,6 +23,8 @@ module SearchConsoleApi
23
23
  end
24
24
 
25
25
  def call
26
+ return [] unless response["rows"].is_a?(Array)
27
+
26
28
  response["rows"].each_with_object([]) do |attrs, rows|
27
29
  rows << Objects::QueryResponseRow.new(attrs, @dimensions)
28
30
  end
@@ -35,7 +37,7 @@ module SearchConsoleApi
35
37
  private
36
38
 
37
39
  def response
38
- Request.post(
40
+ @response ||= Request.post(
39
41
  access_token: @access_token,
40
42
  path: request_path,
41
43
  payload: payload
@@ -7,6 +7,8 @@ module SearchConsoleApi
7
7
  end
8
8
 
9
9
  def call
10
+ return [] unless response["siteEntry"].is_a?(Array)
11
+
10
12
  response["siteEntry"].each_with_object([]) do |attrs, sites|
11
13
  sites << Objects::Site.new(attrs)
12
14
  end
@@ -15,7 +17,7 @@ module SearchConsoleApi
15
17
  private
16
18
 
17
19
  def response
18
- Request.get(access_token: @access_token, path: "/sites")
20
+ @response ||= Request.get(access_token: @access_token, path: "/sites")
19
21
  end
20
22
  end
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module SearchConsoleApi
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_console_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-12 00:00:00.000000000 Z
11
+ date: 2024-03-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A very humble wrapper for the Google Search Console API to be used in
14
14
  conjuntion with OAuth2