From 36cdf458b2a90ba8fe2ffc4ec80e9ab858372e5b Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Wed, 18 Sep 2024 19:13:30 -0400 Subject: [PATCH] Commit to `ruby@2.6` support Closes [#681][] First, remove `ruby@3.0` syntax including `...` arguments and end-less method definitions. Next, add `ruby@2.6` and `ruby@2.7` to the CI matrix along with `rails@7.1`. [#681]: https://github.com/hotwired/turbo-rails/issues/681 --- .github/workflows/ci.yml | 10 ++++++++-- test/streams/streams_helper_test.rb | 14 ++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52846f1f..8cdc2c26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,13 +5,19 @@ jobs: strategy: fail-fast: false matrix: - rails: [ "6.1", "7.0", "7.1" ] - ruby: [ "3.0", "3.1", "3.2", "3.3" ] + rails: [ "6.1", "7.0", "7.1", "7.2" ] + ruby: [ "2.6", "2.7", "3.0", "3.1", "3.2", "3.3" ] allow-fail: [ false ] include: - { ruby: "3.3", rails: "main", allow-fail: true } - { ruby: "3.2", rails: "main", allow-fail: true } - { ruby: "head", rails: "main", allow-fail: true } + exclude: + - { ruby: "2.6", rails: "7.0" } + - { ruby: "2.6", rails: "7.1" } + - { ruby: "2.6", rails: "7.2" } + - { ruby: "2.7", rails: "7.2" } + - { ruby: "3.0", rails: "7.2" } env: FERRUM_PROCESS_TIMEOUT: 25 diff --git a/test/streams/streams_helper_test.rb b/test/streams/streams_helper_test.rb index be9bea9f..45d66429 100644 --- a/test/streams/streams_helper_test.rb +++ b/test/streams/streams_helper_test.rb @@ -4,11 +4,17 @@ class TestChannel < ApplicationCable::Channel; end class Turbo::StreamsHelperTest < ActionView::TestCase class Component - extend ActiveModel::Naming + include ActiveModel::Model - def initialize(id:, content:) = (@id, @content = id, content) - def render_in(...) = @content - def to_key = [@id] + attr_accessor :id, :content + + def render_in(view_context) + content + end + + def to_key + [id] + end end attr_accessor :formats