From 4f0232bb41551e3bb9f9a15f7743e9988b6f03ad Mon Sep 17 00:00:00 2001 From: Max Melentiev Date: Thu, 29 Aug 2024 22:07:27 -0400 Subject: [PATCH] Rails 7.2 support --- .github/workflows/ci.yml | 2 ++ Appraisals | 5 +++++ CHANGELOG.md | 2 ++ gemfiles/rails_72.gemfile | 21 +++++++++++++++++++++ spec/integration_helper.rb | 6 +++++- telegram-bot.gemspec | 4 ++-- 6 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 gemfiles/rails_72.gemfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4084e0..4e79749 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,8 @@ jobs: - gemfiles/rails_51.gemfile include: # ruby 3.x + - ruby: '3.2' + gemfile: gemfiles/rails_72.gemfile - ruby: '3.2' gemfile: gemfiles/rails_71.gemfile - ruby: '3.0' diff --git a/Appraisals b/Appraisals index 5ce8c11..24bd7ca 100644 --- a/Appraisals +++ b/Appraisals @@ -1,5 +1,10 @@ # frozen_string_literal: true +appraise 'rails-72' do + gem 'actionpack', '~> 7.2.0' + gem 'railties', '~> 7.2.0' +end + appraise 'rails-71' do gem 'actionpack', '~> 7.1.0' gem 'railties', '~> 7.1.0' diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f2692c..b5a37ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- Rails 7.2 support + # 0.16.3 - Update to Bot API 7.7 diff --git a/gemfiles/rails_72.gemfile b/gemfiles/rails_72.gemfile new file mode 100644 index 0000000..a5bcab5 --- /dev/null +++ b/gemfiles/rails_72.gemfile @@ -0,0 +1,21 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "actionpack", "~> 7.2.0" +gem "railties", "~> 7.2.0" + +group :development do + gem "appraisal", "~> 2.2" + gem "debug", "~> 1.9.2" + gem "sdoc", "~> 2.0.3" + gem "telegram-bot-types", "~> 0.6.3" + gem "rspec", "~> 3.12.0" + gem "rspec-its", "~> 1.3.0" + gem "rspec-rails", "~> 4.0.2" + gem "rubocop", "~> 1.59.0" + gem "rubocop-rails", "~> 2.23.1" + gem "coveralls", "~> 0.8.23", require: false +end + +gemspec path: "../" diff --git a/spec/integration_helper.rb b/spec/integration_helper.rb index 2bb0796..3016a08 100644 --- a/spec/integration_helper.rb +++ b/spec/integration_helper.rb @@ -15,7 +15,11 @@ class TestApplication < Rails::Application config.eager_load = false config.log_level = :debug - config.action_dispatch.show_exceptions = false + if ActionPack::VERSION::MAJOR >= 7 && ActionPack::VERSION::MINOR >= 2 + config.action_dispatch.show_exceptions = :none + else + config.action_dispatch.show_exceptions = false + end routes.default_url_options = {host: 'test.rpsec'} telegram_config = { diff --git a/telegram-bot.gemspec b/telegram-bot.gemspec index ae97f06..65d42ab 100644 --- a/telegram-bot.gemspec +++ b/telegram-bot.gemspec @@ -25,8 +25,8 @@ Gem::Specification.new do |spec| spec.required_ruby_version = '>= 2.4' - spec.add_dependency 'actionpack', '>= 4.0', '< 7.2' - spec.add_dependency 'activesupport', '>= 4.0', '< 7.2' + spec.add_dependency 'actionpack', '>= 4.0', '< 7.3' + spec.add_dependency 'activesupport', '>= 4.0', '< 7.3' spec.add_dependency 'httpclient', '~> 2.7' spec.add_development_dependency 'bundler', '> 1.16'