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.
- checksums.yaml +4 -4
- data/CLAUDE.md +74 -0
- data/README.md +31 -0
- data/docs/ADVANCED_USAGE.md +760 -0
- data/docs/API.md +410 -0
- data/docs/CONFIGURATION.md +681 -0
- data/docs/ERROR_HANDLING.md +609 -0
- data/docs/TESTING.md +768 -0
- data/lib/resteze/client.rb +1 -0
- data/lib/resteze/instrumentation.rb +14 -0
- data/lib/resteze/version.rb +1 -1
- data/lib/resteze.rb +2 -0
- metadata +9 -2
data/lib/resteze/client.rb
CHANGED
|
@@ -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
|
data/lib/resteze/version.rb
CHANGED
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.
|
|
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:
|
|
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
|