From e551df3416cecba973d36844c7cb7d48762489f0 Mon Sep 17 00:00:00 2001 From: Vitaliy Serov Date: Fri, 27 Dec 2024 12:12:57 +0200 Subject: [PATCH] Use `ruby-3.4` as project base --- .github/workflows/check.yml | 2 +- .rubocop.yml | 2 +- .rubocop_todo.yml | 8 ++++---- CHANGELOG.md | 1 + Dockerfile | 2 +- Gemfile | 4 ++++ Gemfile.lock | 7 ++++++- dockerfiles/debian-develop/Dockerfile | 2 +- dockerfiles/debian-next-release/Dockerfile | 2 +- dockerfiles/rockylinux-latest/Dockerfile | 2 +- lib/doc_builder_testing/doc_builder_wrapper.rb | 16 ++++++++-------- .../web_doc_builder_wrapper.rb | 8 ++++---- 12 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 329032cf..d1785b23 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3' + ruby-version: '3.4' - name: Install gem dependencies run: | gem install bundler diff --git a/.rubocop.yml b/.rubocop.yml index 45a63c82..702a8715 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,7 @@ inherit_from: .rubocop_todo.yml AllCops: NewCops: enable - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.4 # Disable this check since we test end-user product # And do not perform unit-testing of some ruby classes diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 699c2370..0e437ae4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-07-10 07:39:04 UTC using RuboCop version 1.64.1. +# on 2024-12-27 10:12:30 UTC using RuboCop version 1.69.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -11,14 +11,14 @@ Metrics/MethodLength: Max: 24 -# Offense count: 131 +# Offense count: 150 # Configuration parameters: CountAsOne. RSpec/ExampleLength: Max: 21 -# Offense count: 411 +# Offense count: 417 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings. # URISchemes: http, https Layout/LineLength: Max: 179 diff --git a/CHANGELOG.md b/CHANGELOG.md index 995c47d8..7e5a0548 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Ability to set Web Builder url via `WEB_BUILDER_URL` * Add `yamllint` check in CI * Add `dependabot` check for `GitHub Actions` +* Use `ruby-3.4` as project base ### Changes diff --git a/Dockerfile b/Dockerfile index 0f25f934..0a7d0fda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3 +FROM ruby:3.4 MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com" diff --git a/Gemfile b/Gemfile index a031aa5c..be65e761 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,10 @@ # frozen_string_literal: true source 'https://rubygems.org' + +ruby '>= 3.4.0' + +gem 'csv', '~> 3' gem 'jwt' gem 'onlyoffice_pdf_parser' gem 'ooxml_parser' diff --git a/Gemfile.lock b/Gemfile.lock index fdbd6a73..37398bba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,6 +8,7 @@ GEM bigdecimal (3.1.9) childprocess (5.1.0) logger (~> 1.5) + csv (3.3.2) diff-lcs (1.5.1) hashery (2.1.2) image_size (3.4.0) @@ -106,6 +107,7 @@ PLATFORMS ruby DEPENDENCIES + csv (~> 3) jwt onlyoffice_pdf_parser ooxml_parser @@ -120,5 +122,8 @@ DEPENDENCIES semantic yard +RUBY VERSION + ruby 3.4.1p0 + BUNDLED WITH - 2.3.24 + 2.6.2 diff --git a/dockerfiles/debian-develop/Dockerfile b/dockerfiles/debian-develop/Dockerfile index df765cf5..08900769 100644 --- a/dockerfiles/debian-develop/Dockerfile +++ b/dockerfiles/debian-develop/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3 +FROM ruby:3.4 MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com" ENV VERSION="99.99.99" diff --git a/dockerfiles/debian-next-release/Dockerfile b/dockerfiles/debian-next-release/Dockerfile index d53a185a..67015097 100644 --- a/dockerfiles/debian-next-release/Dockerfile +++ b/dockerfiles/debian-next-release/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3 +FROM ruby:3.4 MAINTAINER Pavel.Lobashov "shockwavenn@gmail.com" ENV VERSION="8.3.0" diff --git a/dockerfiles/rockylinux-latest/Dockerfile b/dockerfiles/rockylinux-latest/Dockerfile index eed42cc6..2fa319c9 100644 --- a/dockerfiles/rockylinux-latest/Dockerfile +++ b/dockerfiles/rockylinux-latest/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onlyoffice-qa/rocky-ruby-image:3.3.1 +FROM ghcr.io/onlyoffice-qa/rocky-ruby-image:3.4.1 COPY . /doc-builder-testing WORKDIR /doc-builder-testing diff --git a/lib/doc_builder_testing/doc_builder_wrapper.rb b/lib/doc_builder_testing/doc_builder_wrapper.rb index 1ac38e09..d08ca2e8 100644 --- a/lib/doc_builder_testing/doc_builder_wrapper.rb +++ b/lib/doc_builder_testing/doc_builder_wrapper.rb @@ -42,8 +42,8 @@ def run_build_command(script_file, **kwargs) # @param script_file [String] script file # @param kwargs [Hash] build arguments passed to script in key=value format # @return [nil] - def build(script_file, **kwargs) - build_result = `#{run_build_command(script_file, **kwargs)}` + def build(script_file, **) + build_result = `#{run_build_command(script_file, **)}` raise DocBuilderError, build_result if /[Ee]rror|not found/.match?(build_result) end @@ -64,8 +64,8 @@ def license_path # @param kwargs [Hash] build arguments passed to script in key=value format # @return [OoxmlParser::CommonDocumentStructure] parsed file if file is Ooxml # @return [OnlyofficePdfParser::PdfStructure] parsed structure if file is PDF - def build_and_parse(script_file, **kwargs) - temp_script_data = build_file(script_file, **kwargs) + def build_and_parse(script_file, **) + temp_script_data = build_file(script_file, **) parse(temp_script_data) end @@ -73,9 +73,9 @@ def build_and_parse(script_file, **kwargs) # @param script_file [String] path to file with script # @param kwargs [Hash] build arguments passed to script in key=value format # @return [String] path to build file - def build_file(script_file, **kwargs) + def build_file(script_file, **) temp_script_data = change_output_file(script_file) - build(temp_script_data[:temp_script_file].path, **kwargs) + build(temp_script_data[:temp_script_file].path, **) wait_file_creation(temp_script_data[:output_file]) temp_script_data[:output_file] end @@ -84,9 +84,9 @@ def build_file(script_file, **kwargs) # @param [String] script_file file to build # @param kwargs [Hash] build arguments passed to script in key=value format # @return [BinTimeResultParser] Process data - def build_file_with_usage_stats(script_file, **kwargs) + def build_file_with_usage_stats(script_file, **) temp_script_data = change_output_file(script_file) - output = `/usr/bin/time -v #{run_build_command(temp_script_data[:temp_script_file].path, **kwargs)}` + output = `/usr/bin/time -v #{run_build_command(temp_script_data[:temp_script_file].path, **)}` BinTimeResultParser.new(output) end end diff --git a/lib/doc_builder_testing/web_doc_builder_wrapper.rb b/lib/doc_builder_testing/web_doc_builder_wrapper.rb index 38519370..913d2432 100644 --- a/lib/doc_builder_testing/web_doc_builder_wrapper.rb +++ b/lib/doc_builder_testing/web_doc_builder_wrapper.rb @@ -34,8 +34,8 @@ def default_web_builder_url # @param kwargs [Hash] build arguments passed to script in key=value format # @return [OoxmlParser::CommonDocumentStructure] parsed file if file is Ooxml # @return [OnlyofficePdfParser::PdfStructure] parsed structure if file is PDF - def build_and_parse(script_file, **kwargs) - output_file = build_file(script_file, **kwargs) + def build_and_parse(script_file, **) + output_file = build_file(script_file, **) parse(output_file) end @@ -50,10 +50,10 @@ def version # @param script_file [String] path to file with script # @param kwargs [Hash] build arguments passed to script in key=value format # @return [String] path to build file - def build_file(script_file, **kwargs) + def build_file(script_file, **) temp_script_data = change_output_file(script_file) @temp_script_data = temp_script_data - link_to_file = build(temp_script_data[:temp_script_file].path, **kwargs) + link_to_file = build(temp_script_data[:temp_script_file].path, **) download_file(link_to_file, temp_script_data[:output_file]) temp_script_data[:output_file] end