From 25a099b85ac44e4533b8aa485508331891f34007 Mon Sep 17 00:00:00 2001 From: Chris Gunther Date: Mon, 29 Mar 2021 17:05:04 -0400 Subject: [PATCH] Bump required ruby version to v2.4.0 a9137acc introduced a use of Hash#transform_values in Listen::Record#dir_entries, however that was only added to Ruby in [v2.4](https://github.com/ruby/ruby/blob/v2_4_0/NEWS#core-classes-updates-outstanding-ones-only-). This can lead to runtime errors when run on an older version of Ruby, such as 2.2.7, which the gemspec previously implied was supported. Also expand CI to match and test on Ruby v2.4. --- .github/workflows/development.yml | 13 +++++++------ listen.gemspec | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index e45b6458..b7eac700 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -6,21 +6,22 @@ jobs: test: runs-on: ${{matrix.os}}-latest continue-on-error: ${{matrix.experimental}} - + strategy: matrix: os: - ubuntu - macos - + ruby: + - 2.4 - 2.5 - 2.6 - 2.7 - + experimental: [false] env: [""] - + include: - os: macos ruby: truffleruby-head @@ -34,14 +35,14 @@ jobs: - os: ubuntu ruby: head experimental: true - + steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} bundler-cache: true - + - name: Run tests timeout-minutes: 6 run: | diff --git a/listen.gemspec b/listen.gemspec index ed1ec0ce..ba62b76c 100644 --- a/listen.gemspec +++ b/listen.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength gem.executable = 'listen' gem.require_path = 'lib' - gem.required_ruby_version = '>= 2.2.7' # rubocop:disable Gemspec/RequiredRubyVersion + gem.required_ruby_version = '>= 2.4.0' # rubocop:disable Gemspec/RequiredRubyVersion gem.add_dependency 'rb-fsevent', '~> 0.10', '>= 0.10.3' gem.add_dependency 'rb-inotify', '~> 0.9', '>= 0.9.10'