diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d50b717c..da8ecdec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,15 +20,19 @@ jobs: - gemfiles/rails61.gemfile include: - gemfile: gemfiles/rails81.gemfile - ruby-version: 3.4.7 + ruby-version: 4.0.0 + - gemfile: gemfiles/rails81.gemfile + ruby-version: 3.4.8 - gemfile: gemfiles/rails81.gemfile ruby-version: 3.3.10 - gemfile: gemfiles/rails72.gemfile - ruby-version: 3.4.7 + ruby-version: 4.0.0 + - gemfile: gemfiles/rails72.gemfile + ruby-version: 3.4.8 - gemfile: gemfiles/rails72.gemfile ruby-version: 3.3.10 - gemfile: gemfiles/rails71.gemfile - ruby-version: 3.4.7 + ruby-version: 3.4.8 - gemfile: gemfiles/rails71.gemfile ruby-version: 3.3.10 - gemfile: gemfiles/rails70.gemfile diff --git a/Gemfile b/Gemfile index 18296292..0575b349 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ # This Gemfile is compatible with Ruby 2.5.0 or greater. To test with # earlier Rubies, use the appropriate Gemfile from the ./gemfiles/ dir. -ruby '3.4.7' +ruby '4.0.0' source 'https://rubygems.org' @@ -74,6 +74,11 @@ if GEM_VERSION_RAILS < Gem::Version.new('6.0') else gem 'delayed_job', '~> 4.1', :require => false end + +gem 'cgi' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.5.0') + +gem 'benchmark' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + gem 'generator_spec' gem 'redis', '<= 4.8.0' gem 'resque', '< 2.0.0' diff --git a/gemfiles/rails70.gemfile b/gemfiles/rails70.gemfile index 7db7c09e..50a19d4b 100644 --- a/gemfiles/rails70.gemfile +++ b/gemfiles/rails70.gemfile @@ -6,7 +6,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == ' gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby gem 'jruby-openssl', :platform => :jruby -gem 'rails', '~> 7.0.8' +gem 'rails', '~> 7.0.10' gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw] gem 'rspec-rails', '~> 6.0.3' diff --git a/gemfiles/rails71.gemfile b/gemfiles/rails71.gemfile index 956c7f16..5df549aa 100644 --- a/gemfiles/rails71.gemfile +++ b/gemfiles/rails71.gemfile @@ -6,7 +6,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == ' gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby gem 'jruby-openssl', :platform => :jruby -gem 'rails', '~> 7.1.0' +gem 'rails', '~> 7.1.6' gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw] gem 'rspec-rails', '~> 6.0.3' diff --git a/gemfiles/rails72.gemfile b/gemfiles/rails72.gemfile index d456165b..e2c5f206 100644 --- a/gemfiles/rails72.gemfile +++ b/gemfiles/rails72.gemfile @@ -6,7 +6,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == ' gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby gem 'jruby-openssl', :platform => :jruby -gem 'rails', '~> 7.2.0' +gem 'rails', '~> 7.2.3' gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw] gem 'rspec-rails', '~> 6.0.3' @@ -27,6 +27,10 @@ gem 'sucker_punch', '~> 2.0' # We need last sinatra that uses rack 2.x and ruby 2.5.x gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0' +gem 'cgi' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.5.0') + +gem 'benchmark' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + gem 'database_cleaner' gem 'delayed_job', '4.1.10', :require => false gem 'generator_spec' diff --git a/gemfiles/rails81.gemfile b/gemfiles/rails81.gemfile index ded7bbd9..96286207 100644 --- a/gemfiles/rails81.gemfile +++ b/gemfiles/rails81.gemfile @@ -6,7 +6,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == ' gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby gem 'jruby-openssl', :platform => :jruby -gem 'rails', '~> 8.1.0' +gem 'rails', '~> 8.1.1' gem 'sqlite3', '~> 2.1', :platform => [:ruby, :mswin, :mingw] gem 'rspec-rails', '~> 6.0.3' @@ -27,6 +27,10 @@ gem 'sucker_punch', '~> 2.0' # We need last sinatra that uses rack 2.x and ruby 2.5.x gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0' +gem 'cgi' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.5.0') + +gem 'benchmark' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + gem 'database_cleaner' gem 'delayed_job', '4.1.13', :require => false gem 'generator_spec' diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index 7086dcd8..d367c362 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -446,17 +446,29 @@ def send_req(meth, path, args) else expect(frames[-2][:method]).to be_eql('tap') end - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0') + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + expect(frames[-2][:locals]).to be_eql(locals[1]) + elsif Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0') expect(frames[-2][:locals]).to be_nil else expect(frames[-2][:locals]).to be_eql(locals[1]) end - expect(frames[-3][:locals]).to be_eql(locals[2]) - expect(frames[-4][:locals]).to be_eql(locals[3]) - # Frames: -5 (and -6 in rails < 8.0) are not app frames, and have different - # contents in different Ruby versions. - if Gem::Version.new(Rails.version) >= Gem::Version.new('8.0.0') + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + expect(frames[-3][:locals]).to be_eql(locals[3]) + else + expect(frames[-3][:locals]).to be_eql(locals[2]) + expect(frames[-4][:locals]).to be_eql(locals[3]) + end + + # Skip non-app frames, which vary based on Ruby and Rails versions + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + if Gem::Version.new(Rails.version) >= Gem::Version.new('8.0.0') + expect(frames[-5][:locals]).to be_eql(locals[4]) + else + expect(frames[-4][:locals]).to be_eql(locals[4]) + end + elsif Gem::Version.new(Rails.version) >= Gem::Version.new('8.0.0') expect(frames[-6][:locals]).to be_eql(locals[4]) else expect(frames[-7][:locals]).to be_eql(locals[4]) diff --git a/spec/rollbar/middleware/sinatra_spec.rb b/spec/rollbar/middleware/sinatra_spec.rb index 9913570c..fcae62d4 100644 --- a/spec/rollbar/middleware/sinatra_spec.rb +++ b/spec/rollbar/middleware/sinatra_spec.rb @@ -293,17 +293,29 @@ def app else expect(frames[-2][:method]).to be_eql('tap') end - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0') + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + expect(frames[-2][:locals]).to be_eql(locals[1]) + elsif Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0') expect(frames[-2][:locals]).to be_nil else expect(frames[-2][:locals]).to be_eql(locals[1]) end - expect(frames[-3][:locals]).to be_eql(locals[2]) - expect(frames[-4][:locals]).to be_eql(locals[3]) - # Frames: -5 (and -6 in rails < 8.0) are not app frames, and have different - # contents in different Ruby versions. - if Gem::Version.new(Rails.version) >= Gem::Version.new('8.0.0') + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + expect(frames[-3][:locals]).to be_eql(locals[3]) + else + expect(frames[-3][:locals]).to be_eql(locals[2]) + expect(frames[-4][:locals]).to be_eql(locals[3]) + end + + # Skip non-app frames, which vary based on Ruby and Rails versions + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('4.0.0') + if Gem::Version.new(Rails.version) >= Gem::Version.new('8.0.0') + expect(frames[-5][:locals]).to be_eql(locals[4]) + else + expect(frames[-4][:locals]).to be_eql(locals[4]) + end + elsif Gem::Version.new(Rails.version) >= Gem::Version.new('8.0.0') expect(frames[-6][:locals]).to be_eql(locals[4]) else expect(frames[-7][:locals]).to be_eql(locals[4]) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a81c1cdf..1985812b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,9 @@ begin require 'simplecov' - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new( SimpleCov::Formatter::HTMLFormatter - ] + ) SimpleCov.start do add_filter '/spec/'