resteze 0.3.1 → 0.4.0

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.
@@ -1,6 +1,7 @@
1
1
  module Resteze
2
2
  class Client
3
3
  include Resteze::ApiModule
4
+ prepend Resteze::Instrumentation
4
5
 
5
6
  def self.user_agent
6
7
  [
@@ -0,0 +1,14 @@
1
+ module Resteze
2
+ module Instrumentation
3
+ def execute_request(method, path, ...)
4
+ payload = { method: method, path: path, api_module: api_module.name }
5
+
6
+ ActiveSupport::Notifications.instrument("request.#{api_module::INSTRUMENTATION_KEY}", payload) do
7
+ super.tap do |response|
8
+ payload[:status] = response.http_status
9
+ payload[:request_id] = response.request_id
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resteze
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/resteze.rb CHANGED
@@ -18,6 +18,7 @@ require "resteze/save"
18
18
  require "resteze/object"
19
19
 
20
20
  # API Classes
21
+ require "resteze/instrumentation"
21
22
  require "resteze/client"
22
23
  require "resteze/errors"
23
24
  require "resteze/list_object"
@@ -79,6 +80,7 @@ module Resteze
79
80
  end
80
81
 
81
82
  # Setup magic constants
83
+ const_set :INSTRUMENTATION_KEY, name.underscore.tr("/", "_") unless const_defined?("#{self}::INSTRUMENTATION_KEY")
82
84
  const_set :Object, Class.new(Resteze::Object)
83
85
  const_set :Client, Class.new(Resteze::Client)
84
86
  const_set :Response, Class.new(Resteze::Response)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resteze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JD Hendrickson
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-08-12 00:00:00.000000000 Z
10
+ date: 2026-06-30 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: actionpack
@@ -76,17 +76,24 @@ files:
76
76
  - ".rubocop.yml"
77
77
  - ".ruby-version"
78
78
  - CHANGELOG.md
79
+ - CLAUDE.md
79
80
  - Guardfile
80
81
  - LICENSE.txt
81
82
  - README.md
82
83
  - Rakefile
83
84
  - assets/resteze.png
84
85
  - assets/resteze.svg
86
+ - docs/ADVANCED_USAGE.md
87
+ - docs/API.md
88
+ - docs/CONFIGURATION.md
89
+ - docs/ERROR_HANDLING.md
90
+ - docs/TESTING.md
85
91
  - lib/resteze.rb
86
92
  - lib/resteze/api_module.rb
87
93
  - lib/resteze/api_resource.rb
88
94
  - lib/resteze/client.rb
89
95
  - lib/resteze/errors.rb
96
+ - lib/resteze/instrumentation.rb
90
97
  - lib/resteze/list.rb
91
98
  - lib/resteze/list_object.rb
92
99
  - lib/resteze/middleware/raise_error.rb