Skip to content

Commit

Permalink
Fix specs breaking on Ruby 2.3 due to missing String#unpack1
Browse files Browse the repository at this point in the history
Sigh old rubies...
  • Loading branch information
ivoanjo committed Mar 6, 2024
1 parent 66ade00 commit 6b3bc3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ Performance/RegexpMatch:
Performance/Sum:
Enabled: false

# Requires Ruby 2.4
Style/UnpackFirst:
Enabled: false

# Requires Ruby 2.5
Style/RedundantBegin:
Enabled: false
Expand Down
2 changes: 1 addition & 1 deletion spec/datadog/profiling/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def samples_from_pprof(pprof_data)

# Tell Ruby to reinterpret the number back into uint64 little-endian bytes, and then read them again;
# Protocol buffers always represents stuff as little-endian https://protobuf.dev/programming-guides/encoding/
[it.num].pack('Q<').unpack1('Q<')
[it.num].pack('Q<').unpack('Q<').first
else
it.num
end
Expand Down

0 comments on commit 6b3bc3f

Please sign in to comment.