katalyst-google-apis 1.3.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 249511e97a7e28426cbf5ad750c3c77c1dc5f882c885a37868537bfea975a9e7
4
- data.tar.gz: 86758221a5cdc2a554d767a7e126b1acd48d3034b87100e23dd88876e291e713
3
+ metadata.gz: 7b20f30239ff09170beb094e155676df9da9a96f7693d90aed8bac756b693e77
4
+ data.tar.gz: d3ab4d196dacb58ed7c1c9b2a04715bd08f6c8871918bc1359c5054839e923d4
5
5
  SHA512:
6
- metadata.gz: da31ead0972e8152ab79e04c2a18ed875dcc367187f8ee03a60f7d89337d85956f95f944f524852eddd8fbe940da4e45884bd39dae471d499134a19faaccea59
7
- data.tar.gz: ece80e3217d17d22c28f8b787c10ad843200b3c322b6dd1427b2a13ef3bdcbd4df484adeccef53ef83c5d12d104bbfc012fd0a49e39a5834e4a7dda7b71e393a
6
+ metadata.gz: afb1e05bc0bdea960d8a572da3d5448fea590830440f97f753cc99ac2361109268b502f8d90375db938657e201e892bc02312d8f8cbfae624e85124197838a4e
7
+ data.tar.gz: 69fcfce31104540742fd9c23eb8da530695f3eef9137d80ae2aab06340c67f27196dcaad73d5caac374b58e28e93b455e811f5f0345fee674fa3503bde848c62
@@ -8,8 +8,8 @@ module Katalyst
8
8
  def initialize(code:, status:, message:, details: nil)
9
9
  super(message)
10
10
 
11
- @code = code
12
- @status = status
11
+ @code = code
12
+ @status = status
13
13
  @details = details
14
14
  end
15
15
 
@@ -16,11 +16,11 @@ module Katalyst
16
16
 
17
17
  def initialize(credentials:, model:, parent:, attempt:, retries:, jitter:)
18
18
  @credentials = credentials
19
- @model = model
20
- @parent = parent
21
- @attempt = attempt
22
- @retries = retries
23
- @jitter = jitter
19
+ @model = model
20
+ @parent = parent
21
+ @attempt = attempt
22
+ @retries = retries
23
+ @jitter = jitter
24
24
  end
25
25
 
26
26
  def call(payload:)
@@ -101,8 +101,8 @@ module Katalyst
101
101
  Kernel.sleep(backoff)
102
102
 
103
103
  @response = nil
104
- @result = nil
105
- @error = nil
104
+ @result = nil
105
+ @error = nil
106
106
  @attempt += 1
107
107
  true
108
108
  else
@@ -74,7 +74,7 @@ module Katalyst
74
74
  location = first_location&.dig(:location)
75
75
  return if location.blank?
76
76
 
77
- latitude = location[:latitude]
77
+ latitude = location[:latitude]
78
78
  longitude = location[:longitude]
79
79
  return if latitude.nil? || longitude.nil?
80
80
 
@@ -23,7 +23,7 @@ module Katalyst
23
23
 
24
24
  def call(address:, bounds:)
25
25
  @address = address
26
- @bounds = bounds
26
+ @bounds = bounds
27
27
 
28
28
  @response = Curl.get(url, **params) do |http|
29
29
  http.headers["Content-Type"] = "application/json; UTF-8"
@@ -75,7 +75,7 @@ module Katalyst
75
75
  location = first_location&.dig(:location)
76
76
  return if location.blank?
77
77
 
78
- latitude = location[:latitude]
78
+ latitude = location[:latitude]
79
79
  longitude = location[:longitude]
80
80
  return if latitude.nil? || longitude.nil?
81
81
 
@@ -95,7 +95,7 @@ module Katalyst
95
95
  def params
96
96
  low, high = @bounds.split("|")
97
97
 
98
- low_lat, low_lng = low.split(",")
98
+ low_lat, low_lng = low.split(",")
99
99
  high_lat, high_lng = high.split(",")
100
100
 
101
101
  {
@@ -14,7 +14,7 @@ module Katalyst
14
14
 
15
15
  def initialize(credentials:, parent:)
16
16
  @credentials = credentials
17
- @parent = parent
17
+ @parent = parent
18
18
  end
19
19
 
20
20
  def call(assessment:)
@@ -3,20 +3,19 @@
3
3
  module Katalyst
4
4
  module GoogleApis
5
5
  class Config
6
- include ActiveSupport::Configurable
6
+ attr_accessor :project_id, :project_number, :service_account_email, :identity_pool, :identity_provider, :recaptcha
7
7
 
8
- config_accessor(:project_id) { ENV.fetch("GOOGLE_PROJECT_ID", nil) }
9
- config_accessor(:project_number) { ENV.fetch("GOOGLE_PROJECT_NUMBER", nil) }
10
- config_accessor(:service_account_email) { ENV.fetch("GOOGLE_SERVICE_ACCOUNT_EMAIL", nil) }
11
- config_accessor(:identity_pool) { ENV.fetch("GOOGLE_OIDC_IDENTITY_POOL", nil) }
12
- config_accessor(:identity_provider) { ENV.fetch("GOOGLE_OIDC_IDENTITY_PROVIDER", nil) }
13
-
14
- config_accessor(:recaptcha) do
15
- defaults = ActiveSupport::OrderedOptions.new
16
- defaults.site_key = ENV.fetch("GOOGLE_RECAPTCHA_SITE_KEY", nil)
17
- defaults.score = ENV.fetch("GOOGLE_RECAPTCHA_SCORE", 0.5).to_f
18
- defaults.test_mode = !ENV.fetch("VERIFY_RECAPTCHA", !Rails.env.local?) # rubocop:disable Rails/UnknownEnv
19
- defaults
8
+ def initialize
9
+ @project_id = ENV.fetch("GOOGLE_PROJECT_ID", nil)
10
+ @project_number = ENV.fetch("GOOGLE_PROJECT_NUMBER", nil)
11
+ @service_account_email = ENV.fetch("GOOGLE_SERVICE_ACCOUNT_EMAIL", nil)
12
+ @identity_pool = ENV.fetch("GOOGLE_OIDC_IDENTITY_POOL", nil)
13
+ @identity_provider = ENV.fetch("GOOGLE_OIDC_IDENTITY_PROVIDER", nil)
14
+ @recaptcha = ActiveSupport::OrderedOptions.new.tap do |defaults|
15
+ defaults.site_key = ENV.fetch("GOOGLE_RECAPTCHA_SITE_KEY", nil)
16
+ defaults.score = ENV.fetch("GOOGLE_RECAPTCHA_SCORE", 0.5).to_f
17
+ defaults.test_mode = !ENV.fetch("VERIFY_RECAPTCHA", !Rails.env.local?)
18
+ end
20
19
  end
21
20
  end
22
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-google-apis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  requirements: []
115
- rubygems_version: 4.0.3
115
+ rubygems_version: 4.0.10
116
116
  specification_version: 4
117
117
  summary: Google REST APIs for use in Rails projects
118
118
  test_files: []