From 638c5d1462791c8657012074c70fe39bdb04dbbe Mon Sep 17 00:00:00 2001 From: Hermann Mayer Date: Mon, 8 Jul 2024 05:39:22 +0200 Subject: [PATCH] Dropped support for Ruby <2.7. (#6) Signed-off-by: Hermann Mayer --- .github/workflows/documentation.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 6 +++--- .gitignore | 1 + .rubocop.yml | 2 +- Appraisals | 4 ++++ CHANGELOG.md | 1 + Dockerfile | 6 +++--- Makefile | 2 +- config/docker/.bashrc | 4 +++- conversejs.gemspec | 4 ++-- gemfiles/rails_6.1.gemfile | 21 +++++++++++++++++++ .../rails_spec.rb} | 2 +- spec/spec_helper.rb | 2 +- 14 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 gemfiles/rails_6.1.gemfile rename spec/{conversejs_spec.rb => conversejs/rails_spec.rb} (92%) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a6d8ed8..8894b15 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,9 +17,9 @@ jobs: - name: Install the correct Ruby version uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 2.7 bundler-cache: true - rubygems: '3.3.26' + rubygems: '3.4.22' - name: Prepare the virtual environment uses: hausgold/actions/ci@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7cf61fb..363bb30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,12 +20,12 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Ruby 2.5 + - name: Install Ruby 2.7 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: 2.7 bundler-cache: true - rubygems: '3.3.26' + rubygems: '3.4.22' - name: Prepare the virtual environment uses: hausgold/actions/ci@master diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c5f1452..ab72446 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,8 +18,8 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.5', '2.7'] - rails: ['5.2'] + ruby: ['2.7'] + rails: ['5.2', '6.1'] env: BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile' steps: @@ -30,7 +30,7 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - rubygems: '3.3.26' + rubygems: '3.4.22' - name: Prepare the virtual environment uses: hausgold/actions/ci@master diff --git a/.gitignore b/.gitignore index 512f121..4855d69 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /pkg/ /spec/reports/ /tmp/ +/log/ /spec/dummy/tmp /spec/dummy/log /vendor/ diff --git a/.rubocop.yml b/.rubocop.yml index a7212c9..27d7ea2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,7 +12,7 @@ AllCops: NewCops: enable SuggestExtensions: false DisplayCopNames: true - TargetRubyVersion: 2.5 + TargetRubyVersion: 2.7 TargetRailsVersion: 5.2 Exclude: - bin/**/* diff --git a/Appraisals b/Appraisals index 7ba753d..b9ae0d3 100644 --- a/Appraisals +++ b/Appraisals @@ -3,3 +3,7 @@ appraise 'rails-5.2' do gem 'railties', '~> 5.2.0' end + +appraise 'rails-6.1' do + gem 'railties', '~> 6.1.0' +end diff --git a/CHANGELOG.md b/CHANGELOG.md index 51ea6a6..fcaa48b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### next * Moved the development dependencies from the gemspec to the Gemfile (#5) +* Dropped support for Ruby <2.7 (#6) ### 3.5.0 diff --git a/Dockerfile b/Dockerfile index def923e..13ccce4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM hausgold/ruby:2.5 +FROM hausgold/ruby:2.7 MAINTAINER Hermann Mayer # Update system gem -RUN gem update --system '3.3.26' +RUN gem update --system '3.4.22' # Install system packages and the latest bundler RUN apt-get update -yqqq && \ @@ -11,7 +11,7 @@ RUN apt-get update -yqqq && \ ca-certificates \ bash-completion inotify-tools && \ echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \ - gem install bundler -v '~> 2.3.0' --no-document --no-prerelease + gem install bundler -v '~> 2.4.22' --no-document --no-prerelease # Add new web user RUN mkdir /app && \ diff --git a/Makefile b/Makefile index 02748ea..bf30a79 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ test-style: \ test-style-ruby: # Run the static code analyzer (rubocop) @$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a \ - || ($(TEST) $$($(RUBY_VERSION)) != '2.5' && true)) + || ($(TEST) $$($(RUBY_VERSION)) != '2.7' && true)) clean: # Clean the dependencies diff --git a/config/docker/.bashrc b/config/docker/.bashrc index 6884dc6..4942fcf 100644 --- a/config/docker/.bashrc +++ b/config/docker/.bashrc @@ -16,7 +16,9 @@ sudo sed -i 's/autostart=.*/autostart=false/g' /etc/supervisor/conf.d/* sudo supervisord >/dev/null 2>&1 & # Wait for supervisord -while ! supervisorctl status >/dev/null 2>&1; do sleep 1; done +while ! (sudo supervisorctl status | grep avahi) >/dev/null 2>&1; do + sleep 1 +done # Boot the mDNS stack echo '# Start the mDNS stack' diff --git a/conversejs.gemspec b/conversejs.gemspec index 6d93a9b..ac8fae3 100644 --- a/conversejs.gemspec +++ b/conversejs.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.5' + spec.required_ruby_version = '>= 2.7' - spec.add_runtime_dependency 'railties', '>= 5.2' + spec.add_runtime_dependency 'railties', '>= 5.2', '< 7.0' end diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile new file mode 100644 index 0000000..46b446a --- /dev/null +++ b/gemfiles/rails_6.1.gemfile @@ -0,0 +1,21 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal", "~> 2.4" +gem "bundler", "~> 2.3" +gem "countless", "~> 1.1" +gem "guard-rspec", "~> 4.7" +gem "rails", ">= 5.2" +gem "rake", "~> 13.0" +gem "rspec", "~> 3.12" +gem "rspec-rails", "~> 5.1" +gem "rubocop", "~> 1.28" +gem "rubocop-rails", "~> 2.14" +gem "rubocop-rspec", "~> 2.10" +gem "simplecov", ">= 0.22" +gem "yard", ">= 0.9.28" +gem "yard-activesupport-concern", ">= 0.0.1" +gem "railties", "~> 6.1.0" + +gemspec path: "../" diff --git a/spec/conversejs_spec.rb b/spec/conversejs/rails_spec.rb similarity index 92% rename from spec/conversejs_spec.rb rename to spec/conversejs/rails_spec.rb index 9478097..0a947f4 100644 --- a/spec/conversejs_spec.rb +++ b/spec/conversejs/rails_spec.rb @@ -24,7 +24,7 @@ it 'converse.js javascript file is in the expected version' do get '/assets/converse.js' - assert_match(/Version: 3\.3\.4/, response.body) + expect(response.body).to match(/Version: 3\.3\.4/) end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 224c2ca..215460b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,7 +18,7 @@ # Load fixtures from the engine if ActiveSupport::TestCase.method_defined?(:fixture_path=) - ActiveSupport::TestCase.fixture_path = \ + ActiveSupport::TestCase.fixture_path = File.expand_path('fixtures', __dir__) end