refactor!: update minimum Ruby version to 3.0

Этот коммит содержится в:
Mattia Roccoberton
2024-02-25 11:58:22 +01:00
родитель 22a1c8714c
Коммит ce65cfbb7e
10 изменённых файлов: 22 добавлений и 63 удалений

2
.github/workflows/linters.yml поставляемый
Просмотреть файл

@@ -19,7 +19,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- uses: reviewdog/action-setup@v1

42
.github/workflows/specs_rails60.yml поставляемый
Просмотреть файл

@@ -1,42 +0,0 @@
---
name: Specs Rails 6.0
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.6', '2.7']
gemfile: ['rails60_activeadmin22', 'rails60_activeadmin']
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rspec --profile
- name: On failure, archive screenshots as artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-failed-screenshots
path: spec/dummy/tmp/screenshots

2
.github/workflows/specs_rails61.yml поставляемый
Просмотреть файл

@@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
ruby: ['2.6', '2.7', '3.0']
ruby: ['3.0', '3.1', '3.2']
gemfile: ['rails61_activeadmin29', 'rails61_activeadmin']
env:

Просмотреть файл

@@ -16,6 +16,7 @@ AllCops:
- spec/dummy/**/*
- vendor/**/*
NewCops: enable
TargetRubyVersion: 3.0
RSpec/ExampleLength:
# default 5

Просмотреть файл

@@ -13,6 +13,8 @@ Please :star: if you like it.
## Install
_NOTE_: Ruby 2.7 is supported until version 1.1.0
After installing Active Admin, add to your Gemfile: `gem 'activeadmin_quill_editor'` (and execute *bundle*)
If you installed Active Admin without Webpacker support (default for now):

Просмотреть файл

@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
spec.email = 'mat@blocknot.es'
spec.homepage = 'https://github.com/blocknotes/activeadmin_quill_editor'
spec.required_ruby_version = '>= 2.6.0'
spec.required_ruby_version = '>= 3.0'
spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['changelog_uri'] = 'https://github.com/blocknotes/activeadmin_quill_editor/blob/main/CHANGELOG.md'
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'activeadmin', '>= 2.0', '< 4'
spec.add_development_dependency 'appraisal', '~> 2.4'
spec.add_development_dependency 'appraisal', '~> 2.4' # rubocop:disable Gemspec/DevelopmentDependencies
end

Просмотреть файл

@@ -12,7 +12,7 @@ require 'rspec/rails'
require 'capybara/rails'
require 'rspec/retry'
Dir[File.expand_path('support/**/*.rb', __dir__)].sort.each { |f| require f }
Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f }
# Force deprecations to raise an exception.
ActiveSupport::Deprecation.behavior = :raise
@@ -27,7 +27,7 @@ rescue ActiveRecord::PendingMigrationError => e
end
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.fixture_path = Rails.root.join('spec/fixtures').to_s
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!

Просмотреть файл

@@ -9,18 +9,16 @@ Capybara.register_driver(:cuprite) do |app|
Capybara::Cuprite::Driver.new(
app,
**{
window_size: [1600, 1280],
# See additional options for Dockerized environment in the respective section of this article
browser_options: browser_options,
# Increase Chrome startup wait time (required for stable CI builds)
process_timeout: 20,
# The number of seconds we'll wait for a response when communicating with browser. Default is 5
timeout: 20,
# Enable debugging capabilities
inspector: true,
# Allow running Chrome in a headful mode by setting HEADLESS env var to a falsey value
headless: !ENV['CUPRITE_HEADLESS'].in?(%w[n 0 no false])
}
window_size: [1600, 1280],
# See additional options for Dockerized environment in the respective section of this article
browser_options: browser_options,
# Increase Chrome startup wait time (required for stable CI builds)
process_timeout: 20,
# The number of seconds we'll wait for a response when communicating with browser. Default is 5
timeout: 20,
# Enable debugging capabilities
inspector: true,
# Allow running Chrome in a headful mode by setting HEADLESS env var to a falsey value
headless: !ENV['CUPRITE_HEADLESS'].in?(%w[n 0 no false])
)
end

Просмотреть файл

@@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.describe 'Quill editor', type: :system do
RSpec.describe 'Quill editor' do
let(:author) { Author.create!(email: 'some_email@example.com', name: 'John Doe', age: 30) }
let!(:post) { Post.create!(title: 'Test', author: author, description: 'Some content...') }

Просмотреть файл

@@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.describe 'Quill JS', type: :system do
RSpec.describe 'Quill JS' do
it 'has a Javascript function defined and returns the version', :aggregate_failures do
visit '/admin/posts'