From f4e2026b2513e1a7566fe9c47173f34564280557 Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Tue, 24 Feb 2026 14:57:25 +0100 Subject: [PATCH] Ignore vernier on ruby 4.1.0 --- sentry-ruby/Gemfile | 2 +- sentry-ruby/spec/sentry/vernier/profiler_spec.rb | 6 +++--- sentry-ruby/spec/spec_helper.rb | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sentry-ruby/Gemfile b/sentry-ruby/Gemfile index e321c4c2b..68dc0d2b4 100644 --- a/sentry-ruby/Gemfile +++ b/sentry-ruby/Gemfile @@ -21,7 +21,7 @@ gem "puma" gem "timecop" gem "stackprof" unless RUBY_PLATFORM == "java" -gem "vernier", platforms: :ruby if RUBY_VERSION >= "3.2.1" +gem "vernier", platforms: :ruby if ruby_version >= Gem::Version.new("3.3") && ruby_version < Gem::Version.new("4.1.0") gem "graphql", ">= 2.2.6" diff --git a/sentry-ruby/spec/sentry/vernier/profiler_spec.rb b/sentry-ruby/spec/sentry/vernier/profiler_spec.rb index d6c564a77..af373a660 100644 --- a/sentry-ruby/spec/sentry/vernier/profiler_spec.rb +++ b/sentry-ruby/spec/sentry/vernier/profiler_spec.rb @@ -2,7 +2,7 @@ require "sentry/vernier/profiler" -RSpec.describe Sentry::Vernier::Profiler, when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do +RSpec.describe Sentry::Vernier::Profiler, when: :vernier_installed? do subject(:profiler) { described_class.new(Sentry.configuration) } before do @@ -283,7 +283,7 @@ expect(thread2[:name]).to eq("thread-bar-1") end - it 'has correct frames', when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do + it 'has correct frames' do frames = profiler.to_h[:profile][:frames] foo_frame = frames.find { |f| f[:function] =~ /foo/ } @@ -296,7 +296,7 @@ expect(foo_frame[:abs_path]).to include('sentry-ruby/spec/support/profiler.rb') end - it 'has correct stacks', when: { ruby_version?: [:>=, "3.3"], ruby_engine?: "ruby" } do + it 'has correct stacks' do profile = profiler.to_h[:profile] frames = profile[:frames] stacks = profile[:stacks] diff --git a/sentry-ruby/spec/spec_helper.rb b/sentry-ruby/spec/spec_helper.rb index 084c0c304..6aaf34d4a 100644 --- a/sentry-ruby/spec/spec_helper.rb +++ b/sentry-ruby/spec/spec_helper.rb @@ -10,7 +10,10 @@ require "rspec/retry" require "redis" require "stackprof" unless RUBY_PLATFORM == "java" -require "vernier" unless RUBY_PLATFORM == "java" || RUBY_VERSION < "3.2" +begin + require "vernier" +rescue LoadError +end SimpleCov.start do project_name "sentry-ruby"