From 9d421fe98a7157ac0c26916ae438ef9d4b9b61ea Mon Sep 17 00:00:00 2001 From: Yuri Smirnov Date: Tue, 16 Apr 2024 15:17:21 +0300 Subject: [PATCH] drop ruby 2.7 support --- .github/workflows/test.yml | 2 +- .rubocop.yml | 3 ++- Gemfile.lock | 6 ++++++ lib/umbrellio_utils/checks.rb | 4 ++-- lib/umbrellio_utils/parsing.rb | 2 +- spec/spec_helper.rb | 2 +- .../semantic_logger/tiny_json_formatter_spec.rb | 2 +- umbrellio_utils.gemspec | 6 +++--- 8 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da6a784..72c089b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"] + ruby: ["3.0", "3.1", "3.2", "3.3"] services: postgres: diff --git a/.rubocop.yml b/.rubocop.yml index 77d512f..8332173 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,7 +3,8 @@ inherit_gem: AllCops: DisplayCopNames: true - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 + SuggestExtensions: false Naming/MethodParameterName: AllowedNames: ["x", "y", "z"] diff --git a/Gemfile.lock b/Gemfile.lock index d0349b7..6d3c195 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,6 +164,12 @@ GEM nokogiri (1.15.6) mini_portile2 (~> 2.8.2) racc (~> 1.4) + nokogiri (1.15.6-arm64-darwin) + racc (~> 1.4) + nokogiri (1.15.6-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.15.6-x86_64-linux) + racc (~> 1.4) nori (2.7.0) bigdecimal parallel (1.24.0) diff --git a/lib/umbrellio_utils/checks.rb b/lib/umbrellio_utils/checks.rb index 569e3b6..bc00981 100644 --- a/lib/umbrellio_utils/checks.rb +++ b/lib/umbrellio_utils/checks.rb @@ -4,8 +4,8 @@ module UmbrellioUtils module Checks extend self - EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i.freeze - HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/.freeze + EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i + HOLDER_NAME_REGEXP = /\A([A-Za-z0-9.'-]+ ?)+\z/ def secure_compare(src, dest) ActiveSupport::SecurityUtils.secure_compare( diff --git a/lib/umbrellio_utils/parsing.rb b/lib/umbrellio_utils/parsing.rb index 1c17c6c..4f0f90b 100644 --- a/lib/umbrellio_utils/parsing.rb +++ b/lib/umbrellio_utils/parsing.rb @@ -9,7 +9,7 @@ module Parsing HTTP_X_HTTP_AUTHORIZATION HTTP_REDIRECT_X_HTTP_AUTHORIZATION ].freeze - CARD_TRUNCATED_PAN_REGEX = /\A(\d{6}).*(\d{4})\z/.freeze + CARD_TRUNCATED_PAN_REGEX = /\A(\d{6}).*(\d{4})\z/ def try_to_parse_as_json(data) JSON.parse(data) rescue data diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 73d9b7f..ec7c1f1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -34,7 +34,7 @@ require "umbrellio-utils" -Dir[Pathname(__dir__).join("support/**/*")].sort.each { |x| require(x) } +Dir[Pathname(__dir__).join("support/**/*")].each { |x| require(x) } TableSync.orm = :sequel TableSync.headers_callable = -> (_klass, attributes) { attributes.slice(:id) } diff --git a/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb b/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb index 754f20d..a3e7384 100644 --- a/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb +++ b/spec/umbrellio_utils/semantic_logger/tiny_json_formatter_spec.rb @@ -25,7 +25,7 @@ let(:result) { formatter.call(log, nil) } let(:formatter) { described_class.new(**options) } - let(:options) { Hash[custom_names_mapping:] } + let(:options) { Hash[custom_names_mapping: custom_names_mapping] } let(:custom_names_mapping) { Hash[] } let(:log_level) { :debug } diff --git a/umbrellio_utils.gemspec b/umbrellio_utils.gemspec index f582082..1381927 100644 --- a/umbrellio_utils.gemspec +++ b/umbrellio_utils.gemspec @@ -5,14 +5,14 @@ require_relative "lib/umbrellio_utils/version" Gem::Specification.new do |spec| spec.name = "umbrellio-utils" spec.version = UmbrellioUtils::VERSION - spec.authors = ["JustAnotherDude"] - spec.email = ["VanyaZ158@gmail.com"] + spec.authors = ["Team Umbrellio"] + spec.email = ["oss@umbrellio.biz"] spec.summary = "A set of utilities that speed up development" spec.description = "UmbrellioUtils is collection of utility classes and helpers" spec.homepage = "https://github.com/umbrellio/utils" spec.license = "MIT" - spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") + spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0") spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com/umbrellio/utils"