Skip to content

Commit

Permalink
Drop support for Ruby 2.3 and 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Dec 27, 2023
1 parent 68d6f6c commit ea05ccc
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 75 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["ruby-2.3", "ruby-2.4", "ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", "jruby-9.4"]
ruby: ["ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "ruby-3.2", "ruby-3.3", "jruby-9.4"]
gemfile: ["rails-5.0", "rails-5.1", "rails-5.2", "rails-6.0", "rails-6.1", "rails-7.0", "rails-7.1", "rails-main"]
exclude:
- ruby: "ruby-3.3"
Expand Down Expand Up @@ -68,26 +68,6 @@ jobs:
gemfile: "rails-7.1"
- ruby: "ruby-2.5"
gemfile: "rails-7.0"
- ruby: "ruby-2.4"
gemfile: "rails-main"
- ruby: "ruby-2.4"
gemfile: "rails-7.1"
- ruby: "ruby-2.4"
gemfile: "rails-7.0"
- ruby: "ruby-2.4"
gemfile: "rails-6.1"
- ruby: "ruby-2.4"
gemfile: "rails-6.0"
- ruby: "ruby-2.3"
gemfile: "rails-main"
- ruby: "ruby-2.3"
gemfile: "rails-7.1"
- ruby: "ruby-2.3"
gemfile: "rails-7.0"
- ruby: "ruby-2.3"
gemfile: "rails-6.1"
- ruby: "ruby-2.3"
gemfile: "rails-6.0"
env:
BUNDLE_GEMFILE: gemfiles/Gemfile.${{ matrix.gemfile }}

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## HEAD

* Drop support for Ruby 2.3 and 2.4 (@janko)

## 1.13.0 (2023-12-25) :christmas_tree:

* Add `#rodauth` method to controller test helpers (@janko)
Expand Down
14 changes: 2 additions & 12 deletions gemfiles/Gemfile.rails-5.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,10 @@ gemspec path: ".."

gem "rake", "~> 12.0"
gem "minitest", "5.10.3"
gem "warning" if RUBY_VERSION >= "2.4"
gem "warning"

gem "rails", "~> 5.0.0"
gem "sqlite3", "~> 1.3.6", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby

if RUBY_VERSION < "2.5"
gem "loofah", "< 2.20"
gem "nokogiri", "< 1.15"
end

if RUBY_VERSION.start_with?("2.3.")
gem "sprockets", "~> 3.7.2"
gem "capybara", "~> 3.15.1"
else
gem "capybara"
end
gem "capybara"
14 changes: 2 additions & 12 deletions gemfiles/Gemfile.rails-5.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@ source "https://rubygems.org"
gemspec path: ".."

gem "rake", "~> 12.0"
gem "warning" if RUBY_VERSION >= "2.4"
gem "warning"

gem "rails", "~> 5.1.0"
gem "sqlite3", "~> 1.4", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby

if RUBY_VERSION < "2.5"
gem "loofah", "< 2.20"
gem "nokogiri", "< 1.15"
end

if RUBY_VERSION.start_with?("2.3.")
gem "sprockets", "~> 3.7.2"
gem "capybara", "~> 3.15.1"
else
gem "capybara"
end
gem "capybara"
14 changes: 2 additions & 12 deletions gemfiles/Gemfile.rails-5.2
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@ source "https://rubygems.org"
gemspec path: ".."

gem "rake", "~> 12.0"
gem "warning" if RUBY_VERSION >= "2.4"
gem "warning"

gem "rails", "~> 5.2.0"
gem "sqlite3", "~> 1.4", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby

if RUBY_VERSION < "2.5"
gem "loofah", "< 2.20"
gem "nokogiri", "< 1.15"
end

if RUBY_VERSION.start_with?("2.3.")
gem "sprockets", "~> 3.7.2"
gem "capybara", "~> 3.15.1"
else
gem "capybara"
end
gem "capybara"
22 changes: 10 additions & 12 deletions lib/rodauth/rails/feature/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,18 @@ def rails_instrument_request
ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload)

ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
begin
result = catch(:halt) { yield }
result = catch(:halt) { yield }

response = ActionDispatch::Response.new(*(result || [404, {}, []]))
payload[:response] = response
payload[:status] = response.status
response = ActionDispatch::Response.new(*(result || [404, {}, []]))
payload[:response] = response
payload[:status] = response.status

throw :halt, result if result
rescue => error
payload[:status] = ActionDispatch::ExceptionWrapper.status_code_for_exception(error.class.name)
raise
ensure
rails_controller_eval { append_info_to_payload(payload) }
end
throw :halt, result if result
rescue => error
payload[:status] = ActionDispatch::ExceptionWrapper.status_code_for_exception(error.class.name)
raise
ensure
rails_controller_eval { append_info_to_payload(payload) }
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rodauth/rails/tasks/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(auth_class)

def call
routes = auth_class.route_hash.map do |path, handle_method|
route_name = handle_method.to_s.sub(/\Ahandle_/, "").to_sym
route_name = handle_method.to_s.delete_prefix("handle_").to_sym
next if IGNORE.include?(route_name)
verbs = route_verbs(route_name)

Expand Down
8 changes: 3 additions & 5 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
ENV["RAILS_ENV"] = "test"

if RUBY_VERSION >= "2.4"
require "warning"
Warning.ignore(:ambiguous_slash, __dir__)
Gem.path.each { |path| Warning.ignore(//, path) } # ignore warnings in dependencies
end
require "warning"
Warning.ignore(:ambiguous_slash, __dir__)
Gem.path.each { |path| Warning.ignore(//, path) } # ignore warnings in dependencies

require "bundler/setup"
require "i18n/backend"
Expand Down

0 comments on commit ea05ccc

Please sign in to comment.