From 2b949437e924d24f760fc78d30c20c1112c05836 Mon Sep 17 00:00:00 2001 From: Patrik Wenger Date: Thu, 4 Jan 2024 21:51:11 +0100 Subject: [PATCH] Async 2 requires Ruby 3.1.1 --- .github/workflows/stable_api.yml | 1 - README.md | 2 +- cztop.gemspec | 7 +++++-- spec/cztop/async_spec.rb | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/stable_api.yml b/.github/workflows/stable_api.yml index 21f551b..e563b13 100644 --- a/.github/workflows/stable_api.yml +++ b/.github/workflows/stable_api.yml @@ -8,7 +8,6 @@ jobs: strategy: matrix: ruby: - - '3.0' - '3.1' - '3.2' - '3.3' diff --git a/README.md b/README.md index 80feeb0..8daddf4 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ On macOS using Homebrew, run: ### Supported Rubies -* MRI (3.0, 3.2, 3.3) +* MRI (3.1, 3.2, 3.3) * JRuby * TruffleRuby diff --git a/cztop.gemspec b/cztop.gemspec index 39246bb..7364530 100644 --- a/cztop.gemspec +++ b/cztop.gemspec @@ -33,6 +33,9 @@ Gem::Specification.new do |spec| spec.add_development_dependency "pry" spec.add_development_dependency "yard" spec.add_development_dependency "rubocop", "~> 1.36.0" - spec.add_development_dependency "async", ">= 2.0.1" - spec.add_development_dependency "async-io" + + if RUBY_VERSION >= '3.1' + spec.add_development_dependency "async", ">= 2.0.1" + spec.add_development_dependency "async-io" + end end diff --git a/spec/cztop/async_spec.rb b/spec/cztop/async_spec.rb index fb315a5..2be2fac 100644 --- a/spec/cztop/async_spec.rb +++ b/spec/cztop/async_spec.rb @@ -1,9 +1,11 @@ # frozen_string_literal: true require_relative 'spec_helper' -require_relative '../../lib/cztop/async' -describe Async::IO::CZTopSocket do +# NOTE: Async 2 requires Ruby 3.1 +describe 'Async::IO::CZTopSocket', if: RUBY_VERSION >= '3.1' do + require_relative '../../lib/cztop/async' + i = 0 let(:endpoint) { "inproc://async_endpoint_socket_spec_reqrep_#{i += 1}" } let(:req_socket) { CZTop::Socket::REQ.new(endpoint) }