From 2a4c51a730ad07c5ca52c15a900b1f8777ef44d9 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 8 Feb 2024 17:11:34 +0100 Subject: [PATCH 1/3] Drop Travis gem, ruby_dep gem, files gem This made the test suite pass on Ruby 3.3. --- Gemfile | 3 --- spec/lib/annotate/annotate_models_spec.rb | 24 +++++++++++------------ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 0998ee0d..10daacfe 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ gem 'rake', require: false group :development do gem 'bump' gem 'mg', require: false - gem 'travis', require: false platforms :mri, :mingw do gem 'yard', require: false end @@ -29,7 +28,6 @@ group :development, :test do gem 'coveralls' gem 'overcommit' - gem 'ruby_dep', '1.5.0' platforms :mri, :mingw do gem 'pry', require: false @@ -38,6 +36,5 @@ group :development, :test do end group :test do - gem 'files', require: false gem 'git', require: false end diff --git a/spec/lib/annotate/annotate_models_spec.rb b/spec/lib/annotate/annotate_models_spec.rb index 09647461..e62a3244 100644 --- a/spec/lib/annotate/annotate_models_spec.rb +++ b/spec/lib/annotate/annotate_models_spec.rb @@ -3,7 +3,7 @@ require 'annotate/annotate_models' require 'annotate/active_record_patch' require 'active_support/core_ext/string' -require 'files' +require 'pathname' require 'tmpdir' describe AnnotateModels do @@ -2014,18 +2014,16 @@ def mock_column(name, type, options = {}) context 'when `model_dir` is valid' do let(:model_dir) do - Files do - file 'foo.rb' - dir 'bar' do - file 'baz.rb' - dir 'qux' do - file 'quux.rb' - end - end - dir 'concerns' do - file 'corge.rb' - end - end + dir = Pathname(Dir.mktmpdir('annotate_models')) + dir.join('bar').mkdir + dir.join('bar', 'qux').mkdir + dir.join('concerns').mkdir + + dir.join('foo.rb').write('') + dir.join('bar', 'baz.rb').write('') + dir.join('bar', 'qux', 'quux.rb').write('') + dir.join('concerns', 'corge.rb').write('') + dir end context 'when the model files are not specified' do From 2003c0834629dc39606140ac897de847dee91066 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 8 Feb 2024 17:14:00 +0100 Subject: [PATCH 2/3] CI: Add Ruby 3.3 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f907097..7cfc9a10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7'] + ruby: ['2.7', '3.3'] steps: - name: Checkout From 17ad90fe932de1526ca2eabd2b0b31ab4ab7f38e Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 8 Feb 2024 17:16:50 +0100 Subject: [PATCH 3/3] RuboCop: exclude Guardfile from list of files This version of RuboCop failed to execute when reading that file, with this error: An error occurred while Layout/BlockAlignment cop was inspecting /home/runner/work/annotate_models/annotate_models/Guardfile:9:0. So, ignoring that, for now. --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index 4d06aa98..9c5e0819 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,6 +11,7 @@ AllCops: - 'spec/fixtures/**/*' - 'tmp/**/*' - 'spec/integration/**/*' + - 'Guardfile' NewCops: enable Metrics/BlockLength: