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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eeafe2b5cca73ec09f5bb069adcd1a98a07a85ab1cb83a76f8accedb66dae9a
4
- data.tar.gz: ea65366a0f5e1e86f955c5a4475bbd19afcea70a073bc051575211c98fc4b87f
3
+ metadata.gz: e1e4bf62eba42aeba178d6c4480bbd6b56c652a0d0421529e2d38d3061376b9d
4
+ data.tar.gz: d0e05532ef2aff6431207eb9ab45427f80ae1f4bd46b4c022ee58dc1aa3f285d
5
5
  SHA512:
6
- metadata.gz: b3d6a6e95467671f6fe0fd32bef64b6b90810b88c1bef4b5ec98d67c0a2e0d7a8a6d5ec8713098bc03fc8c21f757d5dbd9b260db29189186abcf6e2a6af4bb34
7
- data.tar.gz: 5a4fe20002bcbc990aeb3e1ffe0133f809196805d93386fa37a81f045a84388116f20510523dc7a145cf2504f6043bbbf969d41e7fc06a52b5a020f660e3ba82
6
+ metadata.gz: 0f647c9c65c332d9efb70b57f7ce2ce0269b9cb34f38b86c717d7568a966ab3175527294cec2361494e3741b48c941e818a18434938f590a225abf038bf09416
7
+ data.tar.gz: 8baee4e6ffed98dd4f9d17240876f355a1227caedae54a022a92ee621962a7ae5269869e3cb6b2c878e6d4379b906338f9fc3de972b20237858773be4346f6a5
@@ -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(":").first
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 }
@@ -434,10 +434,10 @@ module Google
434
434
  str = data.strip
435
435
  return str if ::File.file? str
436
436
  json = begin
437
- ::JSON.parse str
438
- rescue ::StandardError
439
- nil
440
- end
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
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Core
19
- VERSION = "1.2.7".freeze
19
+ VERSION = "1.3.0".freeze
20
20
  end
21
21
  end
22
22
  end
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.2.7
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: 2018-09-21 00:00:00.000000000 Z
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.50.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.50.0
125
+ version: 0.61.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: simplecov
128
128
  requirement: !ruby/object:Gem::Requirement