google-cloud-core 1.2.7 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud.rb +8 -1
- data/lib/google/cloud/config.rb +4 -4
- data/lib/google/cloud/core/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1e4bf62eba42aeba178d6c4480bbd6b56c652a0d0421529e2d38d3061376b9d
|
4
|
+
data.tar.gz: d0e05532ef2aff6431207eb9ab45427f80ae1f4bd46b4c022ee58dc1aa3f285d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f647c9c65c332d9efb70b57f7ce2ce0269b9cb34f38b86c717d7568a966ab3175527294cec2361494e3741b48c941e818a18434938f590a225abf038bf09416
|
7
|
+
data.tar.gz: 8baee4e6ffed98dd4f9d17240876f355a1227caedae54a022a92ee621962a7ae5269869e3cb6b2c878e6d4379b906338f9fc3de972b20237858773be4346f6a5
|
data/lib/google/cloud.rb
CHANGED
@@ -81,6 +81,9 @@ module Google
|
|
81
81
|
# when running from GCP environments.
|
82
82
|
# * `credentials`: The service account JSON file path. Automatically
|
83
83
|
# discovered when running from GCP environments.
|
84
|
+
# * `on_error`: A Proc to be run when an error is encountered during on a
|
85
|
+
# background thread. The Proc must take the error object as
|
86
|
+
# the single argument.
|
84
87
|
#
|
85
88
|
# @return [Google::Cloud::Config] The top-level configuration object for
|
86
89
|
# Google::Cloud libraries.
|
@@ -114,6 +117,7 @@ module Google
|
|
114
117
|
config.add_alias! :project, :project_id
|
115
118
|
config.add_field! :credentials, default_creds, match: Object
|
116
119
|
config.add_alias! :keyfile, :credentials
|
120
|
+
config.add_field! :on_error, nil, match: Proc
|
117
121
|
end
|
118
122
|
end
|
119
123
|
|
@@ -204,7 +208,10 @@ module Google
|
|
204
208
|
#
|
205
209
|
def self.loaded_files
|
206
210
|
files = Array(caller).map do |backtrace_line|
|
207
|
-
backtrace_line.split(":").
|
211
|
+
until backtrace_line.split(":").size < 2 || File.file?(backtrace_line)
|
212
|
+
backtrace_line = backtrace_line.split(":")[0..-2].join(":")
|
213
|
+
end
|
214
|
+
backtrace_line
|
208
215
|
end
|
209
216
|
files.uniq!
|
210
217
|
files.select! { |file| File.file? file }
|
data/lib/google/cloud/config.rb
CHANGED
@@ -434,10 +434,10 @@ module Google
|
|
434
434
|
str = data.strip
|
435
435
|
return str if ::File.file? str
|
436
436
|
json = begin
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
437
|
+
::JSON.parse str
|
438
|
+
rescue ::StandardError
|
439
|
+
nil
|
440
|
+
end
|
441
441
|
return json if json.is_a? ::Hash
|
442
442
|
end
|
443
443
|
nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-env
|
@@ -115,14 +115,14 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.
|
118
|
+
version: 0.61.0
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
125
|
+
version: 0.61.0
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: simplecov
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|