diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e79749..e18beee 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_80.gemfile - ruby: '3.2' gemfile: gemfiles/rails_72.gemfile - ruby: '3.2' diff --git a/Appraisals b/Appraisals index 24bd7ca..15a353b 100644 --- a/Appraisals +++ b/Appraisals @@ -1,5 +1,10 @@ # frozen_string_literal: true +appraise 'rails-80' do + gem 'actionpack', '~> 8.0.0' + gem 'railties', '~> 8.0.0' +end + appraise 'rails-72' do gem 'actionpack', '~> 7.2.0' gem 'railties', '~> 7.2.0' diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed47f8..dcc10a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Unreleased +- Rails 8.0 support +- Update to Bot API 8.0 + # 0.16.4 - Rails 7.2 support diff --git a/gemfiles/rails_80.gemfile b/gemfiles/rails_80.gemfile new file mode 100644 index 0000000..a4d3166 --- /dev/null +++ b/gemfiles/rails_80.gemfile @@ -0,0 +1,21 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "actionpack", "~> 8.0.0" +gem "railties", "~> 8.0.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/lib/telegram/bot/client/api_methods.txt b/lib/telegram/bot/client/api_methods.txt index d956000..2f116e2 100644 --- a/lib/telegram/bot/client/api_methods.txt +++ b/lib/telegram/bot/client/api_methods.txt @@ -1,5 +1,5 @@ # Generated with bin/fetch-telegram-methods -# Bot API 7.9 +# Bot API 8.0 getUpdates setWebhook @@ -31,6 +31,7 @@ sendDice sendChatAction setMessageReaction getUserProfilePhotos +setUserEmojiStatus getFile banChatMember unbanChatMember @@ -118,9 +119,12 @@ setStickerSetTitle setStickerSetThumbnail setCustomEmojiStickerSetThumbnail deleteStickerSet +getAvailableGifts +sendGift answerInlineQuery answerWebAppQuery +savePreparedInlineMessage sendInvoice createInvoiceLink @@ -128,6 +132,7 @@ answerShippingQuery answerPreCheckoutQuery getStarTransactions refundStarPayment +editUserStarSubscription setPassportDataErrors diff --git a/lib/telegram/bot/updates_controller.rb b/lib/telegram/bot/updates_controller.rb index d89f804..63a7b78 100644 --- a/lib/telegram/bot/updates_controller.rb +++ b/lib/telegram/bot/updates_controller.rb @@ -105,6 +105,7 @@ class UpdatesController < AbstractController::Base # rubocop:disable Metrics/Cla callback_query shipping_query pre_checkout_query + purchased_paid_media poll poll_answer my_chat_member @@ -112,7 +113,6 @@ class UpdatesController < AbstractController::Base # rubocop:disable Metrics/Cla chat_join_request chat_boost removed_chat_boost - pre_checkout_query ].freeze) class << self diff --git a/spec/integration_helper.rb b/spec/integration_helper.rb index 3016a08..c2b94a0 100644 --- a/spec/integration_helper.rb +++ b/spec/integration_helper.rb @@ -15,7 +15,8 @@ class TestApplication < Rails::Application config.eager_load = false config.log_level = :debug - if ActionPack::VERSION::MAJOR >= 7 && ActionPack::VERSION::MINOR >= 2 + if (ActionPack::VERSION::MAJOR >= 8) || + (ActionPack::VERSION::MAJOR == 7 && ActionPack::VERSION::MINOR >= 2) config.action_dispatch.show_exceptions = :none else config.action_dispatch.show_exceptions = false diff --git a/spec/telegram/bot/updates_controller/typed_update_spec.rb b/spec/telegram/bot/updates_controller/typed_update_spec.rb index 37c8c62..bba19b3 100644 --- a/spec/telegram/bot/updates_controller/typed_update_spec.rb +++ b/spec/telegram/bot/updates_controller/typed_update_spec.rb @@ -28,6 +28,7 @@ message_reaction_count chat_boost removed_chat_boost + purchased_paid_media pre_checkout_query ]). map { |x| [x, Telegram::Bot::Types.const_get(x.camelize)] }.to_h. diff --git a/telegram-bot.gemspec b/telegram-bot.gemspec index 65d42ab..fdc9333 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.3' - spec.add_dependency 'activesupport', '>= 4.0', '< 7.3' + spec.add_dependency 'actionpack', '>= 4.0', '< 8.1' + spec.add_dependency 'activesupport', '>= 4.0', '< 8.1' spec.add_dependency 'httpclient', '~> 2.7' spec.add_development_dependency 'bundler', '> 1.16'