Skip to content

Commit

Permalink
Drop legacy Ruby and Rails versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Sep 1, 2023
1 parent 9ddebd0 commit 2cad745
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 147 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
gemfile: [ rails_5.2, rails_6.0, rails_6.1, rails_7.0 ]
ruby-version: ['2.7', '3.0', '3.1', '3.2']
gemfile: [rails_6.1, rails_7.0]
channel: ['stable']

include:
Expand All @@ -43,22 +43,6 @@ jobs:
channel: 'experimental'

exclude:
- ruby-version: '2.6'
gemfile: rails_7.0
- ruby-version: '2.7'
gemfile: rails_5.2
- ruby-version: '3.0'
gemfile: rails_5.2
- ruby-version: '3.0'
gemfile: rails_6.0
- ruby-version: '3.1'
gemfile: rails_5.2
- ruby-version: '3.1'
gemfile: rails_6.0
- ruby-version: '3.2'
gemfile: rails_5.2
- ruby-version: '3.2'
gemfile: rails_6.0
- ruby-version: '3.2'
gemfile: rails_6.1

Expand Down
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require:
- rubocop-rake

AllCops:
TargetRailsVersion: 5.2
TargetRubyVersion: 2.6
TargetRailsVersion: 6.1
TargetRubyVersion: 2.7
NewCops: enable
DisplayStyleGuide: true
ExtraDetails: true
Expand Down
8 changes: 0 additions & 8 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# frozen_string_literal: true

appraise 'rails-5.2' do
gem 'rails', '~> 5.2.0'
end

appraise 'rails-6.0' do
gem 'rails', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'rails', '~> 6.1.0'
end
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## main / unreleased

* [FEATURE] Drop Rails 5.2 and 6.0 support
* [FEATURE] Drop Ruby 2.6 support
* [ENHANCEMENT] Test against Ruby 3.2
* [ENHANCEMENT] Test against jQuery 3.7.1 by default
* [ENHANCEMENT] Update QUnit to 2.19.4
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ gem 'm', '~> 1.6'
gem 'minitest', '~> 5.19'
gem 'mocha', '~> 2.1'
gem 'rake', '~> 13.0'
gem 'rubocop', '~> 1.50'
gem 'rubocop-minitest', '< 0.32'
gem 'rubocop', '~> 1.56'
gem 'rubocop-minitest', '~> 0.31.0'
gem 'rubocop-packaging', '~> 0.5.2'
gem 'rubocop-performance', '~> 1.17'
gem 'rubocop-rails', '~> 2.19'
gem 'rubocop-performance', '~> 1.19'
gem 'rubocop-rails', '~> 2.20'
gem 'rubocop-rake', '~> 0.6.0'
gem 'shotgun', '~> 0.9.2'
gem 'simplecov', '~> 0.22.0'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![Coverage Status](https://coveralls.io/repos/github/DavyJonesLocker/client_side_validations/badge.svg?branch=main)](https://coveralls.io/github/DavyJonesLocker/client_side_validations?branch=main)


`ClientSideValidations` made easy for your Rails 5.2 / 6.x / 7.0 applications!
`ClientSideValidations` made easy for your Rails 6.1 / 7.x applications!

## Project Goals ##

Expand Down
4 changes: 2 additions & 2 deletions client_side_validations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.platform = Gem::Platform::RUBY
spec.required_ruby_version = '>= 2.6'
spec.required_ruby_version = '>= 2.7'

spec.add_dependency 'js_regex', '~> 3.7'
spec.add_dependency 'rails', '>= 5.2', '< 7.1'
spec.add_dependency 'rails', '>= 6.1', '< 7.1'
end
24 changes: 0 additions & 24 deletions gemfiles/rails_5.2.gemfile

This file was deleted.

24 changes: 0 additions & 24 deletions gemfiles/rails_6.0.gemfile

This file was deleted.

17 changes: 9 additions & 8 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

source "https://rubygems.org"

gem "appraisal", "~> 2.4"
gem "appraisal", "~> 2.5"
gem "byebug", "~> 11.1"
gem "m", "~> 1.6"
gem "minitest", "~> 5.18"
gem "mocha", "~> 2.0"
gem "minitest", "~> 5.19"
gem "mocha", "~> 2.1"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.50"
gem "rubocop-minitest", "< 0.32"
gem "rubocop-performance", "~> 1.17"
gem "rubocop-rails", "~> 2.19"
gem "rubocop", "~> 1.56"
gem "rubocop-minitest", "~> 0.31.0"
gem "rubocop-packaging", "~> 0.5.2"
gem "rubocop-performance", "~> 1.19"
gem "rubocop-rails", "~> 2.20"
gem "rubocop-rake", "~> 0.6.0"
gem "shotgun", "~> 0.9.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "sinatra", "~> 3.0"
gem "sinatra", "~> 3.1"
gem "sqlite3", "~> 1.6"
gem "webrick", "~> 1.7"
gem "rails", "~> 6.1.0"
Expand Down
17 changes: 9 additions & 8 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

source "https://rubygems.org"

gem "appraisal", "~> 2.4"
gem "appraisal", "~> 2.5"
gem "byebug", "~> 11.1"
gem "m", "~> 1.6"
gem "minitest", "~> 5.18"
gem "mocha", "~> 2.0"
gem "minitest", "~> 5.19"
gem "mocha", "~> 2.1"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.50"
gem "rubocop-minitest", "< 0.32"
gem "rubocop-performance", "~> 1.17"
gem "rubocop-rails", "~> 2.19"
gem "rubocop", "~> 1.56"
gem "rubocop-minitest", "~> 0.31.0"
gem "rubocop-packaging", "~> 0.5.2"
gem "rubocop-performance", "~> 1.19"
gem "rubocop-rails", "~> 2.20"
gem "rubocop-rake", "~> 0.6.0"
gem "shotgun", "~> 0.9.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "sinatra", "~> 3.0"
gem "sinatra", "~> 3.1"
gem "sqlite3", "~> 1.6"
gem "webrick", "~> 1.7"
gem "rails", "~> 7.0.0"
Expand Down
17 changes: 9 additions & 8 deletions gemfiles/rails_edge.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

source "https://rubygems.org"

gem "appraisal", "~> 2.4"
gem "appraisal", "~> 2.5"
gem "byebug", "~> 11.1"
gem "m", "~> 1.6"
gem "minitest", "~> 5.18"
gem "mocha", "~> 2.0"
gem "minitest", "~> 5.19"
gem "mocha", "~> 2.1"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.50"
gem "rubocop-minitest", "< 0.32"
gem "rubocop-performance", "~> 1.17"
gem "rubocop-rails", "~> 2.19"
gem "rubocop", "~> 1.56"
gem "rubocop-minitest", "~> 0.31.0"
gem "rubocop-packaging", "~> 0.5.2"
gem "rubocop-performance", "~> 1.19"
gem "rubocop-rails", "~> 2.20"
gem "rubocop-rake", "~> 0.6.0"
gem "shotgun", "~> 0.9.2"
gem "simplecov", "~> 0.22.0"
gem "simplecov-lcov", "~> 0.8.0"
gem "sinatra", "~> 3.0"
gem "sinatra", "~> 3.1"
gem "sqlite3", "~> 1.6"
gem "webrick", "~> 1.7"
gem "rails", git: "https://github.com/rails/rails.git", branch: "main"
Expand Down
1 change: 1 addition & 0 deletions lib/client_side_validations/action_view/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def apply_csv_form_for_options!(record, object, options)
options[:html][:validate] = true if options[:validate]
options[:html][:method] ||= options[:method]

# TODO: remove else branch when minimum compatible version when dropping 6.1 support
if method(:apply_form_for_options!).arity == 2
apply_form_for_options! object, options
else
Expand Down
6 changes: 1 addition & 5 deletions lib/client_side_validations/active_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ def message_type
end

def callbacks_options
if defined?(::ActiveModel::Errors::CALLBACKS_OPTIONS)
::ActiveModel::Errors::CALLBACKS_OPTIONS
else
::ActiveModel::Error::CALLBACKS_OPTIONS
end
::ActiveModel::Error::CALLBACKS_OPTIONS
end
end

Expand Down
7 changes: 1 addition & 6 deletions lib/client_side_validations/active_model/numericality.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ module Numericality
@@option_map = {}

def self.included(base)
checks =
if base.const_defined?(:RESERVED_OPTIONS)
base::RESERVED_OPTIONS - [:only_integer]
else
base::CHECKS.keys
end
checks = base::RESERVED_OPTIONS - [:only_integer]

@@option_map.merge!(checks.inject({}) { |acc, elem| acc.merge!(elem => elem) })
super
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@client-side-validations/client-side-validations",
"description": "Client Side Validations made easy for your Rails 5.2 / Rails 6.0 applications",
"description": "Client Side Validations made easy for your Rails 6.1 / 7.x applications",
"repository": {
"type": "git",
"url": "git+https://github.com/DavyJonesLocker/client_side_validations.git"
Expand Down
8 changes: 1 addition & 7 deletions test/action_view/cases/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,8 @@ def protect_against_forgery?
false
end

# Rails 5.x does not define `ActionView::Helpers::FormTagHelper::form_with_generates_ids`
# Default value was `true`
def default_enforce_utf8
if ActionView::Helpers::FormTagHelper.respond_to?(:default_enforce_utf8)
ActionView::Helpers::FormTagHelper.default_enforce_utf8
else
true
end
ActionView::Helpers::FormTagHelper.default_enforce_utf8
end

def form_with_generates_remote_forms
Expand Down
Loading

0 comments on commit 2cad745

Please sign in to comment.