Skip to content

Commit 107c0d3

Browse files
committed
Updating GCLOUD_KEYFILE_JSON to work with googleauth/v1.10.0 and higher.
1 parent 6d5d0c0 commit 107c0d3

9 files changed

Lines changed: 237 additions & 216 deletions

File tree

.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Layout/SpaceAroundMethodCallOperator:
3030
Layout/EmptyLinesAroundAttributeAccessor:
3131
Enabled: false
3232

33+
Layout/LineEndStringConcatenationIndentation:
34+
Enabled: false
35+
3336
##################### Lint ###########################
3437

3538
Lint/SendWithMixinArgument:
@@ -73,6 +76,9 @@ Style/DocumentDynamicEvalDefinition:
7376
Exclude:
7477
- "lib/active_model/datastore/carrier_wave_uploader.rb"
7578

79+
Style/FetchEnvVar:
80+
Enabled: false
81+
7682
#################### Metrics #########################
7783

7884
Metrics/ModuleLength:
@@ -88,6 +94,8 @@ Metrics/ClassLength:
8894
Metrics/MethodLength:
8995
CountComments: false
9096
Max: 20
97+
Exclude:
98+
- 'lib/active_model/datastore/carrier_wave_uploader.rb'
9199

92100
Metrics/BlockLength:
93101
Exclude:

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.2
1+
3.3.0

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 0.8.0 / 2024-03-05
2+
* updating GCLOUD_KEYFILE_JSON to work with the latest version of GoogleAuth
3+
14
### 0.7.0 / 2021-11-04
25
* adding support for Ruby 3
36

lib/active_model/datastore/connection.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ module CloudDatastore
2121
ENV['GCLOUD_PROJECT'] ||= 'test-datastore'
2222
elsif ENV['SERVICE_ACCOUNT_PRIVATE_KEY'].present? &&
2323
ENV['SERVICE_ACCOUNT_CLIENT_EMAIL'].present?
24-
ENV['GCLOUD_KEYFILE_JSON'] ||= '{"private_key": "' + ENV['SERVICE_ACCOUNT_PRIVATE_KEY'] + '",
25-
"client_email": "' + ENV['SERVICE_ACCOUNT_CLIENT_EMAIL'] + '"}'
24+
ENV['GCLOUD_KEYFILE_JSON'] ||=
25+
'{' \
26+
'"private_key": "' + ENV['SERVICE_ACCOUNT_PRIVATE_KEY'] + '",' \
27+
'"client_email": "' + ENV['SERVICE_ACCOUNT_CLIENT_EMAIL'] + '",' \
28+
'"type": "service_account"' \
29+
'}'
2630
end
2731
end
2832

lib/active_model/datastore/track_changes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def remove_unmodified_children
8888
with_changes = Array(send(attr.to_sym)).select(&:values_changed?)
8989
send("#{attr}=", with_changes)
9090
end
91-
nested_attributes.delete_if { |attr| Array(send(attr.to_sym)).size.zero? }
91+
nested_attributes.delete_if { |attr| Array(send(attr.to_sym)).empty? }
9292
end
9393

9494
module ClassMethods
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module ActiveModel
22
module Datastore
3-
VERSION = '0.7.0'
3+
VERSION = '0.8.0'
44
end
55
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.2
1+
3.3.0

test/support/datastore_example_rails_app/Gemfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
source 'https://rubygems.org'
2+
ruby File.read('.ruby-version').strip
23

34
###########################################################################################
4-
git_source(:github) do |repo_name|
5-
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
6-
"https://github.com/#{repo_name}.git"
7-
end
5+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
86
# gem 'foo_bar', :github => 'foo/bar'
97
# Bundler would attempt to download the gem from https://github.com/foo/bar.git.
108
###########################################################################################

0 commit comments

Comments
 (0)