From 5d9f8b3145b405d98dfc437ade34c3548f681b93 Mon Sep 17 00:00:00 2001 From: Nicolas Brousse Date: Fri, 12 Jul 2024 23:09:34 +0200 Subject: [PATCH 1/2] fix: update sqlite gem requirements --- .gitignore | 3 +- Gemfile | 2 +- Gemfile.lock | 330 +++++++++++++---------- gemfiles/rails_6.0_vc_2.0.gemfile | 2 +- gemfiles/rails_6.0_vc_3.0.gemfile | 2 +- gemfiles/rails_6.1_vc_2.0.gemfile | 2 +- gemfiles/rails_6.1_vc_3.0.gemfile | 2 +- gemfiles/rails_7.0_vc_2.0.gemfile | 2 +- gemfiles/rails_7.0_vc_3.0.gemfile | 2 +- gemfiles/rails_7.1_vc_2.0.gemfile | 2 +- gemfiles/rails_7.1_vc_3.0.gemfile | 2 +- gemfiles/rails_head_vc_2.0.gemfile | 2 +- gemfiles/rails_head_vc_3.0.gemfile | 2 +- spec/spec_helper.rb | 1 + spec/view_component/form/builder_spec.rb | 4 +- 15 files changed, 198 insertions(+), 162 deletions(-) diff --git a/.gitignore b/.gitignore index c84ae801..578f08ec 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,8 @@ /spec/reports/ /spec/internal/log /spec/internal/public -/spec/internal/db/combustion_test.sqlite +/spec/internal/db/*.sqlite +/spec/internal/db/*.sqlite-* /tmp/ # appraisal diff --git a/Gemfile b/Gemfile index a4a83893..23ae7ca5 100644 --- a/Gemfile +++ b/Gemfile @@ -18,4 +18,4 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test diff --git a/Gemfile.lock b/Gemfile.lock index 8977f33a..91835cb2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,84 +10,95 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + rails-dom-testing (~> 2.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) + timeout (>= 0.4.0) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.1.3.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - addressable (2.8.1) - public_suffix (>= 2.0.2, < 6.0) - appraisal (2.4.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + appraisal (2.5.0) bundler rake thor (>= 0.14.0) ast (2.4.2) - builder (3.2.4) - capybara (3.38.0) + base64 (0.2.0) + bigdecimal (3.1.8) + builder (3.3.0) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) @@ -96,159 +107,184 @@ GEM activesupport (>= 3.0.0) railties (>= 3.0.0) thor (>= 0.14.6) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) crass (1.0.6) - date (3.3.3) - diff-lcs (1.5.0) + date (3.3.4) + diff-lcs (1.5.1) docile (1.4.0) - erubi (1.12.0) - generator_spec (0.9.4) + drb (2.2.1) + erubi (1.13.0) + generator_spec (0.10.0) activesupport (>= 3.0.0) railties (>= 3.0.0) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.13.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - json (2.6.3) - loofah (2.20.0) + io-console (0.7.2) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.7.2) + language_server-protocol (3.17.0.3) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.18.0) - net-imap (0.3.4) + method_source (1.1.0) + mini_mime (1.1.5) + mini_portile2 (2.8.7) + minitest (5.24.1) + mutex_m (0.2.0) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - nio4r (2.5.9) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) + nio4r (2.7.3) + nokogiri (1.16.6) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.14.3-x86_64-darwin) + nokogiri (1.16.6-x86_64-darwin) racc (~> 1.4) - nokogiri (1.14.3-x86_64-linux) + nokogiri (1.16.6-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.25.1) + parser (3.3.4.0) ast (~> 2.4.1) - public_suffix (5.0.1) - racc (1.6.2) - rack (2.2.7) + racc + psych (5.1.2) + stringio + public_suffix (6.0.0) + racc (1.8.0) + rack (3.1.7) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.0.4.3) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.1.3.4) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) - method_source + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.6.2) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) + regexp_parser (2.9.2) + reline (0.5.9) + io-console (~> 0.5) + rexml (3.3.1) + strscan + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-html-matchers (0.10.0) nokogiri (~> 1) rspec (>= 3.0.0.a) - rspec-mocks (3.12.3) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.0.1) + rspec-support (~> 3.13.0) + rspec-rails (6.1.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.11) - rspec-expectations (~> 3.11) - rspec-mocks (~> 3.11) - rspec-support (~> 3.11) - rspec-support (3.12.0) - rubocop (1.44.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.65.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) - rubocop-capybara (2.17.0) - rubocop (~> 1.41) - rubocop-performance (1.15.2) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rspec (2.18.1) - rubocop (~> 1.33) - rubocop-capybara (~> 2.17) - ruby-progressbar (1.11.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (3.0.3) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sqlite3 (1.6.0) + sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.6.0-x86_64-darwin) - sqlite3 (1.6.0-x86_64-linux) - thor (1.2.1) - timeout (0.3.2) + sqlite3 (1.7.3-x86_64-darwin) + sqlite3 (1.7.3-x86_64-linux) + stringio (3.1.1) + strscan (3.1.0) + thor (1.3.1) + timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - view_component (3.6.0) + unicode-display_width (2.5.0) + view_component (3.12.1) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) - websocket-driver (0.7.5) + webrick (1.8.1) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.8) + zeitwerk (2.6.16) PLATFORMS ruby @@ -269,7 +305,7 @@ DEPENDENCIES rubocop-performance rubocop-rspec simplecov - sqlite3 + sqlite3 (~> 1.4) view_component-form! BUNDLED WITH diff --git a/gemfiles/rails_6.0_vc_2.0.gemfile b/gemfiles/rails_6.0_vc_2.0.gemfile index 4982933b..470e499d 100644 --- a/gemfiles/rails_6.0_vc_2.0.gemfile +++ b/gemfiles/rails_6.0_vc_2.0.gemfile @@ -15,6 +15,6 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gemspec path: "../" diff --git a/gemfiles/rails_6.0_vc_3.0.gemfile b/gemfiles/rails_6.0_vc_3.0.gemfile index 71c8d2ef..3573a58f 100644 --- a/gemfiles/rails_6.0_vc_3.0.gemfile +++ b/gemfiles/rails_6.0_vc_3.0.gemfile @@ -15,7 +15,7 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gem "view_component", ">= 3.0.0", "< 4.0" gemspec path: "../" diff --git a/gemfiles/rails_6.1_vc_2.0.gemfile b/gemfiles/rails_6.1_vc_2.0.gemfile index 941217ae..d9db5fb3 100644 --- a/gemfiles/rails_6.1_vc_2.0.gemfile +++ b/gemfiles/rails_6.1_vc_2.0.gemfile @@ -15,6 +15,6 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gemspec path: "../" diff --git a/gemfiles/rails_6.1_vc_3.0.gemfile b/gemfiles/rails_6.1_vc_3.0.gemfile index c53cbe38..c1f1874c 100644 --- a/gemfiles/rails_6.1_vc_3.0.gemfile +++ b/gemfiles/rails_6.1_vc_3.0.gemfile @@ -15,7 +15,7 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gem "view_component", ">= 3.0.0", "< 4.0" gemspec path: "../" diff --git a/gemfiles/rails_7.0_vc_2.0.gemfile b/gemfiles/rails_7.0_vc_2.0.gemfile index ec280cef..dfcf0c8e 100644 --- a/gemfiles/rails_7.0_vc_2.0.gemfile +++ b/gemfiles/rails_7.0_vc_2.0.gemfile @@ -15,6 +15,6 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gemspec path: "../" diff --git a/gemfiles/rails_7.0_vc_3.0.gemfile b/gemfiles/rails_7.0_vc_3.0.gemfile index 9885251c..60078671 100644 --- a/gemfiles/rails_7.0_vc_3.0.gemfile +++ b/gemfiles/rails_7.0_vc_3.0.gemfile @@ -15,7 +15,7 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gem "view_component", ">= 3.0.0", "< 4.0" gemspec path: "../" diff --git a/gemfiles/rails_7.1_vc_2.0.gemfile b/gemfiles/rails_7.1_vc_2.0.gemfile index 3b7cc0d3..18e534a8 100644 --- a/gemfiles/rails_7.1_vc_2.0.gemfile +++ b/gemfiles/rails_7.1_vc_2.0.gemfile @@ -15,6 +15,6 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gemspec path: "../" diff --git a/gemfiles/rails_7.1_vc_3.0.gemfile b/gemfiles/rails_7.1_vc_3.0.gemfile index ec32fc90..524e6844 100644 --- a/gemfiles/rails_7.1_vc_3.0.gemfile +++ b/gemfiles/rails_7.1_vc_3.0.gemfile @@ -15,7 +15,7 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gem "view_component", ">= 3.0.0", "< 4.0" gemspec path: "../" diff --git a/gemfiles/rails_head_vc_2.0.gemfile b/gemfiles/rails_head_vc_2.0.gemfile index 89b8bef7..7cc32967 100644 --- a/gemfiles/rails_head_vc_2.0.gemfile +++ b/gemfiles/rails_head_vc_2.0.gemfile @@ -15,6 +15,6 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gemspec path: "../" diff --git a/gemfiles/rails_head_vc_3.0.gemfile b/gemfiles/rails_head_vc_3.0.gemfile index f9dc3f21..f679a98c 100644 --- a/gemfiles/rails_head_vc_3.0.gemfile +++ b/gemfiles/rails_head_vc_3.0.gemfile @@ -15,7 +15,7 @@ gem "rubocop", require: false gem "rubocop-performance", require: false gem "rubocop-rspec", require: false gem "simplecov", require: false, group: :test -gem "sqlite3", require: false, group: :test +gem "sqlite3", "~> 1.4", group: :test gem "view_component", ">= 3.0.0", "< 4.0" gemspec path: "../" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eed8afb1..aff79803 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -33,6 +33,7 @@ class ApplicationController < ActionController::Base require "view_component/test_helpers" require "view_component/form/test_helpers" require "capybara/rspec" +require "ostruct" Dir["./spec/support/**/*.rb"].sort.each { |f| require f } diff --git a/spec/view_component/form/builder_spec.rb b/spec/view_component/form/builder_spec.rb index a912de81..c3fb906c 100644 --- a/spec/view_component/form/builder_spec.rb +++ b/spec/view_component/form/builder_spec.rb @@ -7,9 +7,7 @@ let(:form) { form_with(object) } let(:options) { {} } - shared_examples "the default form builder" do |method_name, *args, rspec_around: lambda { |example| - example.run - }, **kwargs, &block| + shared_examples "the default form builder" do |method_name, *args, rspec_around: lambda(&:run), **kwargs, &block| around(&rspec_around) subject { form.public_send(method_name, *args, **kwargs, &block) } From 48150e9d05b67ce89e933a72cf146651eb81e12b Mon Sep 17 00:00:00 2001 From: Nicolas Brousse Date: Sat, 13 Jul 2024 10:21:15 +0200 Subject: [PATCH 2/2] Drop ruby 2.7 and Rails 6.0 --- .github/workflows/main.yml | 11 +++++------ .rubocop.yml | 2 +- Appraisals | 9 --------- CHANGELOG.md | 7 ++++++- Gemfile.lock | 4 ++-- README.md | 6 +++--- gemfiles/rails_6.0_vc_2.0.gemfile | 20 -------------------- gemfiles/rails_6.0_vc_3.0.gemfile | 21 --------------------- spec/spec_helper.rb | 6 +++++- spec/view_component/form/builder_spec.rb | 7 ++++++- view_component-form.gemspec | 6 +++--- 11 files changed, 31 insertions(+), 68 deletions(-) delete mode 100644 gemfiles/rails_6.0_vc_2.0.gemfile delete mode 100644 gemfiles/rails_6.0_vc_3.0.gemfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 311fa062..1c3b9790 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,22 +9,21 @@ jobs: strategy: matrix: versions: - - { ruby: "2.7", rails: "6.0", rubygems: "default" } - - { ruby: "3.0", rails: "6.0", rubygems: "default" } - - { ruby: "2.7", rails: "6.1", rubygems: "default" } - { ruby: "3.0", rails: "6.1", rubygems: "default" } - { ruby: "3.1", rails: "6.1", rubygems: "default" } - - { ruby: "2.7", rails: "7.0", rubygems: "default" } + - { ruby: "3.2", rails: "6.1", rubygems: "default" } + - { ruby: "3.3", rails: "6.1", rubygems: "default" } - { ruby: "3.0", rails: "7.0", rubygems: "default" } - { ruby: "3.1", rails: "7.0", rubygems: "default" } - { ruby: "3.2", rails: "7.0", rubygems: "default" } - - { ruby: "2.7", rails: "7.1", rubygems: "default" } + - { ruby: "3.3", rails: "7.0", rubygems: "default" } - { ruby: "3.0", rails: "7.1", rubygems: "default" } - { ruby: "3.1", rails: "7.1", rubygems: "default" } - { ruby: "3.2", rails: "7.1", rubygems: "default" } - - { ruby: "3.0", rails: "head", rubygems: "latest" } + - { ruby: "3.3", rails: "7.1", rubygems: "default" } - { ruby: "3.1", rails: "head", rubygems: "latest" } - { ruby: "3.2", rails: "head", rubygems: "latest" } + - { ruby: "3.3", rails: "head", rubygems: "latest" } action_text: ['with', 'without'] view_component: ['2.0', '3.0'] diff --git a/.rubocop.yml b/.rubocop.yml index e9c27d3c..b7aa7880 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ inherit_from: .rubocop_todo.yml AllCops: SuggestExtensions: false - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 NewCops: enable Exclude: - '.git/**/*' diff --git a/Appraisals b/Appraisals index a6ef1f33..bdf9ea95 100644 --- a/Appraisals +++ b/Appraisals @@ -1,14 +1,5 @@ # frozen_string_literal: true -appraise "rails-6.0_vc-2.0" do - gem "rails", "~> 6.0.0" -end - -appraise "rails-6.0_vc-3.0" do - gem "rails", "~> 6.0.0" - gem "view_component", ">= 3.0.0", "< 4.0" -end - appraise "rails-6.1_vc-2.0" do gem "rails", "~> 6.1.0" end diff --git a/CHANGELOG.md b/CHANGELOG.md index d5f066b6..e52f38f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - +### Added - Added parent_component configuration for field components (#160) +- Added Ruby 3.3 support (#164) + +### Removed +- Drop Ruby 2.7 support (#164) +- Drop Rails 6.0 support (#164) ## [0.2.6] - 2023-10-11 ### Added diff --git a/Gemfile.lock b/Gemfile.lock index 91835cb2..5af5b8a0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,8 @@ PATH remote: . specs: view_component-form (0.2.6) - actionview (>= 6.0.0, < 7.2) - activesupport (>= 6.0.0, < 7.2) + actionview (>= 6.1.0, < 7.2) + activesupport (>= 6.1.0, < 7.2) view_component (>= 2.34.0, < 4.0) zeitwerk (~> 2.5) diff --git a/README.md b/README.md index 79f270aa..37a9697f 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ Development of this gem is sponsored by: ## Compatibility -> [!WARNING] +> [!WARNING] > **This is an early release, and the API is subject to change until `v1.0.0`.** This gem is tested on: -- Rails 6.0+ (with or without ActionText) -- Ruby 2.7+ +- Rails 6.1+ (with or without ActionText) +- Ruby 3.0+ ## Installation diff --git a/gemfiles/rails_6.0_vc_2.0.gemfile b/gemfiles/rails_6.0_vc_2.0.gemfile deleted file mode 100644 index 470e499d..00000000 --- a/gemfiles/rails_6.0_vc_2.0.gemfile +++ /dev/null @@ -1,20 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal", require: false -gem "capybara", require: false -gem "combustion", "~> 1.3.7" -gem "generator_spec" -gem "rails", "~> 6.0.0" -gem "rake", "~> 13.0" -gem "rspec", "~> 3.0", require: false -gem "rspec-html-matchers" -gem "rspec-rails", require: false -gem "rubocop", require: false -gem "rubocop-performance", require: false -gem "rubocop-rspec", require: false -gem "simplecov", require: false, group: :test -gem "sqlite3", "~> 1.4", group: :test - -gemspec path: "../" diff --git a/gemfiles/rails_6.0_vc_3.0.gemfile b/gemfiles/rails_6.0_vc_3.0.gemfile deleted file mode 100644 index 3573a58f..00000000 --- a/gemfiles/rails_6.0_vc_3.0.gemfile +++ /dev/null @@ -1,21 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "appraisal", require: false -gem "capybara", require: false -gem "combustion", "~> 1.3.7" -gem "generator_spec" -gem "rails", "~> 6.0.0" -gem "rake", "~> 13.0" -gem "rspec", "~> 3.0", require: false -gem "rspec-html-matchers" -gem "rspec-rails", require: false -gem "rubocop", require: false -gem "rubocop-performance", require: false -gem "rubocop-rspec", require: false -gem "simplecov", require: false, group: :test -gem "sqlite3", "~> 1.4", group: :test -gem "view_component", ">= 3.0.0", "< 4.0" - -gemspec path: "../" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index aff79803..cf162dda 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -35,7 +35,7 @@ class ApplicationController < ActionController::Base require "capybara/rspec" require "ostruct" -Dir["./spec/support/**/*.rb"].sort.each { |f| require f } +Dir["./spec/support/**/*.rb"].each { |f| require f } RSpec.configure do |config| # Enable flags like --only-failures and --next-failure @@ -53,4 +53,8 @@ class ApplicationController < ActionController::Base config.include ViewComponent::Form::TestHelpers, type: :builder config.include Capybara::RSpecMatchers, type: :component config.include RSpecHtmlMatchers, type: :component + + config.include ActiveSupport::Testing::TimeHelpers + + config.after { travel_back } end diff --git a/spec/view_component/form/builder_spec.rb b/spec/view_component/form/builder_spec.rb index c3fb906c..ee8e8d82 100644 --- a/spec/view_component/form/builder_spec.rb +++ b/spec/view_component/form/builder_spec.rb @@ -15,7 +15,12 @@ let(:default_form_builder_output) { default_form_builder.public_send(method_name, *args, **kwargs, &block) } context "when calling ##{method_name}" do - it { is_expected.to eq(default_form_builder_output) } + # NOTE: freeze time to force #time_select test use same time + it do + freeze_time do + expect(subject).to eq(default_form_builder_output) + end + end end end diff --git a/view_component-form.gemspec b/view_component-form.gemspec index 9a2c57b0..417f5307 100644 --- a/view_component-form.gemspec +++ b/view_component-form.gemspec @@ -24,10 +24,10 @@ Gem::Specification.new do |spec| spec.files = Dir["CHANGELOG.md", "LICENSE.txt", "README.md", "app/**/*", "lib/**/*"] spec.require_paths = ["lib"] - spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") + spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0") - spec.add_dependency "actionview", [">= 6.0.0", "< 7.2"] - spec.add_dependency "activesupport", [">= 6.0.0", "< 7.2"] + spec.add_dependency "actionview", [">= 6.1.0", "< 7.2"] + spec.add_dependency "activesupport", [">= 6.1.0", "< 7.2"] spec.add_dependency "view_component", [">= 2.34.0", "< 4.0"] spec.add_dependency "zeitwerk", ["~> 2.5"] end