Skip to content

Commit

Permalink
remove usage of OpenStruct in DI
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Jan 9, 2025
1 parent aff0f7c commit df02a87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions integration/apps/hanami/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require 'datadog/demo_env'

source 'https://rubygems.org'

gem 'ostruct'
gem 'rake'
gem 'hanami', '~> 1.3'
gem 'hanami-model', '~> 1.3'
Expand Down
3 changes: 2 additions & 1 deletion lib/datadog/di/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def send_input(payload)

def send_request(desc, **options)
# steep:ignore:start
env = OpenStruct.new(**options)
#env = OpenStruct.new(**options)
env = Core::Transport::HTTP::Env.new(nil, options)
# steep:ignore:end
response = client.post(env)
unless response.ok?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def do_rc
# Events can be batched, meaning +post+ could be called once or twice
# depending on how threads are scheduled by the VM.
expect(component.transport.send(:client)).to receive(:post).at_least(:once) do |env|
expect(env).to be_a(OpenStruct)
#expect(env).to be_a(OpenStruct)
notify_payload = if env.path == '/debugger/v1/diagnostics'
JSON.parse(env.form.fetch('event').io.read, symbolize_names: true)
else
Expand Down

0 comments on commit df02a87

Please sign in to comment.