From 738a3c0c8bb30e61dbd5704c0d32c3f4fb20fc5e Mon Sep 17 00:00:00 2001 From: Vladimir Dementyev Date: Fri, 13 Sep 2024 17:22:59 -0700 Subject: [PATCH] Ruby 3.1 is required --- .rubocop.yml | 2 +- anyt-core.gemspec | 2 +- etc/tests/periodic_timers_test.rb | 1 - lib/anyt/ext/minitest.rb | 12 ++++++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7d08794..5ed8675 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,7 +13,7 @@ AllCops: - 'gemfiles/**/*' DisplayCopNames: true SuggestExtensions: false - TargetRubyVersion: 2.6 + TargetRubyVersion: 3.1 Standard/BlockSingleLineBraces: Enabled: false diff --git a/anyt-core.gemspec b/anyt-core.gemspec index 590175a..60db572 100644 --- a/anyt-core.gemspec +++ b/anyt-core.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |spec| spec.files = Dir.glob("lib/**/*") + Dir.glob("bin/*") + %w[README.md MIT-LICENSE] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.6.0" + spec.required_ruby_version = ">= 3.1.0" spec.add_dependency "rack", ">= 2.0" spec.add_dependency "rails", ">= 6.0" diff --git a/etc/tests/periodic_timers_test.rb b/etc/tests/periodic_timers_test.rb index 1f37a5c..ebf12c2 100644 --- a/etc/tests/periodic_timers_test.rb +++ b/etc/tests/periodic_timers_test.rb @@ -34,7 +34,6 @@ def transmit_progress scenario %( Periodic timers ) do - msg = client.receive assert_equal 1, msg["message"]["progress"] diff --git a/lib/anyt/ext/minitest.rb b/lib/anyt/ext/minitest.rb index 94c09de..6b26d9b 100644 --- a/lib/anyt/ext/minitest.rb +++ b/lib/anyt/ext/minitest.rb @@ -84,8 +84,8 @@ def handlers # Kernel extensions module Kernel ## Wraps `describe` and include shared helpers - private def feature(*args, &block) - cls = describe(*args, &block) + private def feature(...) + cls = describe(...) cls.include Anyt::TestHelpers cls end @@ -108,12 +108,12 @@ def scenario(desc, &block) # Generates Channel class dynamically and # add memoized helper to access its name - def channel(id = nil, &block) + def channel(id = nil, &) class_name = @name.gsub(/\s+/, "_") class_name += "_#{id}" if id class_name += "_channel" - cls = Class.new(ApplicationCable::Channel, &block) + cls = Class.new(ApplicationCable::Channel, &) Anyt::TestChannels.const_set(class_name.classify, cls) @@ -123,8 +123,8 @@ def channel(id = nil, &block) end # Add new #connect handler - def connect_handler(tag, &block) - Anyt::ConnectHandlers.add(tag, &block) + def connect_handler(tag, &) + Anyt::ConnectHandlers.add(tag, &) end end