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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6da4439ca7d0e692eff03f71b1aa8f4292a68d121288e209dbb4943d3c4a6d0
4
- data.tar.gz: f758903d9841fccef81dbcce7e63b53fa3f6f89538c4fb6a7d168303c56d3884
3
+ metadata.gz: 2d994ee019a6f7d2d003395eec676efa30656a60089a0e540f7908ffdbb9475f
4
+ data.tar.gz: 77fd54663cd9c02c82ed2c6edd483bf6fbd2c0397a47b6ddaeb3f03fc1f72c1c
5
5
  SHA512:
6
- metadata.gz: b1f69d7a91ee823dd043b7186f966e6f5fc2b133d29192cca0746c2b2fdc2766663bf43d8725ad9cd08ad914311b2dcccd450a89fde693b2b672169928a2c097
7
- data.tar.gz: 43bf44475cf255d4393c784970cb5fe468f907f9ca3782f7eca72cd9d70e3dd375e1f95eab61c835921ef4744a512597f9c8d3b5c5d57cb12c4d88b5d251f8a9
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)
@@ -1,3 +1,3 @@
1
1
  module ZgcpToolkit
2
- VERSION = '1.2.5'
2
+ VERSION = '1.2.6'
3
3
  end
data/lib/zgcp_toolkit.rb CHANGED
@@ -2,6 +2,7 @@ require "zgcp_toolkit/version"
2
2
 
3
3
  module ZgcpToolkit; end
4
4
 
5
+ require 'zgcp_toolkit/error_event_function_name'
5
6
  require 'zgcp_toolkit/logger'
6
7
  require 'zgcp_toolkit/formatter/request'
7
8
  require 'zgcp_toolkit/generators/zgcp_toolkit_generator'
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.5
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: 2026-11-12 00:00:00.000000000 Z
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: 3.5.22
165
- signing_key:
163
+ rubygems_version: 4.0.20
166
164
  specification_version: 4
167
165
  summary: GCP Toolkit
168
166
  test_files: []