From 56617992943e4381af89b2dc5ea5d35a4da43c4e Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 15 Jun 2023 10:28:00 +0900 Subject: [PATCH] Bring Rails 4.2 (and Ruby 2.4) support back --- .github/workflows/test.yml | 8 ++++++++ gemfiles/rails4.2.gemfile | 26 ++++++++++++++++++++++++++ test-unit-rails.gemspec | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gemfiles/rails4.2.gemfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5eb27b..1ef41e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,10 @@ jobs: - name: "Ruby 2.5 & Rails 5.0" ruby-version: "2.5" rails-version: "5.0" + - name: "Ruby 2.4 & Rails 4.2" + ruby-version: "2.4" + rails-version: "4.2" + bundler_version: 1 env: BUNDLE_GEMFILE: gemfiles/rails${{ matrix.rails-version }}.gemfile DISPLAY: ":99.0" @@ -78,6 +82,8 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} + rubygems: ${{ (matrix.ruby_version < '2.6' && 'default') || 'latest' }} + bundler: ${{ matrix.bundler_version }} bundler-cache: true - uses: nanasess/setup-chromedriver@v1 - name: Test @@ -102,6 +108,8 @@ jobs: rails-version: "5.1" - ruby-version: "2.7" rails-version: "5.0" + - ruby-version: "2.4" + rails-version: "4.2" steps: - uses: actions/checkout@v3 - name: Test diff --git a/gemfiles/rails4.2.gemfile b/gemfiles/rails4.2.gemfile new file mode 100644 index 0000000..5806b21 --- /dev/null +++ b/gemfiles/rails4.2.gemfile @@ -0,0 +1,26 @@ +# -*- ruby -*- +# +# Copyright (C) 2023 Akira Matsuda +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +source "https://rubygems.org/" + +gemspec path: ".." + +gem "rails", "< 5.0.0" +gem "capybara", "~> 2.13" +gem "sqlite3", "~> 1.3.6" +gem "loofah", "< 2.21.0" diff --git a/test-unit-rails.gemspec b/test-unit-rails.gemspec index 27d2e38..5df4d57 100644 --- a/test-unit-rails.gemspec +++ b/test-unit-rails.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |spec| spec.files += Dir.glob("doc/text/**/*.md") spec.test_files = Dir.glob("test/**/*.rb") - spec.add_runtime_dependency("rails", ">= 5.0.0") + spec.add_runtime_dependency("rails", ">= 4.2.0") spec.add_runtime_dependency("test-unit-activesupport", ">= 1.0.8") spec.add_runtime_dependency("test-unit-capybara", ">= 1.0.5") spec.add_runtime_dependency("test-unit-rr", ">= 1.0.4")