zgcp_toolkit 1.2.5 → 1.2.6
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 +4 -4
- data/lib/zgcp_toolkit/error_event_function_name.rb +23 -0
- data/lib/zgcp_toolkit/version.rb +1 -1
- data/lib/zgcp_toolkit.rb +1 -0
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d994ee019a6f7d2d003395eec676efa30656a60089a0e540f7908ffdbb9475f
|
|
4
|
+
data.tar.gz: 77fd54663cd9c02c82ed2c6edd483bf6fbd2c0397a47b6ddaeb3f03fc1f72c1c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ae57380c546c66ed8e8153d6105e638b9cae4a5a5f7ed4d7a69459727f76affb932ad2ee588de119a484ee85b8d95e53be7d436e7a5f3bdfbaf8c523df626db5
|
|
7
|
+
data.tar.gz: 9fbeb4c72ed424842bc9b07d51a9980cd7c1b93fd079a10e5b165e29dcb8fb70fb05434be19503b4a1983fac6a5537ce8d9a6a56b71e116ceb6e3aed8537e569
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require "google/cloud/error_reporting"
|
|
2
|
+
|
|
3
|
+
module ZgcpToolkit
|
|
4
|
+
# google-cloud-error_reporting (0.42.x) reads the function name of an error from the first backtrace line with
|
|
5
|
+
# /`(.*)'/. Ruby 3.4 changed the line from "in `method'" to "in 'Class#method'" (a straight quote and the class name),
|
|
6
|
+
# so on Ruby 3.4+ the function name is nil and Error Reporting loses it. This fills it in when the gem could not.
|
|
7
|
+
module ErrorEventFunctionName
|
|
8
|
+
# "path/file.rb:12:in `method'" (Ruby <= 3.3) / "path/file.rb:12:in 'Class#method'" (Ruby >= 3.4)
|
|
9
|
+
BACKTRACE_LINE = /\A.+?:\d+:in [`'](?<function_name>.*)'\z/.freeze
|
|
10
|
+
|
|
11
|
+
def from_exception(exception)
|
|
12
|
+
event = super
|
|
13
|
+
return event unless event.function_name.nil?
|
|
14
|
+
|
|
15
|
+
line = exception.backtrace&.first
|
|
16
|
+
match = BACKTRACE_LINE.match(line.to_s)
|
|
17
|
+
event.function_name = match[:function_name] if match
|
|
18
|
+
event
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
Google::Cloud::ErrorReporting::ErrorEvent.singleton_class.prepend(ZgcpToolkit::ErrorEventFunctionName)
|
data/lib/zgcp_toolkit/version.rb
CHANGED
data/lib/zgcp_toolkit.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zgcp_toolkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ZIGExN VeNtura developers
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -132,6 +131,7 @@ files:
|
|
|
132
131
|
- bin/console
|
|
133
132
|
- bin/setup
|
|
134
133
|
- lib/zgcp_toolkit.rb
|
|
134
|
+
- lib/zgcp_toolkit/error_event_function_name.rb
|
|
135
135
|
- lib/zgcp_toolkit/formatter/request.rb
|
|
136
136
|
- lib/zgcp_toolkit/generators/templates/zgcp_toolkit.rb
|
|
137
137
|
- lib/zgcp_toolkit/generators/zgcp_toolkit_generator.rb
|
|
@@ -146,7 +146,6 @@ licenses:
|
|
|
146
146
|
metadata:
|
|
147
147
|
allowed_push_host: https://rubygems.org
|
|
148
148
|
homepage_uri: https://github.com/ZIGExN/zgcp_toolkit
|
|
149
|
-
post_install_message:
|
|
150
149
|
rdoc_options: []
|
|
151
150
|
require_paths:
|
|
152
151
|
- lib
|
|
@@ -161,8 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
160
|
- !ruby/object:Gem::Version
|
|
162
161
|
version: '0'
|
|
163
162
|
requirements: []
|
|
164
|
-
rubygems_version:
|
|
165
|
-
signing_key:
|
|
163
|
+
rubygems_version: 4.0.20
|
|
166
164
|
specification_version: 4
|
|
167
165
|
summary: GCP Toolkit
|
|
168
166
|
test_files: []
|